Authentication
Authenticate your API requests using a bearer access token. Obtain the token using your email, company code, and API key, then include it in the Authorization header when making subsequent API requests.
Obtain Access Token
Obtains a bearer access token required to access the PowerUp Card APIs.
{{baseUrl}}/hashdt/api/v1/auth/token
Description
This API is used to exchange the user's email, company code, and API key for a JWT bearer token valid for 30 minutes.
This endpoint does not require an existing bearer token. After receiving the token, include it in the Authorization: Bearer <AccessToken> header for subsequent API requests.
📩 Request Headers
x-api-key string required
Shared X-API key.
x-company-id string required
Shared Company Code.
x-request-id string required
Idempotency key for request tracking
x-user-id string required
User identification key
Content-Type string required
Must be
application/json- 🧩 Examples
Request Example
- cURL
- Python
- Java
- NodeJs
curl --location --request POST \
--url '{{baseUrl}}/hashdt/api/v1/auth/token' \
--header 'x-api-key: {{Shared X-API key}}' \
--header 'x-company-id: {{Shared Company Code}}' \
--header 'x-request-id: {{IdempotencyKey}}' \
--header 'x-user-id: {{UserID}}' \
--header 'Content-Type: application/json'
import requests
import json
url = "{{baseUrl}}/hashdt/api/v1/auth/token"
payload = {}
headers = {
'x-api-key': '{{Shared X-API key}}',
'x-company-id': '{{Shared Company Code}}',
'x-request-id': '{{IdempotencyKey}}',
'x-user-id': '{{UserID}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("{{baseUrl}}/hashdt/api/v1/auth/token")
.method("POST", body)
.addHeader("x-api-key", "{{Shared X-API key}}")
.addHeader("x-company-id", "{{Shared Company Code}}")
.addHeader("x-request-id", "{{IdempotencyKey}}")
.addHeader("x-user-id", "{{UserID}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
const axios = require('axios');
let config = {
method: 'post',
maxBodyLength: Infinity,
url: '{{baseUrl}}/hashdt/api/v1/auth/token',
headers: {
'x-api-key': '{{Shared X-API key}}',
'x-company-id': '{{Shared Company Code}}',
'x-request-id': '{{IdempotencyKey}}',
'x-user-id': '{{UserID}}',
'Content-Type': 'application/json'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response Example
- 200
- 400
{
"code": 200,
"status": "SUCCESS",
"message": "Success",
"data": {
"token": "eyJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfa2V5IjoiWk9RUTIwMjUwNzA1IiwiZW1haWwiOiJ0ZXN0MDFAeW9wbWFpbC5jb20iLCJ1c2VyX2lkIjoiNjNiYWQxYWUtM2VmMS00ZjNhLWEyZjAtYTVjZDQyM2EyMjUwIiwiaWF0IjoxNzg4Nzg0MTQzLCJleHAiOjE3ODg4MTI5NDN9.TveBbqZNVLPzq4Xl2J4fB__dk_oM7-rw9_MOcEp6AQw",
"tokenType": "Bearer",
"expiresIn": 1800,
"userId": "user-id",
"companyCode": "company-code",
"email": "demo@yopmail.com"
}
}
{
"code": 400,
"status": "error",
"message": "Error Message"
}