Методы API
DEVELOPER PLATFORM · v1

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

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

Скачать OpenAPI

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

POST

Изменить статус обращения CRM

/api/v1/developer/crm/tickets/{ticketId}/status

Идемпотентно запрашивает переход в open, pending, resolved или closed; CRM проверяет lifecycle и самостоятельно фиксирует временные отметки.

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

Authorization: Bearer YOUR_PROJECT_TOKEN

Параметры

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

stringminLength: 1 · maxLength: 160

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

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

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

Тело запроса

application/json

object

statusобязательно
stringenum: ["open","pending","resolved","closed"]
JSON Schema
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "open",
        "pending",
        "resolved",
        "closed"
      ]
    }
  },
  "required": [
    "status"
  ],
  "additionalProperties": false,
  "$ref": "#/components/schemas/TransitionDeveloperCrmTicketRequest"
}

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

curl --request POST   'https://YOUR_NOVA_HOST/api/v1/developer/crm/tickets/TICKET_ID/status'   --header 'Authorization: Bearer YOUR_PROJECT_TOKEN'   --header 'Idempotency-Key: YOUR_UNIQUE_COMMAND_ID'   --header 'Content-Type: application/json'   --data '{"status":"resolved"}'

Ответы

200 Transitioned CRM ticket receipt
application/json

object

resourceIdобязательно
stringminLength: 1 · maxLength: 160
changedобязательно
boolean
JSON Schema
{
  "type": "object",
  "properties": {
    "resourceId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "changed": {
      "type": "boolean"
    }
  },
  "required": [
    "resourceId",
    "changed"
  ],
  "$ref": "#/components/schemas/DeveloperMutationResponse"
}
400 Invalid ticket status transition or idempotency key
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 developer 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 CRM tickets entitlement or membership 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 CRM ticket 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 key 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 Developer API 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"
  ]
}
503 Developer API rate limiter 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"
  ]
}