Create an access
In your flagship account, on the platform, go to Settings > Integrations > Remote Control API.
You will need to fill :
- An access name
- Select one or several environments (or let empty to select all your environments)
- Select one or several actions to authorize
When you're done, click on Generate and you will see the following modal :
Keep on your side the Client id and Client secret, they will be needed to generate a token.
For security purpose we won't be able to show you those again.
Generate a token
When you have generated your access, you now need to generate the token with the one you will call our API.
To generate a token you will need to do the following request. Or you can use the online generator here https://docs.developers.flagship.io/reference/generate-a-token :
You will find your ACCOUNT_ID in Settings > Account section.
curl --location --request POST 'https://auth.flagship.io/{ACCOUNT_ID}/token?expires_in=0' \
--header 'Content-Type: application/json' \
--data-raw '{
"grant_type": "client_credentials",
"scope": "*",
"client_id": "{CLIENT_ID}",
"client_secret": "{CLIENT_SECRET}"
}'
Expiration time :
You can define the expiration time you want, for example if you want a token with an expiration time of 1800 seconds you have to call :
POST https://auth.flagship.io/{ACCOUNT_ID}/token?expires_in=1800
You now have a valid token with the list of actions you selected previously.
You can check that your token is valid by calling the following request :
curl --location --request GET 'https://auth.flagship.io/token?access_token={ACCESS_TOKEN}' \
--data-raw ''
Revoke an access
You can preview your access created or revoke them with the panel located under the access creation panel.