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.
Request
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.Response
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/
Request
https://rest.cricketapi.com/rest/v4/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.Response
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/v4/auth/
app_id, access_key & secret_key will be provided in Apps.
device_id can be any string. It is a device identification id.
Sample Response Of Auth API
{
"status": true,
"version": "2.0.2",
"status_code": 200,
"expires": "-1",
"auth": {
"access_token": "2s153724147994715s1209492282143811336",
"push_servers": [
{
"host": "54.251.96.54",
"port": "8000"
}
],
"expires": "1577200406.0"
},
"Etag": null,
"cache_key": "auth|2sXXXX2414XXXX715s1209492282143811336|developer|"
}