Skip to main content

Authentication

Generated Token is Valid for 1 hour.

Api Endpoint:

This API to generate a token will be a POST request.

{BaseUrl}/user/login

Description

The Generate Token API allows a user to obtain an authentication token, which is valid for 1 hour. This token is required for accessing other protected API endpoints.

Request

Request Header

No specific headers are required for this request, other than the default content type for a POST request.

Request Body

The body of the request should include the following parameters:

Request Body
{
"emailId": "Your email",
"password": "Your password"
}
  • emailId: Your registered email address.
  • password: Your account password.

Possible Responses:

Success Response

A successful response indicates that the token has been generated successfully.

Success Response
{
"responseCode": 200,
"responseMessage": "Success",
"responseData": {
"token": "your token",
"apiKey": "your apikey"
"expiry":"2901" "(in secs)"
}
}
  • responseCode: 200 - Indicates a successful request.
  • responseMessage: Success - A message indicating the request was successful.
  • responseData: Contains the generated token and associated user details.
    • token: A unique token for authentication.
    • emailId: The email address associated with the token.
    • apiKey: The API key associated with the user.

Error Responses

If there is an issue with the request, one of the following error responses will be returned:

Invalid Password
Invalid Password
{
"responseCode": 405,
"responseMessage": "Please provide valid password"
}
  • responseCode: 405 - Indicates that the password provided is invalid.
  • responseMessage: Please provide valid password - A message indicating the provided password is invalid.
Invalid Email
Invalid Email
{
"responseCode": 404,
"responseMessage": "Please provide valid user details"
}
  • responseCode: 404 - Indicates that the email provided is invalid or the user does not exist.
  • responseMessage: Please provide valid user details - A message indicating the provided email or user details are invalid.

Notes

  • Ensure that the email and password provided are correct and registered with the system.
  • The generated token should be securely stored and used for subsequent API requests to authenticate the user.

By following this documentation, you can effectively use the Generate Token API to obtain an authentication token for accessing protected API endpoints.