Quickstart
-
Get a service credential
The ZGI platform team issues credentials. A credential starts with
zsk_and is shown once. Keep it in your server-side secret store, never in source control or a browser.终端窗口 export ZGI_SERVICES_TOKEN='zsk_...' -
List the capabilities you can use
终端窗口 curl -sS https://services.zgi.im/v1/services \-H "Authorization: Bearer $ZGI_SERVICES_TOKEN"capabilitiescontains only those your credential is scoped for and that have an available provider. Each lists itsprovidersand theirlimits. -
Make a first call
Classify the days of China’s 2026 National Day holiday. You generate
invocation_id; use a new value for each business call.终端窗口 curl -sS https://services.zgi.im/v1/public-holiday-queries \-H "Authorization: Bearer $ZGI_SERVICES_TOKEN" \-H 'Content-Type: application/json' \-d '{"invocation_id":"order-10086-1","provider":"holiday-cn","region":"CN","start_date":"2026-10-01","end_date":"2026-10-08"}'The response has two parts:
executionrecords this execution (outcome and usage) andresultholds the answer.{"code": 0,"message": "success","data": {"execution": {"id": "exe_01a12e52b912717faddb9b0372c2d034","invocation_id": "order-10086-1","outcome": "succeeded","usage": { "provider_requests": 0, "units": [{ "name": "days", "value": 8, "source": "measured" }] }},"result": {"region": "CN","days": [{ "date": "2026-10-01", "day_type": "public_holiday", "is_off_day": true, "holiday_name": "国庆节" }],"totals": { "workdays": 1, "off_days": 7 }}}} -
Call again with the same id
Repeating an
invocation_idreturns409 EXECUTION.DUPLICATE_INVOCATIONwith the originalexecution, and the provider is not called again. A network retry can never be charged twice. -
Find it in the call log
终端窗口 curl -sS "https://services.zgi.im/v1/executions?invocation_id=order-10086-1" \-H "Authorization: Bearer $ZGI_SERVICES_TOKEN"