Obtain Customer token with Curl - Command Line tool

Curl is a command line tool and library used to write scripts and manage data transfer. It is a free and open source tool found on most operating systems.

Curl can be used to obtain the token via the Unix command line (a download is required for Windows) .

Hint

Copy the curl command below into an editor to change the values for YOUR_ID and YOUR_SECRET with those provided by StatsBomb Customer Success team. Paste the updated command into a terminal window and press Enter.

curl --request POST \
  --url https://live-api.statsbomb.com/v1/token \
  --header 'content-type: application/json' \
  --data '{"client_id":"YOUR_ID","client_secret":"YOUR_SECRET"}'

Confirming the response

A successful request should return a payload containing access_token, token_type, and expires_in values:

{
  "access_token":"eyJz93a...k4laUWw",
  "token_type":"Bearer",
  "expires_in":86400
}

The access token will last for 24 hours from the time it was generated ( 86400 is 24 hours in seconds)

Obtaining a new token again

Tokens only last for 24 hours from when they were obtained. Repeat the curl command to obtain a new token.

Use the up-arrow key in the terminal to scroll through the command history. Press Enter when the curl command is shown

results matching ""

    No results matching ""