Request
| Basic Information | |
|---|---|
| HTTP URL | https://api.dingtalk.io/topapi/attendance/group/wifis/add |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Permissions | permission-qyapi_attendance_group_manage-Attendance group management permission |
Query Parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | 1eb68xxx | The App credential used to call this API. Obtain it by calling Get the access_token of an Internal App. |
Request Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| op_userid | String | No | user01 | The user ID of the operator. |
| group_key | String | Yes | 0151E0xxx | The attendance group ID. Note If your attendance group identifier is group_id, call Convert groupId to groupKey to convert group_id to group_key. |
| wifi_list | Wifi[] | Yes | The Wi-Fi list. Add up to 100 Wi-Fi entries per call. | |
| foreign_id | String | Yes | office-wifi | The business-side Wi-Fi ID. |
| mac_addr | String | Yes | 11:11:11:11:11:11 | The MAC address. |
| ssid | String | Yes | office-wifi-1 | The name. |
Request Example
curl -X POST "https://api.dingtalk.io/topapi/attendance/group/wifis/add" \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'access_token=b040xxxx34a60' \
-d 'group_key=0151E02xxxx17E876' \
-d 'op_userid=123456' \
-d 'wifi_list=null'
DingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/wifis/add");
OapiAttendanceGroupWifisAddRequest req = new OapiAttendanceGroupWifisAddRequest();
req.setOpUserid("123456");
req.setGroupKey("0151Exxxx17E876");
List<Wifi> list2 = new ArrayList<Wifi>();
Wifi obj3 = new Wifi();
list2.add(obj3);
obj3.setForeignId("123456");
obj3.setMacAddr("11:11:11:11:11:11");
obj3.setSsid("alibaba-guest");
req.setWifiList(list2);
OapiAttendanceGroupWifisAddResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());
import dingtalk.api
req=dingtalk.api.OapiAttendanceGroupWifisAddRequest("https://api.dingtalk.io/topapi/attendance/group/wifis/add")
req.op_userid="123456"
req.group_key="0151E022xxxx17E876"
req.wifi_list=""
try:
resp= req.getResponse(access_token)
print(resp)
except Exception,e:
print(e)
include "TopSdk.php";
date_default_timezone_set('Asia/Shanghai');
$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiAttendanceGroupWifisAddRequest;
$req->setOpUserid("123456");
$req->setGroupKey("0151E0xxxx7E876");
$wifi_list = new Wifi;
$wifi_list->foreign_id="123456";
$wifi_list->mac_addr="11:11:11:11:11:11";
$wifi_list->ssid="alibaba-guest";
$req->setWifiList(array($wifi_list));
$resp = $c->execute($req, $access_token, "https://api.dingtalk.io/topapi/attendance/group/wifis/add");
IDingTalkClient client = new DefaultDingTalkClient("https://api.dingtalk.io/topapi/attendance/group/wifis/add");
OapiAttendanceGroupWifisAddRequest req = new OapiAttendanceGroupWifisAddRequest();
req.OpUserid = "123456";
req.GroupKey = "0151E0xxxx17E876";
List<OapiAttendanceGroupWifisAddRequest.WifiDomain> list2 = new List<OapiAttendanceGroupWifisAddRequest.WifiDomain>();
OapiAttendanceGroupWifisAddRequest.WifiDomain obj3 = new OapiAttendanceGroupWifisAddRequest.WifiDomain();
list2.Add(obj3);
obj3.ForeignId = "123456";
obj3.MacAddr = "11:11:11:11:11:11";
obj3.Ssid = "alibaba-guest";
req.WifiList_ = list2;
OapiAttendanceGroupWifisAddResponse rsp = client.Execute(req, access_token);
Console.WriteLine(rsp.Body);
Response
Response Body
| Name | Type | Example | Description |
|---|---|---|---|
| result | DingOpenResult | The returned information. | |
| result | Result | The result of adding Wi-Fi. | |
| error_info_list | ErrorInfo[] | The list of Wi-Fi entries that failed to be added. | |
| failure_list | Wifi[] | The failure list. | |
| foreign_id | String | alibaba-guest | The business-side Wi-Fi ID. |
| mac_addr | String | 02:10:18:11:11:11 | The MAC address. |
| ssid | String | alibaba-guest1 | The MAC name. |
| wifi_key | String | 01xxxxE876 | The key of the Wi-Fi entry that failed to be added. |
| msg | String | business fault | The error description. |
| code | String | 1000 | The error code. |
| success_list | Wifi[] | The list of Wi-Fi entries added successfully. | |
| foreign_id | String | office-wifi | The business-side Wi-Fi ID. |
| mac_addr | String | 11:11:11:11:11:11 | The MAC address. |
| ssid | String | office-wifi-1 | The MAC name. |
| wifi_key | String | 01xxxxE876 | The key of the Wi-Fi entry added successfully. |
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The return code description. |
| success | Boolean | true | Whether the call succeeded. - true: Success - false: Failed |
| request_id | String | wicoxqraqt0g | The request ID. |
Response Body Example
{
"result": {
"errcode": 0,
"errmsg":"ok",
"result": {
"error_info_list": [
{
"code": "1000",
"failure_list": [
{
"foreign_id": "alibaba-guest",
"mac_addr": "02:10:18:11:11:11",
"ssid": "alibaba-guest1"
}
],
"msg": "business fault"
}
],
"success_list": [
{
"foreign_id": "office-wifi",
"mac_addr": "11:11:11:11:11:11",
"ssid": "office-wifi-1"
}
]
},
"success": true
},
"request_id": "10enywafok7h8"
}