Auth
Self-service API key management (create / retrieve / delete), authenticated by an EIP-712 wallet signature instead of an API key. See the Authentication section for the typed-data structure, examples, error codes and activation timing.
Retrieve the wallet's current API key. Authenticated by an EIP-712 wallet signature with action: get (see the Authentication section).
Returns HTTP 200 with the outcome in errno: 0 success, 11010 no API key found, 11011 / 11012 invalid / expired signature. get signatures can be retried within the 5-minute window.
Signing wallet address
EIP-712 signature over the OpinionApiKeyAuth typed data (see the Authentication section)
Unix timestamp in seconds; must equal the signed timestamp field. Valid for 5 minutes.
Successful response (check errno in the body)
Envelope used by the Auth endpoints. Unlike the data endpoints, the outcome is reported in errno / errmsg.
Business result code (0 for success; see the Authentication section for the full list)
0Error message (empty on success)
GET /openapi/auth/api-key HTTP/1.1
OPINION_ADDRESS: text
OPINION_SIGNATURE: text
OPINION_TIMESTAMP: text
Accept: */*
Successful response (check errno in the body)
{
"errno": 0,
"errmsg": "",
"result": {
"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"walletAddress": "0x0000000000000000000000000000000000000000"
}
}Create the wallet's API key. Authenticated by an EIP-712 wallet signature with action: create (see the Authentication section).
Returns HTTP 200 with the outcome in errno: 0 success, 11004 issuance disabled, 11005 wallet is not a registered Opinion account, 11009 key already exists, 11011 / 11012 / 11013 invalid / expired / already-used signature. A newly created key becomes active at the gateway within about 15 seconds — retry on 401.
Signing wallet address
EIP-712 signature over the OpinionApiKeyAuth typed data (see the Authentication section)
Unix timestamp in seconds; must equal the signed timestamp field. Valid for 5 minutes.
Successful response (check errno in the body)
Envelope used by the Auth endpoints. Unlike the data endpoints, the outcome is reported in errno / errmsg.
Business result code (0 for success; see the Authentication section for the full list)
0Error message (empty on success)
POST /openapi/auth/api-key HTTP/1.1
OPINION_ADDRESS: text
OPINION_SIGNATURE: text
OPINION_TIMESTAMP: text
Accept: */*
Successful response (check errno in the body)
{
"errno": 0,
"errmsg": "",
"result": {
"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"walletAddress": "0x0000000000000000000000000000000000000000"
}
}Delete (revoke) the wallet's current API key. Authenticated by an EIP-712 wallet signature with action: delete (see the Authentication section). Deleting when no key exists is treated as success, so it is safe to retry.
The revoked key stops working at the gateway within about 10 seconds.
Signing wallet address
EIP-712 signature over the OpinionApiKeyAuth typed data (see the Authentication section)
Unix timestamp in seconds; must equal the signed timestamp field. Valid for 5 minutes.
Successful response (check errno in the body)
Envelope used by the Auth endpoints. Unlike the data endpoints, the outcome is reported in errno / errmsg.
Business result code (0 for success; see the Authentication section for the full list)
0Error message (empty on success)
DELETE /openapi/auth/api-key HTTP/1.1
OPINION_ADDRESS: text
OPINION_SIGNATURE: text
OPINION_TIMESTAMP: text
Accept: */*
Successful response (check errno in the body)
{
"errno": 0,
"errmsg": "",
"result": {
"deleted": true
}
}Last updated