Access Token Generation
This section describes the API endpoint used to generate the access token required for authenticated communication with CellPay services.
Endpoint:
{base-url}/access/login
This endpoint authenticates the API consumer and issues a JWT access token upon successful validation of credentials.
Method: POST
Request Headers:
The following HTTP headers are required when calling the access token API:
Content-Type: application/json
Authorization: Basic Base64Encoded(username:password)
The Authorization header must contain the Base64-encoded value of the username and password separated by a colon.
cURL
curl --location '{base-url}/access/login' \
--header 'Content-Type: application/json' \
--header 'Authorization: **************' \
--header 'Cookie: JSESSIONID=4163BDD1F82014C9CDC82F215C074CE2' \
--data '{
"authType": "ACCESS_TOKEN",
"webRequest": true
}
'
Request Body
The request body must be provided in JSON format and specify the authentication type as shown below:
{
"authType": "ACCESS_TOKEN"
}
Successful Response
Upon successful authentication, the API returns a response containing the access token and its validity period. The access token must be securely stored and used for subsequent API requests.
{
"status": true,
"sessionExpired": true,
"accessClient": "eyJhbGciOiJIUzI1NiJ9.....",
"expiresIn": 600
}
Service Parameters
The following parameters are returned and validated in the success response upon successful user authentication from CellPay.
| Parameter Name | Parameter Type | Description |
|---|---|---|
| status | Boolean | Indicates whether the user has successfully authenticated with CellPay. Returns true for successful authentication; otherwise false. |
| sessionExpired | Boolean | Indicates whether the user session has expired due to inactivity or missing required inputs. Returns true if the session has expired. |
| accessClient | String | JWT access token generated upon successful authentication. This token must be included in subsequent API calls to authorize access to the CellPay Payment system. |
| expiresIn | String | Lifetime of the current session in seconds. Once this duration elapses without user activity, the session and token become invalid. |