# CHT SMS message sent via Africa's Talking stuck in "pending" state

**URL:** <https://forum.communityhealthtoolkit.org/t/cht-sms-message-sent-via-africas-talking-stuck-in-pending-state/5082>\
**Category:** Technical Support\
**Created:** [June 20, 2025, 7:43am UTC](https://forum.communityhealthtoolkit.org/t/cht-sms-message-sent-via-africas-talking-stuck-in-pending-state/5082 "2025-06-20T07:43:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Kiarie](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/ben_kiarie/32/2529_2.png) [@Ben\_Kiarie](https://forum.communityhealthtoolkit.org/u/Ben_Kiarie)\
**Post date:** [June 20, 2025, 7:43am UTC](https://forum.communityhealthtoolkit.org/t/cht-sms-message-sent-via-africas-talking-stuck-in-pending-state/5082/1 "2025-06-20T07:43:28Z")

</div>

Hi @diana,

I’ve successfully configured Africa’s Talking, the message is being sent but I get an error from attempting to parse the response from AT.

```auto
2025-06-20T07:04:29.649 ERROR: Unable to JSON parse response: {
  SMSMessageData: {
    Message: 'Sent to 1/1 Total Cost: KES 0.8000',
    Recipients: [
      {
        cost: 'KES 0.8000',
        messageId: 'ATXid_081365ccc485678b5c0413e1795ab53e',
        messageParts: 1,
        number: '+254701 ******',
        status: 'Success',
        statusCode: 100
      },
      [length]: 1
    ]
  }
} 

```

From my debugging I see the issue is in the [parseResponseBody](https://github.com/medic/cht-core/blob/3912847eff9c8b5e7f51cad74e0e43a307067915/api/src/services/africas-talking.js#L77) . The `parseResponseBody()` function in `api/src/services/africas-talking.js` attempts `JSON.parse()` on an already-parsed object.

Changing the function temporarily solved the issue.

```auto
 if (typeof body === 'object' && body !== null) {
    return body;
  }

```

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [June 20, 2025, 10:51am UTC](https://forum.communityhealthtoolkit.org/t/cht-sms-message-sent-via-africas-talking-stuck-in-pending-state/5082/2 "2025-06-20T10:51:56Z")

</div>

Hi @Ben_Kiarie

Thanks for reporting! Indeed this is an issue with this integration. I’ll submit an issue.
