Create new token

Create new token

In order to interact with Flyt endpoints anonymously, we need to create a token required for all subsequent requests.

Call the following endpoint to create a token:

curl -X "POST" "https://api.flypaythis.com/users/v1/token" \
     -H 'Content-Type: application/json' \
     -d $'{
            "channelId": "1d1094bb-6340-49ca-8bee-c6746425cc48",
            "deviceId": "10:25:ec:5f:c5:55",
            "model": "HUAWEI Nexus 6P",
            "platform": "Android",
            "platformVersion": "7.1.2",
            "frameworkVersion": "7.3.2",
            "appVersion": "5.6.2"
          }'

The response contains the generated access token:

{
  "accessToken": "8ae530ce70b4affaf4365fb5945741b52d27da01f909976dbdcd2b1bc499abc5"
}

Tokens are unique per user, channel, and session.

Every time we call the endpoint above, the token changes, and the previous one is invalidated.

Note: not every channel allows anonymous access to Flyt endpoints

The create-token endpoint returns an access token only if the channel is enabled to allow anonymous access, otherwise the error code returned is 403003.