Методы API
DEVELOPER PLATFORM · v1

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

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

Скачать OpenAPI

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

GET

Агрегатная аналитика обращений CRM

/api/v1/developer/analytics/crm-tickets

Возвращает Analytics-owned агрегаты за 7, 30 или 90 дней с окном и свежестью проекции; без project, ticket, customer или staff identity и без причинных выводов.

Право доступаanalytics.tickets.read

Authorization: Bearer YOUR_PROJECT_TOKEN

Параметры

periodDaysнеобязательно · query

numberdefault: 30

JSON Schema
{
  "type": "number",
  "default": 30
}

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

curl --request GET   'https://YOUR_NOVA_HOST/api/v1/developer/analytics/crm-tickets?periodDays=30'   --header 'Authorization: Bearer YOUR_PROJECT_TOKEN'

Ответы

200 Aggregate CRM ticket analytics
application/json

object

periodDaysобязательно
union
Вложенная схема

union

Вариант 1

numberenum: [7]

JSON Schema
{
  "type": "number",
  "enum": [
    7
  ]
}
Вариант 2

numberenum: [30]

JSON Schema
{
  "type": "number",
  "enum": [
    30
  ]
}
Вариант 3

numberenum: [90]

JSON Schema
{
  "type": "number",
  "enum": [
    90
  ]
}
JSON Schema
{
  "anyOf": [
    {
      "type": "number",
      "enum": [
        7
      ]
    },
    {
      "type": "number",
      "enum": [
        30
      ]
    },
    {
      "type": "number",
      "enum": [
        90
      ]
    }
  ]
}
timeZoneобязательно
stringminLength: 1 · maxLength: 100
windowобязательно
object
Вложенная схема

object

fromобязательно
stringformat: "date-time"
toобязательно
stringformat: "date-time"
JSON Schema
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "format": "date-time"
    },
    "to": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "from",
    "to"
  ],
  "additionalProperties": false
}
generatedAtобязательно
stringformat: "date-time"
projectedThroughобязательно
string | nullformat: "date-time"
volumeобязательно
integerminimum: 0
resolvedобязательно
integerminimum: 0
averageResolutionMinutesобязательно
number | nullminimum: 0
slaобязательно
object
Вложенная схема

object

evaluatedобязательно
integerminimum: 0
breachedобязательно
integerminimum: 0
breachRateобязательно
number | nullminimum: 0 · maximum: 1
JSON Schema
{
  "type": "object",
  "properties": {
    "evaluated": {
      "type": "integer",
      "minimum": 0
    },
    "breached": {
      "type": "integer",
      "minimum": 0
    },
    "breachRate": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 1
    }
  },
  "required": [
    "evaluated",
    "breached",
    "breachRate"
  ],
  "additionalProperties": false
}
ratingобязательно
object
Вложенная схема

object

countобязательно
integerminimum: 0
averageобязательно
number | nullminimum: 1 · maximum: 5
JSON Schema
{
  "type": "object",
  "properties": {
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "average": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 1,
      "maximum": 5
    }
  },
  "required": [
    "count",
    "average"
  ],
  "additionalProperties": false
}
dailyобязательно
arraymaxItems: 90
Вложенная схема

arraymaxItems: 90

object

dateобязательно
stringformat: "date"
createdобязательно
integerminimum: 0
resolvedобязательно
integerminimum: 0
ratingsобязательно
integerminimum: 0
averageRatingобязательно
number | nullminimum: 1 · maximum: 5
JSON Schema
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date"
    },
    "created": {
      "type": "integer",
      "minimum": 0
    },
    "resolved": {
      "type": "integer",
      "minimum": 0
    },
    "ratings": {
      "type": "integer",
      "minimum": 0
    },
    "averageRating": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 1,
      "maximum": 5
    }
  },
  "required": [
    "date",
    "created",
    "resolved",
    "ratings",
    "averageRating"
  ],
  "additionalProperties": false
}
JSON Schema
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "date": {
        "type": "string",
        "format": "date"
      },
      "created": {
        "type": "integer",
        "minimum": 0
      },
      "resolved": {
        "type": "integer",
        "minimum": 0
      },
      "ratings": {
        "type": "integer",
        "minimum": 0
      },
      "averageRating": {
        "type": [
          "number",
          "null"
        ],
        "minimum": 1,
        "maximum": 5
      }
    },
    "required": [
      "date",
      "created",
      "resolved",
      "ratings",
      "averageRating"
    ],
    "additionalProperties": false
  },
  "maxItems": 90
}
JSON Schema
{
  "type": "object",
  "properties": {
    "periodDays": {
      "anyOf": [
        {
          "type": "number",
          "enum": [
            7
          ]
        },
        {
          "type": "number",
          "enum": [
            30
          ]
        },
        {
          "type": "number",
          "enum": [
            90
          ]
        }
      ]
    },
    "timeZone": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "window": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "format": "date-time"
        },
        "to": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "from",
        "to"
      ],
      "additionalProperties": false
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "projectedThrough": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "volume": {
      "type": "integer",
      "minimum": 0
    },
    "resolved": {
      "type": "integer",
      "minimum": 0
    },
    "averageResolutionMinutes": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "sla": {
      "type": "object",
      "properties": {
        "evaluated": {
          "type": "integer",
          "minimum": 0
        },
        "breached": {
          "type": "integer",
          "minimum": 0
        },
        "breachRate": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1
        }
      },
      "required": [
        "evaluated",
        "breached",
        "breachRate"
      ],
      "additionalProperties": false
    },
    "rating": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "average": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 1,
          "maximum": 5
        }
      },
      "required": [
        "count",
        "average"
      ],
      "additionalProperties": false
    },
    "daily": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "created": {
            "type": "integer",
            "minimum": 0
          },
          "resolved": {
            "type": "integer",
            "minimum": 0
          },
          "ratings": {
            "type": "integer",
            "minimum": 0
          },
          "averageRating": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 1,
            "maximum": 5
          }
        },
        "required": [
          "date",
          "created",
          "resolved",
          "ratings",
          "averageRating"
        ],
        "additionalProperties": false
      },
      "maxItems": 90
    }
  },
  "required": [
    "periodDays",
    "timeZone",
    "window",
    "generatedAt",
    "projectedThrough",
    "volume",
    "resolved",
    "averageResolutionMinutes",
    "sla",
    "rating",
    "daily"
  ],
  "additionalProperties": false,
  "$ref": "#/components/schemas/DeveloperTicketAnalyticsResponse"
}
400 Invalid analytics period
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 Ticket analytics 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"
  ]
}
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"
  ]
}