curl -X[HTTP METHOD] -H "Content-Type: application/json" -H "[token-info]:""https://api-[env-name].[groupname].domain.io/[client-group]/[service-group]/[version]/[endpoint]" -d '{ "head": [meta-parameters], "body": [content]}'
1.4 URL整体规划1.4.1 域名规范https://api-[env-name].[groupname].domain.io/[client-group]/[service-group]/[version]/[endpoint]1.4.2 域名规则开发环境:https://api-dev.payment.domain.io/测试环境:https://api-test.payment.domain.io/预演环境:https://api-staging.payment.domain.io/线上测试环境:https://api-onlinetest.payment.domain.io/生产环境:https://api.payment.domain.io/其中线上测试环境是上线过程中备用,比如线上一共3台生产环境服务器,将其中一台从生产环境切掉,更新程序并且将域名指向它,测试完之后再将生产环境流量切换过来。1.5 基本数据类型约定此约定是系统整体容错的一部分,但是无论接口使用者还是生产者,都不应该因为此容错而减少自己模块本来需要的容错工作。1.6 公共输入参数规范1.7 公共返回对象约定{ "responseCode": [responseCode], "responseInfo": { "userMessage": [userMessage], "internalMessage": [internalMessage], "guideline": [guideline link] }, "link": { "document":" https://[domain]/docs#zoos", "href":[uri-info], "title":[doc-title], "type":"application/[vnd.yourformat]+json" }, "responseData":[responseData]}
1.8 公共错误编码及说明1.9 公共数据字典2. 订单服务2.1 查询订单列表2.1.1 接口规范2.1.2 输入参数示范curl -XGET -H "Content-Type: application/json" -H "Access-Token:abcd1234" "https://api-dev.haitao.domain.io/mobile/data-platform/v1/orders/base-orders" -d '{ "head": [meta-parameters], "body": { "pageSize":10, "pageNo":1 }}'
2.1.3 返回参数示范{ "responseCode": [responseCode], "responseInfo": { "userMessage": [userMessage], "internalMessage": [internalMessage], "guideline": [guideline link] }, "link": { "document":" https://[domain]/docs#zoos", "href":[uri-info], "title":[doc-title], "type":"application/[vnd.yourformat]+json" }, "responseData": { "pageCount": 12, "pageNo": 2, "data": { } }}
(图片来源网络,侵删)
0 评论