地图成员管理 最后更新时间: 2024年08月30日
1. 添加地图成员
请求地址
特别注意:暂无。
请求参数
示例代码(以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/core/member/add";
Map<String, Object> params = new HashMap<>();
params.put("key","在高德开放平台申请的key");
params.put("bizToken","在高德开放平台申请的bizToken");
params.put("openId","当前操作用户的openId");
params.put("workMapId", "工作地图id");
String[] signArgs = new String[]{"工作地图id"};
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret", signArgs));
String response = MyHttpUtils.postFormUrlencoded(url, params);
}
返回参数
附表
2. 移除地图成员
请求地址
特别注意:暂无。
请求参数
示例代码(以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/core/member/delete";
Map<String, Object> params = new HashMap<>();
params.put("key","在高德开放平台申请的key");
params.put("bizToken","在高德开放平台申请的bizToken");
params.put("openId","当前操作用户的openId");
params.put("workMapId", "要移除的工作地图id");
String[] signArgs = new String[]{"要移除的工作地图id"};
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret", signArgs));
String response = MyHttpUtils.postFormUrlencoded(url, params);
}
返回参数
附表
3.翻页查询某个地图下的成员列表
请求地址
请求参数
示例代码(以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/core/member/list";
Map<String, Object> params = new HashMap<>();
String openId = "当前操作用户的openId";
String workMapId = "工作地图id";
params.put("key","在高德开放平台申请的key");
params.put("openId",openId);
params.put("bizToken","在高德开放平台申请的bizToken");
params.put("workMapId", workMapId);
params.put("pageSize", 20);
String[] signArgs = new String[]{workMapId };
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret",signArgs));
url = MyHttpUtils.attachParamsToUrl(url, params);
String response = MyHttpUtils.get(url);
System.out.println(response);
}
返回参数
附表
4.批量查询某个地图下的成员列表
请求地址
请求参数
请求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/core/member/query";
Map<String, Object> params = new HashMap<>();
String openId = "当前操作用户的openId";
String workMapId = "工作地图id";
params.put("key","在高德开放平台申请的key");
params.put("openId",openId);
params.put("bizToken","在高德开放平台申请的bizToken");
params.put("workMapId", workMapId);
String[] signArgs = new String[]{workMapId };
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret",signArgs));
url = MyHttpUtils.attachParamsToUrl(url, params);
String json = "{\"openIds\":[\"kjvznC8HuNALsgotrjKd0lMfMq4dzik7KN3Wc\",\"LJBvKJ7E-YA757hJhxFad0lMfMqw4dzik7NM3Wc\"]}";
String response = MyHttpUtils.postApplicationJson(url, json);
System.out.println(response);
}
返回参数
响应结果的格式为 JSON 形式,以下是参数说明
返回示例
{
"data": {
"dataList": [
{
"openId": "SIiu5IvFoztHdSrcuNc_2ad0lMfMqwK4dzik7KNM3Wc",
"nickName": "陆小果",
"icon": "http://img-cdn-test.amap.com/pp/avatar/b2f/3a/e3/70300371.jpeg?ver=1698826935&imgoss=1",
"groupState": 1,
"gmtCreate": 1709105635000,
"gmtModified": 1709105635000,
"role": 3
},
{
"openId": "-5sDuwCzUMnRAVhWbz4A1Kd0lMfMqwK4dzik7KNM3Wc",
"nickName": "在摩托车旁的西湖",
"icon": "http://img-cdn-test.amap.com/g/avatar/15.png?ver=1698391018&imgoss=1",
"groupState": 1,
"gmtCreate": 1714371019000,
"gmtModified": 1714371019000,
"role": 1
}
]
},
"code": 1,
"message": "Successful",
"result": true,
"version": "1.0",
"timestamp": 1714464037796,
"requestId": "1eb5d1dd17144640363601002d1e2b"
}
附表