Loading...
Loading...
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 skill4agent add xiaowen-0725/openydt-cli openydt-api-explorerCRITICAL: 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
openydt <domain> <command>openydt api <cmd> --body '{...}'apiPOSTcityOperationCouponthirdParkForBolianupwardasynSuccesscommunitygetAuthCommunitiesadpreferentialscoreinvoiceydtUserincluded=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
# 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 -<cmd>cmdgetParkFeecreateCityOperationCouponTemplatedir--body--body-file{}"2019-04-16 00:11:25"status=2 / resultCode=909 Request parameter errorstatus=7 Request parameter incomplete--dry-runopenydt api createCityOperationCouponTemplate --dry-run \
--body '{"parkCodeList":["PRJ9YJ19"],"couponTemplate":{"name":"1-yuan Discount Coupon","faceValue":1}}'api--yes--yesapiapi--yesreadwritereadwrite# 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"}}'../../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--yesdirection=webhookreportParkinglotChangeopenydt api <webhook-cmd>sampleBodyupwardasynSuccessjq '.interfaces[]|select(.cmd=="<cmd>")|.direction'webhookapicallableapijq -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