πQuick Start
To use the API of Rekaz Platform, you must first obtain an access token. To do that, you need a username, password and the tenant name.
API Key Management
Generating an API Key
Log into the dashboard.
Navigate to User Management > API Keys.
Click on Generate New Key. The key and its secret will be displayed once in a modalβmake sure to copy and store the secret immediately.
Regenerating an API Key
To regenerate an API key:
Go to User Management > API Keys.
Select Regenerate Key for the key you wish to replace.
Confirm the action. Note that regenerating a key will revoke the old one and display the new secret once.
Using API Keys for Authentication
To authenticate API requests using Basic Authentication:
Combine the API key and secret into a single string with the format:
key:secret
.Encode this string in Base64 format.
Include the Base64-encoded string in your HTTP request headers as follows:
Replace {base64_string}
with your Base64-encoded credentials. Always ensure you are making requests over HTTPS to secure your credentials.
π Examples for Clarity
To make it perfectly clear, we'll go through 2 examples, one for creating a customer, and the other for creating a subscription. These are typically the first 2 use cases of our api after obtaining an access token.
Example 1: Post a customer
Assume your access token is the string "abcdefgh"
. Note that tokens are a lot longer in reality.
Let's send a POST
request to /api/app/customer
Depending on your programming language, framework or tool, you need to add HTTP headers as follows:
For this particular request, the body needs to define the customer information, these values:
Sending this request should return a 200 OK response. If it returns a 401 Unauthroized, check these options:
Make sure you formatted the access token in the headers correctly as shown above.
The access token might have expired, since it only lasts an hour.
If it has expired, request a new access token.
Example 2: Post a subscription
Let's send a POST
request to /api/app/subscription
For this particular request, the body needs to define the subscription information, these values:
Getting the CustomerId
or PriceId
can be either from the API's or copy it directly from the dashboard Customers > Customer List > Copy Id
Sending this request should return a 200 OK response. If it returns a 401 Unauthroized, check these options:
Make sure you formatted the access token in the headers correctly as shown above.
The access token might have expired, since it only lasts an hour.
If it has expired, request a new access token.
If it returns a 400 Bad Request, you should check the formatting of the values in the request's body.
That is all for now. Please report any bugs or weird behavior in our api to us.
Last updated