Авторизация для серверной интеграции
Для интеграции со стороны сервера:
- Необходимо авторизоваться в методах облака, получив AuthToken
- Можно ограничить допустимые IP и подсети.
Для получения AuthToken:
- Укажите в переменных свои данные:
- ApiKey и password — полученные от службы поддержки
- rkObjectId — код вашего объекта.
- Отправьте запрос /b2b/v1/auth/gentoken
Готово, если вы получили код 200, значит, авторизация прошла успешно.
Новый токен необходимо получать каждые 15 минут.
swagger: "2.0"
host: "api.rkeeper.ru"
schemes:
- https
securityDefinitions:
ApiKeyAuth:
type: apiKey
in: header
name: ApiKey
security:
- ApiKeyAuth: []
basePath: /pub/
consumes:
- application/json
produces:
- application/json
paths:
/b2b/v1/auth/gentoken:
post:
tags:
- BackAuth
summary: получение токенов авторизации
operationId: BackAuth
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/Back2BackAuthRequest'
responses:
200:
description: Success
schema:
$ref: '#/definitions/AuthResult'
401:
description: Unauthorized request
schema:
$ref: '#/definitions/ErrorMessage'
definitions:
Back2BackAuthRequest:
required:
- password
type: object
properties:
password:
type: string
description: пароль от ApiKey
x-nullable: false
additionalProperties: false
description: Получение токена для авторизации
AuthResult:
required:
- token
- refreshToken
- aliveSecondsTtl
type: object
properties:
token:
type: string
description: Токен авторизации, нужно использовать во всех запросах
x-nullable: false
refreshToken:
type: string
description: Не используется
x-nullable: true
aliveSecondsTtl:
type: number
description: Время жизни токена в секундах
format: int64
additionalProperties: false
description: Результат авторизации
ErrorMessage:
required:
- message
type: object
properties:
message:
type: string
description: Текст причины ошибки
x-nullable: false
additionalProperties: false
description: ошибка