To access any API, access token is required. Auth API provides the access token, by validating your request. Call Auth API whenever the access token is expired.
In the case of "Invalid Access Token" error, re-generate the access token. Generally, the access token be re-generated for every 24 hours from the time the access token is generated or whenever the API response throws "InvalidAccessToken" error.
https://rest.cricketapi.com/rest/v2/auth/
POST
POST Params:
access_key
- Required. Access key of your application.secret_key
- Required. Secret key of your application.app_id
- Required. Your app_iddevice_id
- Required. Unique id of the client device or browser.auth.access_token
- String.Access token for your future requests.auth.expires
- String (long). Expiration date in unix epoch timestamp.CURL Command to authenticate your app.
$ curl -X POST \
-d "access_key=YOUR_ACCESSKEY"\
-d "secret_key=YOUR_SECRETKEY"\
-d "app_id=YOUR_APPID"\
-d "device_id=YOUR_DEVICEID"\
https://rest.cricketapi.com/rest/v2/auth/
app_id, access_key & secret_key will be provided in Apps.
device_id can be any string. It is a device identification id.
{
"status":true,
"version":"2.0.2",
"status_code":200,
"expires":"-1",
"auth":{
"access_token":"2s14XXXX97325301s976461134951486121",
"expires":"1521641451.0"
},
"Etag":null,
"cache_key":"auth|2s14XXXX97325301s976461134951486121|app_id|"
}