Методы API
DEVELOPER PLATFORM · v1

API, с которым удобно работать

CRM, кампании, аналитика и интеграции. Точные контракты, понятные примеры и подписанные вебхуки.

Скачать OpenAPI

Private preview: API доступен с проектным ключом. Публичные SLA и сроки поддержки ещё не установлены.

POST

Отправить текст клиенту диалога

/api/v1/developer/messaging/conversations/{conversationId}/messages

Штатная доставка с Idempotency-Key. Повтор той же команды возвращает тот же message ID. HTTP 200 не доказывает отправку: проверяйте deliveryStatus сообщения и status попытки; pending/failed не подтверждены.

Право доступаmessaging.write

Authorization: Bearer YOUR_PROJECT_TOKEN

Параметры

conversationIdобязательно · path

stringformat: "uuid"

JSON Schema
{
  "type": "string",
  "format": "uuid"
}
idempotency-keyобязательно · header

stringpattern: "^[\\x21-\\x7E]+$" · minLength: 1 · maxLength: 160

JSON Schema
{
  "type": "string",
  "minLength": 1,
  "maxLength": 160,
  "pattern": "^[\\x21-\\x7E]+$"
}

Тело запроса

application/json

object

textобязательно
stringminLength: 1 · maxLength: 4096
expectedProjectId
stringminLength: 1 · maxLength: 160
JSON Schema
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "expectedProjectId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    }
  },
  "required": [
    "text"
  ],
  "additionalProperties": false
}

Примеры запроса

curl --request POST   'https://YOUR_NOVA_HOST/api/v1/developer/messaging/conversations/CONVERSATION_ID/messages'   --header 'Authorization: Bearer YOUR_PROJECT_TOKEN'   --header 'Idempotency-Key: YOUR_UNIQUE_COMMAND_ID'   --header 'Content-Type: application/json'   --data '{"text":"Тест интеграции ERP"}'

Ответы

200 Exact delivery receipt
application/json

object

projectIdобязательно
string
conversationIdобязательно
stringformat: "uuid"
idempotencyKeyобязательно
string
duplicateобязательно
boolean
messageобязательно
object
Вложенная схема

object

idобязательно
string
sourceIdобязательно
string
providerTypeобязательно
string
deliveryStatusобязательно
string
JSON Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "sourceId": {
      "type": "string"
    },
    "providerType": {
      "type": "string"
    },
    "deliveryStatus": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "sourceId",
    "providerType",
    "deliveryStatus"
  ]
}
attemptобязательно
object
Вложенная схема

object

idобязательно
string
statusобязательно
string
JSON Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "status"
  ]
}
JSON Schema
{
  "type": "object",
  "properties": {
    "projectId": {
      "type": "string"
    },
    "conversationId": {
      "type": "string",
      "format": "uuid"
    },
    "idempotencyKey": {
      "type": "string"
    },
    "duplicate": {
      "type": "boolean"
    },
    "message": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "sourceId": {
          "type": "string"
        },
        "providerType": {
          "type": "string"
        },
        "deliveryStatus": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "sourceId",
        "providerType",
        "deliveryStatus"
      ]
    },
    "attempt": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "status"
      ]
    }
  },
  "required": [
    "projectId",
    "conversationId",
    "idempotencyKey",
    "duplicate",
    "message",
    "attempt"
  ],
  "$ref": "#/components/schemas/DeveloperMessagingSendResponse"
}
400 Invalid command or project
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
401 Invalid credential
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
403 Module unavailable
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
404 Conversation not found
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
409 Idempotency or provider conflict
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
429 Ingress rate limit exceeded
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ],
  "$ref": "#/components/schemas/ProblemDetails"
}
503 Provider outcome unknown
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}