账号同步接口 最后更新时间: 2024年05月14日
账号同步
请求地址:
url 请求参数
body请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String url = "https://restwia.amap.com/api/v1/wia/account/sync";
Map<String, Object> params = new HashMap<>();
String bizToken = "在高德开放平台申请的bizToken";
params.put("key", "在高德开放平台申请的key");
params.put("openId", "当前操作用户的openId");
params.put("bizToken", bizToken);
String[] signArgs = new String[]{bizToken};
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret", signArgs));
// 示例:"{\"mobile\": \"1835867****\",\"workMapId\" : \"o2Z0BP-IMStITnTy3_qESg\",\"createSecondSource\": \"40000***\"}"
String jsonBodyStr = "body参数";
url = MyHttpUtils.attachParamsToUrl(url, params);
String response = MyHttpUtils.postApplicationJson(url, jsonBodyStr);
System.out.println(response);
}
返回参数
响应结果的格式为 JSON 形式,以下是参数说明
返回示例
{
"data": {
"driverOpenId":"123123123",
"masterOpenId":"31231",
"orgId":"31231",
"workMapId":"31231",
},
"code": 1,
"message": "Successful",
"result": true,
"version": "1.0",
"timestamp": 1701142286019,
"requestId": "1eb5d12017011422856761177d14ca"
}