Unpacking context_id
context_id
is a required field when querying information about an address.
It plays a pivotal role in ensuring data is correctly associated with the specific instance of your application.
This approach allows you to segment and analyze bot interactions on a per-instance basis.
Questing platforms usually create a new context_id
for each quest.
Under The Hoodβ
Each identification looks if the user has ever been a bot for that context_id
.
An address controlled for a human for one quest might be a bot for another. Therefore, our system allows you to separate the personhood check for different actions.
Key Pointsβ
- Assign a unique
context_id
to each instance or environment of your application. - Always include the relevant
context_id
in your API requests to Absinthe Protect.
What You Will Needβ
- API Key: string
- To authorize the registration and tie the id with your key
context_title
: string- This value will be part of the
context_id
and helps give it a memorable name.
- This value will be part of the
Endpoint Descriptionβ
Endpoint: api/v1/register/context_id
Method: POST
Description: This endpoint allows you to register a context_id
when given a
context_title
and ties it to your API key.
https://absinthe-prod-aj5ib4l2.ue.gateway.dev/api/v1/register/context_id
Query Parametersβ
eoa_address
: The account address you want to query for bot-status.context_id
: The unique identifier for your application context.
Headersβ
x-api-key
: Your API Key.
Request Bodyβ
context_title:
The title or name of the context you wish to register.
Success Responseβ
Code: 200 OK
{"success":true,"data":{"context_id":"sample_context_id.54b8c3b00e05"}
Error Responseβ
{"success":false,"error":{"id":"m_a_b_1","code":"UNAUTHORIZED","message":"Bad API key or contextId."}}
Examplesβ
curl --location 'https://absinthe-prod-aj5ib4l2.ue.gateway.dev/api/v1/register/context_id' \
--header 'x-api-key: <my_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"context_title": "<sample_context_title>"
}'
Or in node.js:
var myHeaders = new Headers();
myHeaders.append("x-api-key", "bHvAiwk7hUj0");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"context_title": "sampleid2"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://absinthe-prod-aj5ib4l2.ue.gateway.dev/api/v1/register/context_id", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));