Sign in with a texted code
POST
/auth/phone/token
const url = 'https://api.tradeops.cc/v1/auth/phone/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"identifier":"example","code":"example","device_name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
IssuePhoneTokenRequest
object
identifier
required
The same phone number or staff ID the code was requested for.
string
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
Example generated
{ "identifier": "example", "code": "example", "device_name": "example"}Responses
Section titled “Responses”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
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" ] }}