Authentication

Claret API Authentication Processes

All Claret API calls are authenticated with tokens. Before making a call, you must authenticate first. You do this by first creating an authentication token and then use that token in the header of the subsequent API calls.

NOTE that all references to {tenant} should be replaced with the name of the Claret tenant (i.e., demo, zymoeno, etc.)

POST https://plan.claret.app/{tenant}/api/v1/tokens/create

Retrieve an authentication token from the Claret API endpoint

Query Parameters

NameTypeDescription

email*

String

The email address associated with the user account being authenticated

password*

String

The password associated with the user account being authenticated

A successful response will return a simple JSON payload containing the token value that should be used in each additional request.

Example:

{
    "token": "1|bfDoNPffjU6k541RYSLB68oEfHySweWJ2HSx34sZ"
}

Once the authentication token has been successfully retrieved, it can be used as a Bearer token within the header of each subsequent API call.

Example:

curl --location --request GET 'https://plan.claret.app/{tenant}/api/v1/sales?sale_type_name=History' \
--header 'X-Requested-With: XMLHttpRequest' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1|bfDoNPffjU6k541RYSLB68oEfHySweWJ2HSx34sZ' \

Last updated