POST/login

User Login

The POST /login endpoint is used to authenticate and log in a user. It allows users to provide their credentials and obtain an access token, which can be used to authorize subsequent requests to protected resources within the system.

The access token is valid for 24 hours from the time of issue.

Mandatory Fields: "handle", "password"

POST/api/v1/login

Parameters

NameInTypeRequiredDescription
bodybodyuserReqRequiredUser credentials

Responses

StatusMeaningDescriptionSchema
200OKSuccessuserResp
400Bad RequestRequest data failed validation(s)None
401UnauthorizedAuthentication Failed!None
429Too Many RequestsToo Many Requests.None
500Internal Server ErrorInternal Server ErrorNone

Code Samples

const inputBody = {
  "handle": "myuser",
  "password": "supersecret"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'
};

fetch('/api/v1/login', {
  method: 'POST',
  body: JSON.stringify(inputBody),
  headers: headers
})
.then(function(res) {
  return res.json();
}).then(function(body) {
  console.log(body);
});

Body Parameter

{
  "handle": "myuser",
  "password": "supersecret"
}

Example Response

200 Response
{
  "error": false,
  "handle": "myuser",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Need Support?

Our team is here to help you integrate and make the most of our APIs. Get in touch for technical support, custom solutions, or any questions.