The Frontpay API is organized around REST. Our API has predictable resource-oriented URLs, accepts "form-encoded" request bodies, returns "JSON-encoded" responses, and uses standard HTTP response codes,authentication, and verbs.
To integrate API you must have a secret Key whether in test mode or live mode, that can be acquired from above field.
The following GET request will generate a json web token(JWT) that will be used in authorization header for subsequent requests. e.g. replace "phone" with your actual phone.
- curl -XGET -H "Content-type: application/json"
- "https://dev.frontpay.pk/generateJwt?phone=+923001234567"
The response of the above API will be as follows:
{
- "success":true,
- "token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InBob25lIjoiMDMwMDEyMzQ1NjEifSwiaWF0IjoxNjEyOTM4OTg2LCJleHAiOjE2MTM1NDM3ODZ9. YYtQ7ZQtSV7By-3WynprRe0S_a56jmJjUnzkiGfSZeY",
- "createdAt":"2021-02-10T06:36:26.122Z",
- "expiresAt":"2021-02-17T06:36:26.122Z"
}
The json web token will valid for 7 days after that you have to get new token by this API.