Skip to content

Getting Token ​

After creating an application from the panel, proceed with the following steps.

Application Detail Page

Send a request to the following endpoint using the Client ID and Secret Key from the panel. This request does not require a token.

Token Request ​

POST: /api/v1/auth/application ​

{api_url}/api/v1/auth/application

Content

FieldTypeRequiredDescription
clientIdstringYesClient ID
secretstringYesSecret Key
json
{
  "clientId": "eaeE34e3",
  "secret": "secret"
}
Sample cURL
shell
$ curl -X POST {api_url}/api/v1/auth/application \
    -H 'Content-Type: application/json' \
    -d '{
    "clientId": "eaeE34e3",
    "secret": "secret"
}'

Response (200)

json
{
  "success": true,
  "message": "Uygulama jetonu oluşturuldu",
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}

The token is returned in data.token, not at the root level as in the legacy version.

Errors

HTTPcodeDescription
401CLIENT_ID_OR_SECRET_INVALIDClient ID or Secret Key is wrong, or the application is inactive
422VALIDATION_FAILEDclientId or secret is missing
500INTERNAL_ERRORAn unexpected error occurred; retry the request
json
{
  "success": false,
  "code": "CLIENT_ID_OR_SECRET_INVALID",
  "message": "İstemci kimliği ya da sırrı hatalı."
}

Using the Token ​

Send the returned token in the Authorization header of every request with the Bearer prefix. Token expiration is 1 hour.

shell
$ curl {api_url}/api/v1/finance/invoices \
    -H 'Authorization: Bearer {token}'

After these steps, you can easily perform your transactions with ZEMLOG API v1 using the token.