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://api.footballapi.com/v1/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
--header "Content-Type: application/json"
--request POST
--data '{
"access_key": "YOUR_ACCESS_KEY",
"secret_key": "YOUR_SECRET_KEY",
"app_id": "YOUR_APP_ID",
"device_id": "YOUR_DEVICE_ID"}'
https://api.footballapi.com/v1/auth/
access_key
& secret_key
will be provided upon providing the App details.app_id
can be any string. It is the ID for the app.device_id
can be any string. It is a device identification id.{"auth": {"access_token": "2s149XXXXXX851345s101959607XXXXXXXXXX",
"expires": "1531925621.0"},
"expires": -1,
"status": "true",
"status_code": 200,
"version": "1.0.0"}