POST /auth/verify
Request body
Responses
curl -X POST "https://base.sepolia.api.4mica.io/auth/verify" \
-H "Content-Type: application/json" \
-d '{
"address":"0x1111111111111111111111111111111111111111",
"message":"4mica.io wants you to sign in...",
"signature":"0xWalletSignature"
}'
const body = { address, message, signature };
const response = await fetch("https://base.sepolia.api.4mica.io/auth/verify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
});
console.log(await response.json());
import axios from "axios";
const { data } = await axios.post(
"https://base.sepolia.api.4mica.io/auth/verify",
{ address, message, signature },
);
console.log(data);
import requests
body = {"address": address, "message": message, "signature": signature}
print(requests.post("https://base.sepolia.api.4mica.io/auth/verify", json=body).json())
package main
import ("bytes"; "encoding/json"; "fmt"; "io"; "net/http")
func main() {
body, _ := json.Marshal(map[string]string{
"address": address, "message": message, "signature": signature,
})
response, _ := http.Post("https://base.sepolia.api.4mica.io/auth/verify", "application/json", bytes.NewReader(body))
defer response.Body.Close()
result, _ := io.ReadAll(response.Body)
fmt.Println(string(result))
}
{
"access_token": "eyJhbGciOi...",
"refresh_token": "rfr_...",
"expires_in": 3600
}
{ "error": "Invalid or expired SIWE signature" }
Status codes
| Code | Description |
|---|---|
200 | Signature verified and tokens issued. |
400 | The request is malformed. |
401 | The nonce, message, or signature is invalid or expired. |
500 | Authentication could not be completed. |