API: Authentication

REST API for Authentication

API documentation for login, logout and password reset.

Login

Returns the BEARER TOKEN which should be added in the header of all other requests using the following syntax:

-H “Authorization: Bearer ${token}”

In addition, the API will return an array of all partitions that the user has some kind of access to.

curl -X POST \
	"https://system.complyon.com/api/login" \
	-H "accept: application/json" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-d "email=${email}&password=${password}"
ParameterInput exampleTypeMandatory
emailnoreply@complyon.comtextYes
password#MyAwesomePassword86textYes

If successful, the API will a JSON containing the bearer token, details about the user, and a detailed list of clients:

{
  "token": "ey...",
  "user": {},
  "clients": [
    {
      "id": 1,
      "slug": "complyon",
      "name": "Complyon"
    }
  ]
}

Logout

Call API to manually logout the Bearer token.

curl -X POST \
	"https://system.complyon.com/api/logout" \
	-H "accept: application/json" \
	-H "Authorization: Bearer ${token}" \
	-d ""

Request password reset token

Call API to request a password reset email to be send to the defined email address. The email will contain the token needed for the actual Password reset step.

curl -X POST \
	"https://system.complyon.com/api/password/email" \
	-H "accept: application/json" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-d "email=${email}"
ParameterInput exampleTypeMandatory
emailnoreply@complyon.comtextYes

Password reset

Call API to complete the password reset.

curl -X POST \
	"https://system.complyon.com/api/password/reset" \
	-H "accept: application/json" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-d "email=${email}&password=${new_password}&password_confirmation=${new_password}&token=${password_reset_token}"
ParameterInput exampleTypeMandatory
emailnoreply@complyon.comtextYes
password#MyAwesomePassword86textYes
password_confirmation#MyAwesomePassword86textYes
token[Auto generated token provided in the password reset email]textYes

 

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

Want to hear more?

Let's talk about how our experience and software can help your company.