Sign in with email and password
const url = 'https://api.tradeops.cc/v1/auth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"hello@example.com","password":"example","device_name":"example","code":"example","recovery_code":"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/token \ --header 'Content-Type: application/json' \ --data '{ "email": "hello@example.com", "password": "example", "device_name": "example", "code": "example", "recovery_code": "example" }'Returns a bearer token for the field app. Members who use two-factor sign-in must also send code or recovery_code; without one the response is a 422 with an error on code.
Request Bodyrequired
Section titled “Request Bodyrequired”object
A name for this device, shown to the member when they review their signed-in devices. Signing in again from a device with the same name replaces its old token.
Six-digit code from the member’s authenticator app. Required when they use two-factor sign-in, unless recovery_code is sent.
One of the member’s two-factor recovery codes. Each code works once.
Example generated
{ "email": "hello@example.com", "password": "example", "device_name": "example", "code": "example", "recovery_code": "example"}Responses
Section titled “Responses”object
The bearer token. Send it as Authorization: Bearer {token}. It doesn’t expire; revoke it by signing out.
Example
{ "token_type": "Bearer"}Validation error
object
Errors overview.
A detailed description of each field that failed validation.
object
Example generated
{ "message": "example", "errors": { "additionalProperty": [ "example" ] }}Too many requests. Wait for Retry-After seconds before trying again.
object
Example generated
{ "message": "example"}Headers
Section titled “Headers”Seconds until you can try again.