Authorize partner with login and password
- Authentication
This method does not require authentication.
Summary
Authorize api user
Description
This method authorizes an API user and returns user info and value of a token.
The parameters required are login and password - the user's credentials.
Optional parameter expiresIn is time in seconds until the token expires. By default, it equals 864000 seconds or 10 days.
Body Parameters
name | type | data type | default | description |
|---|---|---|---|---|
login | required | string | N/A | your login |
password | required | string | N/A | your password |
expiresIn | optional | integer | 864000 | token ttl in seconds |
Response
The response data contains an object with the following properties:
- token: string
A string that represents the user's authorization token.
- user: object (see User)
This is a reference to the User schema and represents user related information.
Good response Example
{
"status": "ok",
"statusCode": 200,
"data": {
"token": "your-token",
"user": {
"_id": "your-id",
"email": "your-email",
"login": "your-login",
"role": "your-role",
"partner_role": "your-partner-role",
"partner": "your-partner-name",
"store_ids": [
"your-store_id"
],
"first_name": "your-first-name",
"last_name": "your-last-name",
"created_at": "2024-01-01T10:00:00.000Z",
"updated_at": "2024-01-01T10:00:00.000Z"
}
}
}
Bad Response Examples
HTTP code | Response example |
|---|---|
|
Last modified: 09 February 2024