Verify SIWE signature
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>', signature: '<string>', ttlInSeconds: 3600})
};
fetch('https://api.gnosispay.com/api/v1/auth/challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.gnosispay.com/api/v1/auth/challenge \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"signature": "<string>",
"ttlInSeconds": 3600
}
'import requests
url = "https://api.gnosispay.com/api/v1/auth/challenge"
payload = {
"message": "<string>",
"signature": "<string>",
"ttlInSeconds": 3600
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gnosispay.com/api/v1/auth/challenge"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"signature\": \"<string>\",\n \"ttlInSeconds\": 3600\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gnosispay.com/api/v1/auth/challenge")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"signature\": \"<string>\",\n \"ttlInSeconds\": 3600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/auth/challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"signature\": \"<string>\",\n \"ttlInSeconds\": 3600\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>"
}{
"error": "Internal server error"
}Authentication
Verify SIWE signature
POST
/
api
/
v1
/
auth
/
challenge
Verify SIWE signature
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>', signature: '<string>', ttlInSeconds: 3600})
};
fetch('https://api.gnosispay.com/api/v1/auth/challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.gnosispay.com/api/v1/auth/challenge \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"signature": "<string>",
"ttlInSeconds": 3600
}
'import requests
url = "https://api.gnosispay.com/api/v1/auth/challenge"
payload = {
"message": "<string>",
"signature": "<string>",
"ttlInSeconds": 3600
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gnosispay.com/api/v1/auth/challenge"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"signature\": \"<string>\",\n \"ttlInSeconds\": 3600\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gnosispay.com/api/v1/auth/challenge")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"signature\": \"<string>\",\n \"ttlInSeconds\": 3600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/auth/challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"signature\": \"<string>\",\n \"ttlInSeconds\": 3600\n}"
response = http.request(request)
puts response.read_body{
"token": "<string>"
}{
"error": "Internal server error"
}Body
application/json
Response
Signature verified successfully
JWT token for API authentication
⌘I