Аутентификация
Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение agency.time.log; ключ без него отклоняется с кодом 403, а не 404.
Этот эндпоинт не принимает идентификатор организации. Ваш ключ уже определяет организацию, к которой он принадлежит, и ответ ограничивается ее рамками.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X POST https://api.zinndigital.com/v1/agency/time/entries \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "project_id": <string>, "work_date": <string>, "minutes": <integer> }'Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли
Подробнее
`minutes` is an integer, 1..1440. Requires `agency.time.log` for your own time, or `agency.time.manage` to pass `user_id` and log on somebody else's behalf. If this client's billing schedule is *"invoice straight away"*, logging arms it and starts the billing workflow immediately — the invoice is raised in seconds rather than at the next sweep, without the invoicing call ever sitting in this request.
Тело запроса
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
project_id | string | Да | — |
task_id | string | Нет | — |
work_date | string | Да | — |
minutes | integer | Да | — |
description | string | Нет | — |
billable | boolean | Нет | — |
user_id | string | Нет | Log on somebody else's behalf. Requires `agency.time.manage`; without it a caller may only log their own time. |
Ответ
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
id | string | Да | — |
user_id | string | Нет | — |
project_id | string | Да | — |
project_name | string | Нет | — |
task_id | string | Нет | — |
task_name | string | Нет | — |
client_id | string | Нет | — |
work_date | string | Да | — |
minutes | integer | Да | ⛔ An INTEGER of minutes. There is no `hours` field on this API: an hours-as-float duration re-enters the money through the rate and no rounding point can recover it. |
duration_label | string | Да | Presentational only — never multiplied by anything. |
description | string | Нет | — |
billable | boolean | Да | — |
billing_run_id | string | Нет | The run that invoiced this entry. `null` means it is still outstanding. |
billed_rate_minor_per_hour | integer | Нет | — |
billed_amount_minor | integer | Нет | What was actually charged, frozen at billing time so the document can be re-derived years later even if every rate card has since changed. |
billed_currency | string | Нет | — |
billed_under_fixed_price | boolean | Нет | TRUE when these minutes were rolled into a task's FIXED price rather than charged by the hour. `billed_amount_minor` is then 0 and that zero is correct — read this flag, not the… |
rate_minor_per_hour | integer | Нет | The rate that WOULD apply, resolved against this entry's own `work_date`, for an entry not yet billed. ⛔ `null` means **unpriced**, not free: work with no rate card is never inv… |
rate_scope | string<task, project, client, org> | Нет | Which rate card won, so a surprising invoice can be explained. |
rate_kind | string<hourly, fixed> | Нет | — |
created_at | string | Да | — |
Ошибки, которые может возвращать этот эндпоинт
401 · 403 · 422