Authorization in the Back Office

The B2COPY API supports authorization that uses a bearer token. To get a pair of access and refresh tokens, use the method described below. Once you have the access token, make sure to include the access token in the Bearer Authorization Header of your API requests.

To obtain a pair of access and refresh tokens, you must already be registered in the Back Office and have credentials to access it.

POST [host]/api/v2/signin

Request

In the request body, specify the following parameters:

Body

NameTypeRequiredDescription

email

string

Yes

The email address used for accessing the Back Office.

password

number

Yes

The password used for accessing the Back Office.

Request example

curl --location --request POST 'https://host.name/api/v2/signin' \
--data-raw '{
  "email": "username@example.com",
  "password": "Secret123"
}'

Response

The response includes a pair of access and refresh tokens.

Response example

{  
  "2faRequired": false,
  "accessToken": {
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjU2MDY3MTU0LCJleHAiOjE2NTYxMDMxNTQsImlzcyI6Imh0dHBzOlwvXC9hcC52ZW5kb3IuY29tIn0.u6HuS_oQ4udk2EEUa-7XutJ0CAKIZty1OcFaqTckLRGYEr3xcWXZEHCfrhDl31N6_t0XP6_m-ESue_NoWx_f1sGMv6XMT0pPg1NQ1XJ1JJ4slaeEWjSuGIl8_Jbj-20zZOvwzUZbed7UQg0jUM11OUt0l1jVVSF19vKJJpVGFDYMIOHkS7tlFeKiypReYRd2af-Pf_au1v6vG3V42SFpZER3eKqALZkoT617B35enJdtUqmyrRgb_rCIOCwAHQdUcOuosyBUk9U-Cz3WEoHx5nqtvFVAeXKqlbn0Cbqk4joFt1FY8nUqlyVZNI9E3-dbjFPzod8Vej6rkAVd312M3w",
      "createdAt": "2024-01-01T00:00:00+00:00",
      "expiresAt": "2024-01-01T00:00:00+00:00"
   },
   "refreshToken": {
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjU2MDY3MTU0LCJleHAiOjE2NTYxMDMxNTQsImlzcyI6Imh0dHBzOlwvXC9hcC52ZW5kb3IuY29tIn0.u6HuS_oQ4udk2EEUa-7XutJ0CAKIZty1OcFaqTckLRGYEr3xcWXZEHCfrhDl31N6_t0XP6_m-ESue_NoWx_f1sGMv6XMT0pPg1NQ1XJ1JJ4slaeEWjSuGIl8_Jbj-20zZOvwzUZbed7UQg0jUM11OUt0l1jVVSF19vKJJpVGFDYMIOHkS7tlFeKiypReYRd2af-Pf_au1v6vG3V42SFpZER3eKqALZkoT617B35enJdtUqmyrRgb_rCIOCwAHQdUcOuosyBUk9U-Cz3WEoHx5nqtvFVAeXKqlbn0Cbqk4joFt1FY8nUqlyVZNI9E3-dbjFPzod8Vej6rkAVd312M3w",
      "createdAt": "2024-01-01T00:00:00+00:00",
      "expiresAt": "2024-01-01T00:00:00+00:00"
   }
}

Last updated

Was this helpful?