身份验证
请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 agency.time.log 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
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 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 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