> For the complete documentation index, see [llms.txt](https://docs.geopard.tech/geopard-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.geopard.tech/geopard-tutorials/ukrainian/dokumentaciya-api/geopard-api-requests-overview/83.-query-collect-platform-context.md).

# 83. Запит: Зібрати контекст платформи

Для великої кількості (сотень або тисяч) оброблених наборів даних (як-от «SatelliteImage», «AsAppliedDataset», «YieldDataset», «SoilDataset» тощо) завжди потрібно знати стан обробки кожного набору даних і збирати зведення про обробку. Ці відомості надає запит `getPlatformContext` query.

Типові випадки використання:

* Відстеження перебігу обробки
* Збір зведення та статистики обробки
* Спостереження за помилками та попередженнями під час обробки для подальшого детального дослідження наборів даних, яких вони стосуються

{% code overflow="wrap" lineNumbers="true" %}

```graphql
query CollectPlatformContext {
 getPlatformContext(input: {
   userUuids: ["<placeholder_of_user_uuid>"],
   statuses: [Start, Done, Warning, Error, Ignored],
   dateFrom: "2023-05-25T12:49:00.000Z", 
   dateTo: "2023-05-30T06:35:00.000Z", 
 }) {
   events {
     fieldUuid
     subFieldUuid
     subFieldType
     operationId
     status 
     executionDate
     messageKey
     optional
   }
 }
}
```

{% endcode %}

Підтримувані вхідні фільтри:

* `dateFrom` як дата й час у форматі ISO 8601 (наприклад: `"2023-05-25T12:49:00.000Z"`)
* `dateTo` як дата й час у форматі ISO 8601 (наприклад: `"2023-05-30T06:35:00.000Z"`)
* `operationIds` як масив ідентифікаторів операцій (`Strings`)
* `statuses` як масив значень із `ContextEventStatus` переліку з усіма станами обробки, зокрема проміжними; рекомендовано використовувати ключові значення `[Start, Done, Warning, Error, Ignored]`
* `subFieldTypes` як масив значень із переліку `TreeNodeEntity` з усіма типами сутностей GeoPard
* `subFieldUuids` як масив UUID, пов’язаних із вибраними сутностями в `subFieldTypes`
* `userUuids` як масив UUID користувачів, за якими потрібно виконати пошук

{% hint style="info" %}
Потрібно ініціалізувати принаймні один із таких фільтрів: `userUuids`, `fieldUuids`, `subFieldUuids`, або `operationIds`.
{% endhint %}

{% hint style="info" %}
Якщо `dateFrom` і `dateTo` не вказано, тривалість запиту за замовчуванням становить 12 годин. Максимальний рекомендований період отримання даних — 24 години.
{% endhint %}

{% hint style="info" %}
Існує обмеження: не більше 10 000 рядків у результаті.
{% endhint %}

{% hint style="info" %}
Щоб переглянути всі доступні актуальні значення перелічень (наприклад: `TreeNodeEntity`, `ContextEventStatus, ContextMessageKey`), рекомендується використовувати [Altair](https://docs.geopard.tech/geopard-tutorials/ukrainian/dokumentaciya-api/getting-started-with-the-geopard-api.md).
{% endhint %}

Об’єкт результату містить такі атрибути:

* `fieldUuid` позначає UUID пов’язаного поля
* `subFieldUuid` позначає UUID пов’язаного обробленого набору даних (наприклад, «SatelliteImage», «AsAppliedDataset», «YieldDataset», «SoilDataset» тощо)
* `subFieldType` як перелічення, пов’язане з `TreeNodeEntity`
* `operationId` як рядок, що містить ідентифікатор операції. Він залишається незмінним у всіх пов’язаних ланцюжках обробки. Рекомендується групувати дані за цим ідентифікатором, щоб відстежити всі етапи обробки
* `status` як перелічення, пов’язане з `ContextEventStatus`
* `executionDate` як рядок у форматі ISO 8601, що вказує момент виконання
* `messageKey` як перелічення, пов’язане з `ContextMessageKey` яке описує результат виконання
* `optional` як рядок із технічним описом (за наявності), який переважно використовується для налагодження та повідомлення про помилки


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.geopard.tech/geopard-tutorials/ukrainian/dokumentaciya-api/geopard-api-requests-overview/83.-query-collect-platform-context.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
