obtain-token
Obtain a Token
To make requests to our API, a token is required. To retrieve a token, you need to make a request to the /jwt/token endpoint as follows:
API Documentation: Create OAuth2 Token
Request:
curl -i -X POST \
https://sandbox-api.pathly.io/jwt/token \
-H 'Content-Type: application/json' \
-d '{
"merchant_id": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
"key": "sk_uFAaQdJTDLVg8S7cloi9r1Wpk6430tyB"
}'
You need to provide your merchant ID and the secret key, both can be found on your developer’s dashboard (https://sandbox.pathly.io/developers).
Response:
{
"status": "success",
"data": {
"token": "i1qxz68gu50zp4i8ceyxqogmq7y0yienm52351c6...",
"expires_in": 900
},
"code": 200,
"message": "Successful request"
}
You need to store the token which will be used on subsequent requests. All tokens have an expiration time which will be specified in the expires_in and is expressed in seconds from the moment the token was generated.
Publishable and Secret tokens have different scopes and should be used for different scenarios. For server-to-server requests use the Secret token and for requests made from your UI, please use the publishable key.