openydt-api-explorer
When an interface does not have an exclusive command, use the openydt api universal call / explore available cmds. Covers domains not made into first-class commands (city operation coupons/third-party parking lot access/upward receipts/community access control/advertising/point redemption/invoices/ydtUser, etc.), calls any callable interface using cmd + raw JSON body, checks cmds and parameters from catalog.json, and distinguishes between callable interfaces that can be invoked and webhooks (platform push) that cannot be actively invoked. Triggered when the user wants to call an interface that cannot be found in the domain skill's exclusive subcommands, or asks 'how to call this cmd / is there this interface / will the platform callback me'.
NPX Install
npx skill4agent add xiaowen-0725/openydt-cli openydt-api-explorerTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →CRITICAL: MUST use the Read tool to readbefore starting (authentication / profile / signature / status codes / rate limiting / security rules). The../openydt-shared/SKILL.mdfollows exactly the same signature, envelope, exit code and rate limiting logic as first-class commands. Do not execute any commands without reading the shared base.openydt api
When to use this skill
openydt <domain> <command>openydt api <cmd> --body '{...}'apiPOST- City Operation Coupons (create/issue city operation coupon templates)
cityOperationCoupon - Third-party Parking Lot Payment Access Receipts
thirdParkForBolian - Upward Data Reporting Receipts (e.g.,
upward)asynSuccess - Community Access Control (e.g.,
community)getAuthCommunities - Advertising Statistics,
ad/preferentialPoint Redemption,scoreInvoices,invoiceUser Authentication, etc.ydtUser
included=falsecatalog.jsonapidirection=callablePriority order: First look for first-class commands (or corresponding domain skills), useopenydt <domain> --helpas fallback if not found. First-class commands split parameters into flags, automatically determine read/write status, and are less error-prone;apiis "raw JSON direct send", more general but requires you to ensure the body is correct.api
Usage: openydt api
# 1) Inline JSON body (most commonly used)
openydt api getParkFee --body '{"parkCode":"1ZS7H5PQH9","carCode":"粤EJW962"}'
# 2) Omit body for parameterless interfaces
openydt api getAuthParkCodes
# 3) Read body from file
openydt api getParkOnSiteCar --body-file ./body.json
# 4) Read body from stdin (- indicates stdin), suitable for pipelines / large bodies
echo '{"parkCode":"PTD2YBBZ"}' | openydt api getParkOnSiteCar --body-file -- : Business code, exactly the
<cmd>field in the catalog (e.g.,cmd,getParkFee). Note it's the cmd, not thecreateCityOperationCouponTemplatepath.dir - and
--bodyare mutually exclusive; if neither is provided, an empty body (--body-file) is sent, only suitable for parameterless interfaces.{} - Body is raw JSON: The CLI will first compact the JSON before using it for signature and sending (consistent with first-class commands), spaces inside strings like will be preserved.
"2019-04-16 00:11:25" - Parameter naming and nested structure follow the interface definition exactly (see checking parameters from catalog below); incorrect field names usually return or
status=2 / resultCode=909 Request parameter error.status=7 Request parameter incomplete
--dry-run Preview
--dry-runopenydt api createCityOperationCouponTemplate --dry-run \
--body '{"parkCodeList":["PRJ9YJ19"],"couponTemplate":{"name":"1-yuan Discount Coupon","faceValue":1}}'Write operations require --yes (Important: api does not automatically determine read/write)
api- For any cmd that changes the platform state (create/update/delete, issue coupons, pay fees, open gates, report receipts, etc.), you must explicitly add , otherwise it will be blocked by security and not executed.
--yes - First-class commands automatically identify write operations and require ;
--yeswill not do this for you, so when usingapito call write interfaces, be sure to confirm readwrite status yourself and addapi.--yes - To determine if a cmd is read or write: Check the field (
readwrite/read) in the catalog, see below.write
# Write operation (catalog readwrite=write), must add --yes
openydt api createCityOperationCouponTemplate --yes \
--body '{"parkCodeList":["PRJ9YJ19"],"couponTemplate":{"name":"1-yuan Discount Coupon","totalNum":2,"couponType":1,"faceValue":1,"validFrom":"2019-04-28 00:00:00","validTo":"2020-04-28 00:00:00"}}'Check available cmds and parameters from catalog
../../catalog/catalog.json/Users/zhoujw/develop/tmp/openydt-cli/catalog/catalog.json{generatedFrom, count, interfaces:[...]}| Field | Meaning |
|---|---|
| Business code, directly used as the cmd in |
| Belonging domain / document path (for classification only, not an input parameter for api) |
| |
| |
| Whether it has been made into a first-class command; |
| Reason for not being made into a first-class command ( |
| Parameter definition array: |
| Official sample request body——the best starting point for constructing |
| Sample response, helps you predict returned fields |
jqpython3# View complete definition by cmd (params + sampleBody)
jq '.interfaces[] | select(.cmd=="createCityOperationCouponTemplate")' catalog/catalog.json
# List all callable cmds and their read/write status in a specific unnamed domain
jq -r '.interfaces[] | select(.domain=="cityOperationCoupon" and .direction=="callable") | "\(.cmd)\t\(.readwrite)\t\(.explain)"' catalog/catalog.json
# Full list of interfaces that are not made into first-class commands but callable (included=false and callable)
jq -r '.interfaces[] | select(.included==false and .direction=="callable") | "\(.domain)\t\(.cmd)\t\(.readwrite)"' catalog/catalog.json
# View only the parameter list of a specific cmd (including nested groups)
jq '.interfaces[] | select(.cmd=="createCityOperationCouponTemplate") | .params' catalog/catalog.jsonapiincluded=falsedirectionreadwrite--yesjqsampleBodyparams--dry-run--yesUncallable webhooks (platform active push)
direction=webhookreportParkinglotChange- CLI cannot actively call these cmds——they do not have an entry for "your side requests the platform", and is not the correct usage (the platform does not provide an endpoint for this direction).
openydt api <webhook-cmd> - To receive such pushes, you need to build your own HTTP receiver (webhook receiver), register the callback address with the platform, and the platform will POST data in the form of to you when an event occurs; your service is responsible for verifying the signature, processing it, and returning as agreed (many upward receipts correspond to a callable confirmation cmd in the
sampleBodydomain, such asupward).asynSuccess - Distinction method: Before calling, run ; if it is
jq '.interfaces[]|select(.cmd=="<cmd>")|.direction', do not usewebhookto call it, instead build a receiving end; if it isapi, usecallable.api
Examples
jq -r '.interfaces[] | select(.domain=="thirdParkForBolian" and .direction=="callable") | "\(.cmd)\t\(.readwrite)"' catalog/catalog.json--yes# 1) Get sample body
jq -r '.interfaces[]|select(.cmd=="createCityOperationCouponTemplate")|.sampleBody' catalog/catalog.json
# 2) Preview signed request to confirm correctness
openydt api createCityOperationCouponTemplate --dry-run --body-file ./body.json
# 3) Official sending (write operation, must add --yes)
openydt api createCityOperationCouponTemplate --yes --body-file ./body.jsonecho '{}' | openydt api getAuthCommunities --body-file - # community domain, readwrite=read