# Get task result via API

**URL:** https://forum.genieacs.com/t/get-task-result-via-api/4361
**Category:** Uncategorized
**Created:** [August 11, 2023, 4:25pm UTC](https://forum.genieacs.com/t/get-task-result-via-api/4361 "2023-08-11T16:25:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fdavidcn](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/fdavidcn/32/594_2.png) [@fdavidcn](https://forum.genieacs.com/u/fdavidcn)
#### Post date: [August 11, 2023, 4:25pm UTC](https://forum.genieacs.com/t/get-task-result-via-api/4361/1 "2023-08-11T16:25:21Z")

</div>

Hi guys!

If i send a command via API to reboot a device i receive a JSON dict with this values:

```auto
{
        "_id": "64d65a884e5008025b0081c3",
        "name": "reboot",
        "device": "00259E-EG8145V5-48575443XXXXXXXX",
        "timestamp": "2023-08-11T15:58:00.131Z"
    }

```

But i don’t know if device was rebooted or not only that task is sent correctly to GenieACS. From GUI if i send reboot to the same device that are offline i get an error `"00259E-EG8145V5-48575443XXXXXXXX: Connection request error: Unexpected status code 401"`

There is any way to know the result (in this case ‘status code 401’) of a task sent via API?

Thanks!!

---

<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: [August 11, 2023, 7:58pm UTC](https://forum.genieacs.com/t/get-task-result-via-api/4361/2 "2023-08-11T19:58:48Z")

</div>

401 is permissions issue. Likely you don’t have CWMP → CPE authentication setup correctly.

And to get a response from the api, you need to include the `connection_request` param in the URL.

---

<div class="post-metadata">

### Author: ![fdavidcn](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/fdavidcn/32/594_2.png) [@fdavidcn](https://forum.genieacs.com/u/fdavidcn)
#### Post date: [August 13, 2023, 1:51pm UTC](https://forum.genieacs.com/t/get-task-result-via-api/4361/3 "2023-08-13T13:51:23Z")

</div>

Hi @akcoder, i will try to find any other method to get connection\_request response.

Thanks!

---

<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, 2024, 7:09pm UTC](https://forum.genieacs.com/t/get-task-result-via-api/4361/6 "2024-05-29T19:09:40Z")

</div>

Necromancy is frowned upon. Please create your own thread instead of resurrecting an almost year old thread that is not related to your question.
