Client authorization

The method is used to authorize the client in the system. The response returns an access token and a refresh token, which are required for further requests to the API.

Endpoint description The method is used to authorize the client in the system. The response returns an access token and a refresh token, which are required for subsequent requests to the API.


Request: Authorization

URL: POST /auth/sign-in

Tags: auth

Description:

Client authorization using credentials (email, one-time password or regular password).

Example request (cURL):

curl -X 'POST' \
  'https://api.client.nbcgate.tech/auth/sign-in' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "example@domain.com",
  "otp": "123456",
  "password": "yourpassword"
}'

Request body:

Field
Type
Required
Description
Example

email

string

Yes

User's e-mail

example@domain.com

otp

string

No

One-time password (if used)

123456

password

string

No

User password

yourpassword

Note: Be sure to specify either otp or password, depending on the authorization method used.


An example of a successful response:

Response code: 200 OK

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "dXNlcl9yZWZyZXNoX3Rva2Vu..."
}

Response Description:

Field
Type
Description
Example Value

token

string

Access token used for authorization in API

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

refreshToken

string

Token for access update

dXNlcl9yZWZyZXNoX3Rva2Vu...


Response Codes:

Response code
Description
Possible causes

200

Successful authorization

Correct credentials

400, 404

Invalid query or user not found

Error in request parameters

500

Internal server error

Problems on the server side

default

Unknown error

Clarification of the reasons is required

Last updated