Bỏ qua để đến nội dung

Tác vụ

~2 phút đọc

Tác vụ bất đồng bộ (nhập, xuất, đồng bộ): theo dõi tiến độ và kết quả.

MethodPathTóm tắtQuyềnNhóm tốc độTương tác
GET/v1/jobs/{id}Trạng thái tác vụ bất đồng bộMọi khoá hợp lệreadScalar

Trạng thái tác vụ bất đồng bộ

Theo dõi nhập sao kê, xuất, đồng bộ… Khi state là queued hoặc running phản hồi có Retry-After (giây) cho lần hỏi kế. Tác vụ của người khác hoặc ngoài phạm vi trả 404 resource_not_found.

Quyền: Mọi khoá hợp lệ
  • Nhóm tốc độ: read
  • Phản hồi thành công 200: Tác vụ. — Job, application/json
  • Mã lỗi riêng của endpoint: resource_not_found
TênVị tríBắt buộcKiểuMô tả
idpathCóJobIdMã tác vụ bất đồng bộ (job_…).
curl -sS -X GET "https://api.dongtien.pro/v1/jobs/$ID" \
-H "Authorization: Bearer $DT_API_KEY"

Mở trong tài liệu tương tác

TrườngKiểuBắt buộcMô tả
created_atTimestampCó—
errorJobErrorKhông—
error.codeErrorCodeCóGiá trị: unauthenticated, invalid_api_key, api_key_expired, api_key_revoked, ip_not_allowed, permission_denied, scope_not_allowed, step_up_required, two_factor_required, hoadon_key_insufficient_scope, approver_same_as_maker, resource_not_found, account_scope_denied, impersonation_forbidden, staff_mfa_required, flag_approval_required, tenant_suspended, bad_request, invalid_json, validation_failed, invalid_cursor, unsupported_version, method_not_allowed, payload_too_large, unsupported_media_type, conflict, raw_expired, too_many_accounts, idempotency_key_required, idempotency_key_reused, idempotency_in_flight, rate_limited, quota_exceeded, spend_cap_reached, tx_not_verified, period_locked, balance_mismatch, memo_pattern_invalid, memo_pattern_in_use, account_alias_ambiguous, allocation_exceeds_tx, invoice_over_allocated, no_eligible_checker, retryable, upgrade_required, service_unavailable, hoadon_unavailable, internal_error, ai_not_enabled, ai_paused, ai_task_unassigned, key_required, forecast_unavailable.
error.detailstringKhông—
finished_atTimestamp | nullCó—
idJobIdCó—
kindJobKindCó—
objectstringCóGiá trị: job.
progressJobProgressCó—
progress.doneintegerCó—
progress.messagestringKhông—
progress.totalinteger | nullCónull khi chưa biết tổng.
progress.unitstringKhôngĐơn vị đếm, vd. rows, transactions.
resultmap<string, any>KhôngKết quả khi succeeded (cấu trúc tuỳ kind).
stateJobStateCóGiá trị: queued, running, succeeded, failed, cancelled.