Skip to main content

Get Token

This API route allows you to obtain an API token. This token must be included in the header of subsequent requests to authenticate and authorize access to the API.

Request

POST REQUEST
https://api.openleaf.tech/api/v1/auth/getToken

FieldRequiredData TypeDescription
emailYesStringEmail used for Openleaf account
passwordYesStringPassword for Openleaf account
Header Example
{
"Content-Type": "application/json"
}
Request Body
{
"email": "test_email@gmail.com",
"password": "password123"
}

Response

FieldData TypeDescription
tokenStringOpenleaf Auth Token
Response Body
{
"token": "bfa7aeffd55f8df103bd02b228f814e6"
}

Example

Curl Command


curl --location --request POST 'https://api.openleaf.tech/api/v1/auth/getToken' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "test_email@gmail.com",
"password": "password123"
}'

Output:

{
"token": "bfa7aeffd55f8df103bd02b228f814e6"
}


IN CASE OF FAILURE

Please note, in case of any validation failure - order will not get cancelled. Please wait for 10-15 seconds before you cancel the request for latency.