Login
const url = 'https://api.tradecloud1.com/v2/authentication/login';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.tradecloud1.com/v2/authentication/login \ --header 'Authorization: Basic <credentials>'Use basic authentication to get access and refresh tokens.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Successfully authenticated, use the tokens provided in the headers.
object
The username of the identity.
The user identifier this identity is authorized for.
The company identifier this identity is authorized for.
The additional company identifiers this identity is authorized for.
The identity has enabled two factor authentication.
Two factor authentication is enforced for this identity.
The identity authentication status:
unauthenticated- the identity needs to authenticate with username & passwordauthenticated- the identity has been completely authenticatedneeds_2fa_code_verification- the identity needs to authenticate with a TOTPneeds_2fa_setup- the identity needs to setup second factor authentication
The provider of the identity.
Example
{ "userRoles": [ "admin" ], "companyRoles": [ "buyer" ], "status": "unauthenticated", "identityProvider": "tradecloud"}Headers
Section titled “Headers”Access token
Refresh token
Not authenticated, the user should authenticate using basic authentication.
Not authenticated, the user should authenticate using basic authentication.
object
The authentication failure message
The number of login attempts that are left
The number of seconds that remain until a next authentication attempt can be made
Example generated
{ "message": "example", "attemptsLeft": 1, "banned": 1}Service is not healthy (internal error), Tradecloud ops will be alerted.
Service is not healthy (bad gateway), Tradecloud ops will be alerted.
Service is unavailable (overloaded or down for maintenance), Tradecloud ops will be alerted.
Service is unavailable (gateway timeout), Tradecloud ops will be alerted.
