Tenant User Login API
Login API EndpointTenant User Login
The Tenant User Login API endpoint enables tenants to authenticate and obtain an access token
for accessing protected resources within the customer portal. Additionally, this endpoint
provides essential user details through the authContactBookInfo
field.
POST
/v1/login
Request Content Type
application/json
Response Content Type
application/json
Request Header
-
Authorization: X-API-Key string required
X-API-Key is a string of letters and numbers used to authenticate and control access to the API. It can be generated in the StoRegister management application.
Request Body:
-
userName string required
userName refer to email id of the user attempting to login. -
password string required
password refer to password associated with the username.
Response Payload:
-
succeeded boolean
Indicates whether the tenant user authentication and token retrieval were successful. It is a boolean value wheretrue
denotes success, andfalse
indicates failure. -
status string
Describes the status of the tenant user login attempt. It is a string providing additional information about the login status. -
data object | null
Upon success, this property enables tenants to authenticate and obtain an access token for accessing protected resources within the customer portal. Additionally, it provides essential user details through theauthContactBookInfo
field. If the login attempt is not successful, the value isnull
. -
errors array
Holds error information if applicable. It is an array containing error details in case there are issues with the tenant user login attempt.
object: data.authContactBookInfo
-
id unique-identifier
User ID. -
firstName string
First name of the user. -
lastName string
Last name of the user. -
email string
User's email address. -
phoneNumber string
User's phone number. -
address string
User's street address. -
city string
User's city of residence. -
region int
State / County / Province ID (if applicable) for the tenant, by default 0 (if applicable). -
postalCode string
User's postal code. -
country string
User's country code.
string: token
-
data.token string
The token property in the response payload is a JSON Web Token (JWT) that serves as an authentication token, granting the authenticated tenant user access to protected resources within the StoRegister Management Application. This token should be included in the Authorization header of subsequent API requests.
Request Header
Authorization: X-API-Key --api-key--
API Request
{
"userName": "[email protected]",
"password": "Super@123"
}
API Response
{
"data": {
"authContactBookInfo": {
"id": "762a1f4a-6c85-49bd-b975-7b9a1fcd8ea4",
"firstName": "Marcus",
"lastName": "Johansen",
"email": "[email protected]",
"phoneNumber": "+33 10000000",
"address": "Jernbanegade 14",
"city": "Tappernøje",
"region": 0,
"postalCode": "4733",
"country": 64
},
"token": "jwt-token"
},
"succeeded": true,
"status": "SUCCESS",
"errors": null
}
Error Codes
-
INVALID_PARAM_USER_NAME
INVALID_PARAM_USER_NAME refers to invalid username. -
INVALID_PARAM_USER_PASSWORD
INVALID_PARAM_USER_PASSWORD refers to invalid password. -
INVALID_USER_LOGIN
INVALID_USER_LOGIN refers to username not available. -
INVALID_PARAM_USER_INFO_ID
INVALID_PARAM_USER_INFO_ID refers to invalid user id. -
INVALID_PARAM_TENANT_USER_NAME
INVALID_PARAM_TENANT_USER_NAME refers to invalid username. -
INVALID_PARAM
INVALID_PARAM refers to invalid contact-book id. -
INVALID_CONTACT_BOOK_DETAILS_INFO
INVALID_CONTACT_BOOK_DETAILS_INFO refers to un-matched contact details. -
DB_INVALID_PARAM_USER_NAME
DB_INVALID_PARAM_USER_NAME refers to invalid username from database. -
NO_RECORDS_FOUND
NO_RECORDS_FOUND means there is no relevant information found. -
SOMETHING_WENT_WRONG
SOMETHING_WENT_WRONG refers to technical glitch. Please contact administrator.