Authentication is the process of verifying and confirming the identity of a user or entity to ensure that only authorized individuals or entities can access a system or protected resources.

Token-based authentication relies on the issuance of a unique token to the user after a successful authentication. This token is used to verify the user’s identity and access rights in subsequent requests.

The authentication method used with ChatFly is Bearer token. In this method, a bearer token is provided to the user upon successful authentication. This token serves as proof of the user’s identity and is included in the authorization header of subsequent requests to access protected resources. It allows the server to verify and authorize the user’s access based on the validity and permissions associated with the token.

'Authorization': 'bearer <access_token>'

How does this work?

Register an account

Users register for an account ChatFly system by providing requested information, such as username and password.

Your system will authenticate and store the user’s credentials.

Authentication and token generation

The user sends an authentication request to your system by providing login information, such as username and password, through an API endpoint: https://backend.chatfly.co/token

The response return like this:

Response Example
{
  "message_code": 0,
  "message": "API success",
  "data": {
    "access_token": "string token",
    "token_type": "bearer"
  }
}

Users must send the token in the Authorization header of requests to ChatFly system.

The Authorization header will have the following value: Authorization: Bearer [access_token].