Create a Token

To create an authentication token using a basic authentication method (Basic Authentication) with your api_key and api_secret, you can follow the following steps. Make sure you have access to your API and have the necessary authentication information (API key and secret).

circle-info

Encoding the credentials : First, you must encode your API key (api_key) and your API secret (api_secret) in a format suitable for basic authentication. To do this, combine your credentials in the form api_key:api_secret and encode them in base64.

Authentication

POST https://api.digitalpaye.com/v1/auth

Headers

Name
Value

X-Environment

Production

Authorization

Basic bGl2ZV9kaWdpdGFscGF5ZTY3OTg3Njo1OWJlYzU4Ni0yOWYwLTRjMWMtOGE2ZC0wY2MyMDk0ZjZhMzQ=

Response

{
    "statusCode": 200,
    "message": "Successful",
    "data": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI4NDM3ZGQxMy04OWFjLTQ1ZTEtYTdhYS1jOGJhMDk1ZDFiMjciLCJpYXQiOjE3Mjg2MzQyMDMsImV4cCI6MTcyODYzNDgwM30.A3-AD5mGawbhv9nUmio0k7c-hhx5K7lqnuPFCziJJqE",
        "exp": 1728634803
    }
}
curl --location --request POST 'https://api.digitalpaye.com/v1/auth' \
--header 'X-Environment: Production' \
--header 'Authorization: Basic i0yOWYwLTRjMWMtOGE2ZC0bGl2ZV9JlYzU4NiwY2MyMDk0ZjZhMzQkaWdpdGFscGF5ZTY3OTg3Njo1OW=' \
--data ''

Last updated