Skip to content

Sign in with a texted code

POST
/auth/phone/token
curl --request POST \
--url https://api.tradeops.cc/v1/auth/phone/token \
--header 'Content-Type: application/json' \
--data '{ "identifier": "example", "code": "example", "device_name": "example" }'

Exchanges the code for a bearer token for the field app.

Media typeapplication/json
IssuePhoneTokenRequest
object
identifier
required

The same phone number or staff ID the code was requested for.

string
<= 50 characters
code
required

The six-digit code from the text message. Spaces and dashes are ignored.

string
device_name
required

A name for this device. Signing in again from a device with the same name replaces its old token.

string
<= 255 characters

Example generated

{
"identifier": "example",
"code": "example",
"device_name": "example"
}
Media typeapplication/json
object
token
required

The bearer token. Send it as Authorization: Bearer {token}. It doesn’t expire; revoke it by signing out.

string
token_type
required
string
Allowed value: Bearer

Example

{
"token_type": "Bearer"
}

Validation error

Media typeapplication/json
object
message
required

Errors overview.

string
errors
required

A detailed description of each field that failed validation.

object
key
additional properties
Array<string>

Example generated

{
"message": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}