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
| Field | Required | Data Type | Description |
|---|---|---|---|
| Yes | String | Email used for Openleaf account | |
| password | Yes | String | Password for Openleaf account |
Header Example
{
"Content-Type": "application/json"
}
Request Body
{
"email": "test_email@gmail.com",
"password": "password123"
}
Response
| Field | Data Type | Description |
|---|---|---|
| token | String | Openleaf 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.