> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Add Wi-Fi Information

> Call this API to batch add up to 100 Wi-Fi entries to an attendance group. Pass the attendance group ID and the Wi-Fi list.

Call this API to batch add Wi-Fi information to a specified attendance group.

## Request

| **Basic Information** | |
| - | - |
| HTTP URL | [https://api.dingtalk.io/topapi/attendance/group/wifis/add](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](https://help.dingtalk.io/open/development/obtain-orgapp-token). |

### 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](https://help.dingtalk.io/open/development/groupid-to-groupkey.md) 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 theme={"theme":{"light":"github-light","dark":"github-dark"}}
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'
```

Java

```java theme={"theme":{"light":"github-light","dark":"github-dark"}}
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());
```

Python

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
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)
```

PHP

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
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");
```

C#

```csharp theme={"theme":{"light":"github-light","dark":"github-dark"}}
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

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "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"
}
```

### Error Codes

If the call returns an error, find a solution in the [Global Error Codes](https://help.dingtalk.io/open/development/server-api-error-codes-1.md) document based on the error message.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.