События провайдеров.
Типы событий провайдеров и подписки Context4: создание подписок и управление ими через публичный API.
Сгенерировано из публичного OpenAPI Context4. Авторизация: Authorization: Bearer с API-ключом. Общие правила — API. Полный контракт — OpenAPI JSON. В JSON ниже $ref указывает на именованную схему из раздела «Схемы».
listProviderEventTypes
GET /v1/provider-event-types
URL этого стенда: https://context4.me/v1/provider-event-types. Параметры в фигурных скобках заменяются фактическими ID из API.
List supported provider notification types and fields
Полномочие: events:read.
Дополнительных параметров в контракте нет.
Ответы и ошибки
| HTTP | Значение | Формат и схема |
|---|---|---|
| 200 | Provider event catalog | application/json {"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"connector_id":{"type":"string"},"entity":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"field_types":{"type":"object","additionalProperties":{"type":"string","enum":["string","number","boolean"]}},"hydration_available":{"type":"boolean"}},"required":["connector_id","entity","event_types","fields","field_types","hydration_available"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false} |
| 400 | Problem (validation_failed) | application/problem+json Problem |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | application/problem+json Problem |
| 403 | Problem (capability_missing) | application/problem+json Problem |
| 429 | Problem (rate_limited) | application/problem+json Problem |
| 500 | Problem (internal) | application/problem+json Problem |
| 503 | Problem (service_unavailable) | application/problem+json Problem |
Заголовки успешного ответа:
{
"X-Request-Id": {
"description": "Correlation id echoed on every response",
"schema": {
"type": "string"
}
},
"RateLimit-Limit": {
"description": "Per-key request limit for the current window",
"schema": {
"type": "integer"
}
},
"RateLimit-Remaining": {
"description": "Requests remaining in the current window",
"schema": {
"type": "integer"
}
},
"RateLimit-Reset": {
"description": "Seconds until the current window resets",
"schema": {
"type": "integer"
}
}
}subscribeProviderEvents
POST /v1/provider-event-subscriptions
URL этого стенда: https://context4.me/v1/provider-event-subscriptions. Параметры в фигурных скобках заменяются фактическими ID из API.
Subscribe to provider events without entity storage
Полномочие: events:write.
Дополнительных параметров в контракте нет.
Тело запроса
Обязательно.
{
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"format": "uuid",
"example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
},
"event_types": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"minItems": 1,
"maxItems": 32
}
},
"required": [
"connection_id",
"event_types"
],
"additionalProperties": false
}
}
}
}Ответы и ошибки
| HTTP | Значение | Формат и схема |
|---|---|---|
| 200 | Configured event subscription | application/json {"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connection_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"source_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connector_id":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0},"enabled_at":{"type":"string","format":"date-time"},"payload_retention_seconds":{"type":"integer","exclusiveMinimum":0}},"required":["id","connection_id","source_id","connector_id","event_types","status","version","enabled_at","payload_retention_seconds"],"additionalProperties":false} |
| 400 | Problem (validation_failed) | application/problem+json Problem |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | application/problem+json Problem |
| 403 | Problem (capability_missing) | application/problem+json Problem |
| 404 | Problem (not_found) | application/problem+json Problem |
| 409 | Problem (conflict) | application/problem+json Problem |
| 429 | Problem (rate_limited) | application/problem+json Problem |
| 500 | Problem (internal) | application/problem+json Problem |
| 503 | Problem (service_unavailable) | application/problem+json Problem |
Заголовки успешного ответа:
{
"X-Request-Id": {
"description": "Correlation id echoed on every response",
"schema": {
"type": "string"
}
},
"RateLimit-Limit": {
"description": "Per-key request limit for the current window",
"schema": {
"type": "integer"
}
},
"RateLimit-Remaining": {
"description": "Requests remaining in the current window",
"schema": {
"type": "integer"
}
},
"RateLimit-Reset": {
"description": "Seconds until the current window resets",
"schema": {
"type": "integer"
}
}
}getProviderEventSubscription
GET /v1/provider-event-subscriptions
URL этого стенда: https://context4.me/v1/provider-event-subscriptions. Параметры в фигурных скобках заменяются фактическими ID из API.
Read the connection event subscription
Полномочие: events:read.
Параметры
| Имя | Где | Обязателен | Тип и ограничения |
|---|---|---|---|
connection_id | query | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} |
Ответы и ошибки
| HTTP | Значение | Формат и схема |
|---|---|---|
| 200 | Subscription or null | application/json {"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connection_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"source_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connector_id":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0},"enabled_at":{"type":"string","format":"date-time"},"payload_retention_seconds":{"type":"integer","exclusiveMinimum":0}},"required":["id","connection_id","source_id","connector_id","event_types","status","version","enabled_at","payload_retention_seconds"],"additionalProperties":false} |
| 400 | Problem (validation_failed) | application/problem+json Problem |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | application/problem+json Problem |
| 403 | Problem (capability_missing) | application/problem+json Problem |
| 404 | Problem (not_found) | application/problem+json Problem |
| 429 | Problem (rate_limited) | application/problem+json Problem |
| 500 | Problem (internal) | application/problem+json Problem |
| 503 | Problem (service_unavailable) | application/problem+json Problem |
Заголовки успешного ответа:
{
"X-Request-Id": {
"description": "Correlation id echoed on every response",
"schema": {
"type": "string"
}
},
"RateLimit-Limit": {
"description": "Per-key request limit for the current window",
"schema": {
"type": "integer"
}
},
"RateLimit-Remaining": {
"description": "Requests remaining in the current window",
"schema": {
"type": "integer"
}
},
"RateLimit-Reset": {
"description": "Seconds until the current window resets",
"schema": {
"type": "integer"
}
}
}disableProviderEventSubscription
DELETE /v1/provider-event-subscriptions/{subscriptionId}
URL этого стенда: https://context4.me/v1/provider-event-subscriptions/{subscriptionId}. Параметры в фигурных скобках заменяются фактическими ID из API.
Disable a provider event subscription
Полномочие: events:write.
Параметры
| Имя | Где | Обязателен | Тип и ограничения |
|---|---|---|---|
subscriptionId | path | да | {"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"} |
Ответы и ошибки
| HTTP | Значение | Формат и схема |
|---|---|---|
| 200 | Disabled subscription | application/json {"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connection_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"source_id":{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"},"connector_id":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"version":{"type":"integer","exclusiveMinimum":0},"enabled_at":{"type":"string","format":"date-time"},"payload_retention_seconds":{"type":"integer","exclusiveMinimum":0}},"required":["id","connection_id","source_id","connector_id","event_types","status","version","enabled_at","payload_retention_seconds"],"additionalProperties":false} |
| 400 | Problem (validation_failed) | application/problem+json Problem |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | application/problem+json Problem |
| 403 | Problem (capability_missing) | application/problem+json Problem |
| 404 | Problem (not_found) | application/problem+json Problem |
| 409 | Problem (conflict) | application/problem+json Problem |
| 429 | Problem (rate_limited) | application/problem+json Problem |
| 500 | Problem (internal) | application/problem+json Problem |
| 503 | Problem (service_unavailable) | application/problem+json Problem |
Заголовки успешного ответа:
{
"X-Request-Id": {
"description": "Correlation id echoed on every response",
"schema": {
"type": "string"
}
},
"RateLimit-Limit": {
"description": "Per-key request limit for the current window",
"schema": {
"type": "integer"
}
},
"RateLimit-Remaining": {
"description": "Requests remaining in the current window",
"schema": {
"type": "integer"
}
},
"RateLimit-Reset": {
"description": "Seconds until the current window resets",
"schema": {
"type": "integer"
}
}
}