Аутентификация
Передайте API-ключ в качестве маркера носителя (bearer token). Эта конечная точка не указывает конкретное разрешение в спецификации, поэтому предоставьте своему ключу минимум необходимых прав и проверьте ответ, вместо того чтобы делать предположения.
Идентификатор вашей организации
Этот эндпоинт принимает org_id в качестве поля в теле JSON.
Идентификатор вашей организации находится на экране ключей API в вашей панели управления, рядом с самим ключом. Это один и тот же идентификатор для каждого вашего запроса.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X POST https://api.zinndigital.com/v1/agency/time/schedules \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "trigger": <string<manual, on_log, day_of_month, threshold>> }'Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли
Подробнее
Idempotent by `(org, client)` — a second POST updates rather than creating a second row, because two schedules for one client is the arrangement that bills them twice. Four triggers: `manual` (on demand only), `on_log` (immediately, as time is logged), `day_of_month`, and `threshold` (when unbilled work reaches an amount). ⛔ `day_of_month` is 1–28, and that is not a limitation of the storage. A schedule set to the 31st would silently skip February, April, June, September and November — seven months a year in which the agency is not paid and nothing is red. "The end of the month" is expressed as 28.
Тело запроса
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
client_id | string | Нет | — |
trigger | string<manual, on_log, day_of_month, threshold> | Да | — |
day_of_month | integer | Нет | — |
threshold_minor | integer | Нет | — |
currency | string | Нет | — |
active | boolean | Нет | — |
org_id | string | Нет | — |
Ответ
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
id | string | Да | — |
client_id | string | Нет | `null` is the organisation-wide DEFAULT, covering every client without a row of its own. A per-client row replaces it rather than layering on it. |
trigger | string<manual, on_log, day_of_month, threshold> | Да | — |
day_of_month | integer | Нет | ⛔ 1–28. The 29th to the 31st do not exist in every month, so a schedule set to the 31st would silently skip five of them a year. |
threshold_minor | integer | Нет | — |
currency | string | Да | — |
active | boolean | Да | — |
next_run_at | string | Нет | — |
last_attempted_at | string | Нет | Stamped for every schedule the sweep REACHES, before its result is read — so a client whose invoice fails still leaves the front of the queue. |
last_succeeded_at | string | Нет | A SECOND column, deliberately: one column cannot serve as both the cursor the sweep advances and the signal a staleness alarm reads. |
last_error | string | Нет | — |
Ошибки, которые может возвращать этот эндпоинт
401 · 403 · 422