# Multiple API task requests

**URL:** <https://forum.genieacs.com/t/multiple-api-task-requests/6891>\
**Category:** Uncategorized\
**Created:** [May 27, 2025, 7:01am UTC](https://forum.genieacs.com/t/multiple-api-task-requests/6891 "2025-05-27T07:01:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yehudah](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/yehudah/32/2443_2.png) [@yehudah](https://forum.genieacs.com/u/yehudah)\
**Post date:** [May 27, 2025, 7:01am UTC](https://forum.genieacs.com/t/multiple-api-task-requests/6891/1 "2025-05-27T07:01:06Z")

</div>

Hi,

I am having an issue with updating IP addresses for multiple devices using the API.

I have a script that communicates with the GenieACS to update IP addresses, subnet masks and gateway. It returns the status code of 200. When I log onto the GenieACS UI the details for those device IDs are correct. When I summon the first device it works, but when I summon the second device it shows as offline.

When I log onto the second device via LAN, I see that only the gateway updated and not the IP address or the subnet mask. which causes it not to break out to the internet.

I have tried refreshing parameters and waiting for status code 200 instead of 202 and I have also tried setting a timer between each device, but I always come into the same issue.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 27, 2025, 4:09pm UTC](https://forum.genieacs.com/t/multiple-api-task-requests/6891/2 "2025-05-27T16:09:38Z")

</div>

Please include the full source code for what you are trying to accomplish.

---

<div class="post-metadata">

**Author:** ![yehudah](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/yehudah/32/2443_2.png) [@yehudah](https://forum.genieacs.com/u/yehudah)\
**Post date:** [May 28, 2025, 6:16am UTC](https://forum.genieacs.com/t/multiple-api-task-requests/6891/3 "2025-05-28T06:16:46Z")

</div>

```auto
    - name: Update IP for each device
      ansible.builtin.uri:
        url: "{{ acs_url }}/{{ acs_collection }}/{{ item[0] | urlencode }}/tasks?connection_request"
        method: POST
        user: "{{ acs_username }}"
        password: "{{ acs_password }}"
        headers:
          Content-Type: application/json
        body_format: json
        body:
          name: "setParameterValues"
          parameterValues: [
            ["InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress", "{{ item[1] }}", "xsd:string"],
            ["InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.SubnetMask", "{{ acs_subnet }}", "xsd:string"],
            ["InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.DefaultGateway", "{{ acs_gateway }}", "xsd:string"]
          ]
        status_code: 200
      loop: "{{ device_ids | zip(acs_ips) | list }}"
      loop_control:
        loop_var: item

```

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 28, 2025, 4:16pm UTC](https://forum.genieacs.com/t/multiple-api-task-requests/6891/4 "2025-05-28T16:16:08Z")

</div>

Yeah sorry, I’m not helping you debug your ansible scripts. If you can recreate the issue using curl I’ll be happy to help.

---

<div class="post-metadata">

**Author:** ![yehudah](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/yehudah/32/2443_2.png) [@yehudah](https://forum.genieacs.com/u/yehudah)\
**Post date:** [May 29, 2025, 8:50am UTC](https://forum.genieacs.com/t/multiple-api-task-requests/6891/5 "2025-05-29T08:50:07Z")

</div>

Here I have the same issue using curl.

```auto
curl -X POST \
  -H "Content-Type: application/json" \
  "https://acs.vanilla.capetown:7557/devices/80AFCA-WR1300%2520V3%252E0-WR1300231006090/tasks?connection_request" \
  -d '{
        "name": "setParameterValues",
        "parameterValues": [
          ["InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress", "10.2.21.35", "xsd:string"],
          ["InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.SubnetMask", "255.255.255.248", "xsd:string"],
          ["InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.DefaultGateway", "10.2.21.33", "xsd:string"]
        ]
      }'

```

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 29, 2025, 8:18pm UTC](https://forum.genieacs.com/t/multiple-api-task-requests/6891/6 "2025-05-29T20:18:57Z")

</div>

What is in `/var/log/genieacs/genieacs-cwmp-access.log` for the CPEs in question? Is the CPE responding on its connection request URL? Remember that TR-69 is client driven. The CWMP client on the CPE needs to inform to the ACS before it can receive any instructions.

---

<div class="post-metadata">

**Author:** ![yehudah](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/yehudah/32/2443_2.png) [@yehudah](https://forum.genieacs.com/u/yehudah)\
**Post date:** [May 30, 2025, 6:21am UTC](https://forum.genieacs.com/t/multiple-api-task-requests/6891/7 "2025-05-30T06:21:40Z")

</div>

I get statusCode 204 back from the client
