Technical description of the platform

REST API: authorization service methods

https://img.shields.io/badge/auth-required-orange.svg

GET ​/status

The method is used for obtaining of the authorization service status.

Example of the service response:

GET ​/status:
{
 "status": "string",
 "version": "string",
 "commit": "string"
}

POST ​/v1​/user

The method is used for registration of a new user via the authorization service.

The method query contains following data:

  • login – user login (e-mail address);

  • password – account password;

  • locale – e-mail notifications language (possible variants: en and ru);

  • source – user type:

If the registration has been carried out successful, the method returns the 201 code. In case of another response, a user has not been registered.

GET ​/v1​/user​/profile

The method is used for obtaining of user data.

Example of the service response:

GET ​/v1​/user​/profile:
{
 "id": "string",
 "name": "string",
 "locale": "en",
 "addresses": [
 "string"
 ],
 "roles": [
 "string"
 ]
 }

POST ​/v1​/user​/address

The method is used for obtaining of a user address identifier. The method query contains following data:

  • address – user blockchain address;

  • name – user name.

Example of the service response:

POST ​/v1​/user​/address: :animate: fade-in-slide-down
{
  "addressId": "string"
 }

GET /v1​/user​/address​/exists

The method is used for checking of a user e-mail address. The method query contains a user e-mail address.

Example of the service response:

GET /v1​/user​/address​/exists: :animate: fade-in-slide-down
{
   "exist": true
 }

POST ​/v1​/user​/password​/restore

The method is used for restoring of an account password.

The method query contains following data:

  • email – user e-mail;

  • source – user type:

    Example of the service response:

    POST ​/v1​/user​/password​/restore: :animate: fade-in-slide-down
    {
       "email": "string"
    }
    

POST ​/v1​/user​/password​/reset

The method is used for user password reset.

The method query contains following data:

  • token – user authorization token;

  • password – current user password.

Example of the service response:

POST ​/v1​/user​/password​/reset: :animate: fade-in-slide-down
{
  "userId": "string"
 }

GET ​/v1​/user​/confirm​/{code}

The method is used for confirmation of a password restoring code for a user account. The method query contains a confirmation code value.

POST ​/v1​/user​/resendEmail

The method is used for resending of a password recovery code to a specified e-mail.

The method query contains following data:

The method response returns a user e-mail, to which a restoring code was sent.

Example of the service response:

POST ​/v1​/user​/resendEmail:
{
   "email": "string"
}

POST ​/v1​/auth​/login

The method is used for obtaining of a new authorization token for a user.

The method query contains following data:

  • name – user name;

  • password – account password;

  • locale – e-mail notifications language (possible variants: en and ru);

  • source – user type:

Example of the service response:

POST ​/v1​/auth​/login:
{
  "access_token": "string",
  "refresh_token": "string",
  "token_type": "string"
 }

POST ​/v1​/auth​/token

The method is used for obtaining of authorization tokens for external services and applications. This method does not require any query parameters.

Example of the service response:

POST ​/v1​/auth​/token:
{
  "access_token": "string",
  "refresh_token": "string",
  "token_type": "string"
 }

POST ​/v1​/auth​/refresh

The method is used for obtaining of a new refresh token. The method query contains a current refresh token value.

Example of the service response:

POST ​/v1​/auth​/refresh:
{
  "access_token": "string",
  "refresh_token": "string",
  "token_type": "string"
 }

GET​ /v1​/auth​/publicKey

The method is used for obtaining of an authorization service public key. This method does not require any parameters in its query.

Example of the service response:

POST ​/v1​/auth​/refresh:
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA7d9Oj/ZQTkkjf4UuMfUu
QIFDTYxYf6QBKMVJnq/wXyPYYkV8HVFYFizCaEciv3CXmBH77sXnuTlrEtvK7zHB
KvV870HmZuazjIgZVSkOnOY7F8UUVNXnlzVD1dPsOGJ6orM41DnC1W65mCrP3bjn
fV4RbmykN/lk7McA6EsMcLEGbKkFhmeq2Nk4hn2CQvoTkupJUnOCP1dhO4bq1lQ7
Ffj9K/FJq73wSXDoH+qqdRG9sfrtgrhtJHerruhv3456e0zyAcDO8+sJUQFKY80B
SZMEndVzFS2ub9Q8e7BfcNxTmQPM4PhHO5wuTqL32qt3uJBx2OI4lu3OND44ZrDJ
BbVog73oPjRYXj+kTbwUZI66SP4aLcQ8sypQyLwqKk5DtLRozSN0OIrupJJ/pwZs
9zPEggL91T0rirbEhGlf5U8/6XN8GVXX4iMk2fD8FHLFJuXCD7Oj4JC2iWfFDC6a
uUkwUfqfjJB8BzIHkncoqOZbpidEE2lTWl+svuEu/wyP5rNlyMiE/e/fZQqM2+o0
cH5Qow6HH35BrloCSZciutUcd1U7YPqESJ5tryy1xn9bsMb+On1ocZTtvec/ow4M
RmnJwm0j1nd+cc19OKLG5/boeA+2zqWu0jCbWR9c0oCmgbhuqZCHaHTBEAKDWcsC
VRz5qD6FPpePpTQDb6ss3bkCAwEAAQ==
-----END PUBLIC KEY-----
See also