Методы API
DEVELOPER PLATFORM · v1

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

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

Скачать OpenAPI

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

PATCH

Изменить задачу CRM

/api/v1/developer/crm/tasks/{taskId}

Изменяет детали или переводит задачу между open, in_progress и done одной идемпотентной командой.

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

Authorization: Bearer YOUR_PROJECT_TOKEN

Параметры

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

stringminLength: 1 · maxLength: 160

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

stringpattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{7,159}$"

JSON Schema
{
  "type": "string",
  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,159}$"
}

Тело запроса

application/json

union

Вариант 1

object

operationобязательно
stringenum: ["details"]
title
stringminLength: 1 · maxLength: 240
description
stringmaxLength: 4000
dueAt
string | nullformat: "date-time"
priority
stringenum: ["normal","high"]
assigneeIdentityId
stringminLength: 1 · maxLength: 160
JSON Schema
{
  "type": "object",
  "properties": {
    "operation": {
      "type": "string",
      "enum": [
        "details"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 240
    },
    "description": {
      "type": "string",
      "maxLength": 4000
    },
    "dueAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "priority": {
      "type": "string",
      "enum": [
        "normal",
        "high"
      ]
    },
    "assigneeIdentityId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    }
  },
  "required": [
    "operation"
  ],
  "additionalProperties": false
}
Вариант 2

object

operationобязательно
stringenum: ["status"]
statusобязательно
stringenum: ["open","in_progress","done"]
result
stringmaxLength: 4000
JSON Schema
{
  "type": "object",
  "properties": {
    "operation": {
      "type": "string",
      "enum": [
        "status"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "in_progress",
        "done"
      ]
    },
    "result": {
      "type": "string",
      "maxLength": 4000
    }
  },
  "required": [
    "operation",
    "status"
  ],
  "additionalProperties": false
}
JSON Schema
{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "operation": {
          "type": "string",
          "enum": [
            "details"
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 240
        },
        "description": {
          "type": "string",
          "maxLength": 4000
        },
        "dueAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "priority": {
          "type": "string",
          "enum": [
            "normal",
            "high"
          ]
        },
        "assigneeIdentityId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        }
      },
      "required": [
        "operation"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "operation": {
          "type": "string",
          "enum": [
            "status"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "in_progress",
            "done"
          ]
        },
        "result": {
          "type": "string",
          "maxLength": 4000
        }
      },
      "required": [
        "operation",
        "status"
      ],
      "additionalProperties": false
    }
  ],
  "$ref": "#/components/schemas/UpdateDeveloperCrmTaskRequest"
}

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

curl --request PATCH   'https://YOUR_NOVA_HOST/api/v1/developer/crm/tasks/TASK_ID'   --header 'Authorization: Bearer YOUR_PROJECT_TOKEN'   --header 'Idempotency-Key: YOUR_UNIQUE_COMMAND_ID'   --header 'Content-Type: application/json'   --data '{"operation":"details","dueAt":null,"priority":"high"}'

Ответы

200 Updated CRM task 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 task command 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"
  ]
}
404 CRM task reference 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"
  ]
}