# Outgoing API: error from Awork

**URL:** <https://community.awork.com/t/outgoing-api-error-from-awork/1606>\
**Category:** Developer Forum\
**Created:** [19. Juli 2024 um 08:17 UTC](https://community.awork.com/t/outgoing-api-error-from-awork/1606 "2024-07-19T08:17:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![masc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/masc/32/470_2.png) [@masc](https://community.awork.com/u/masc)\
**Post date:** [19. Juli 2024 um 08:17 UTC](https://community.awork.com/t/outgoing-api-error-from-awork/1606/1 "2024-07-19T08:17:31Z")

</div>

Hello!  
I’m trying to send a webhook to our chat system, which has been working fine from my system scripts for years…

I created the channel + sent a test:

```auto
[marc@whale ~]$ curl -i -X POST -H 'Content-Type: application/json' -d '{"text": "Bonjour, ceci est un texte\nCeci est un autre texte."}' https://f3nix-sarl.kchat.infomaniak.com/hooks/9c8d8cea-2bd1-4edc-94de-5edb0a3e5ad9
HTTP/2 201  
date: Thu, 18 Jul 2024 15:49:16 GMT
content-type: application/json
content-length: 754
x-infomaniak-custom-url-no-rewrite: 1
cache-control: no-cache, private
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
x-version-id: 1.84.3
x-request-id: B9360524913C2D9DBC1B01BB6699397C7D39E652E31
strict-transport-security: max-age=63072000

```

And I get the expected result:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/awork1/original/1X/b3313ee5040c896a5602217ce4b4d41c04ba6825.png)

Now I created de Webhook in Awork :

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/awork1/original/1X/4d57f080de31d6cf1ef483d002471ba230cf314b.png)

And I get errors in the aworks’s log :

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/awork1/original/1X/12738bf6d7d0fe5d904962bc2e4766b992bed5dd.png)

What did I miss? Is there a more detailed log available?

Thanks in advance for your suggestions and help!

Marc

---

<div class="post-metadata">

**Author:** ![Sebastian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/sebastian/32/89_2.png) [@Sebastian](https://community.awork.com/u/Sebastian)\
**Post date:** [19. Juli 2024 um 08:43 UTC](https://community.awork.com/t/outgoing-api-error-from-awork/1606/2 "2024-07-19T08:43:51Z")

</div>

Hi @masc , what I see in the logs is „Unprocessable Entity“.  
The response body is:

```auto
{"id":"the_text_field_is_required_when_attachments_is_not_present.","message":"The text field is required when attachments is not present. (and 1 more error)","errors":{"text":["The text field is required when attachments is not present."],"attachments":["The attachments field is required when text is not present."]},"request_id":"144FF5E706052D9DBC1B01BB669940D27D624552E31"}

```

I hope this helps.

---

<div class="post-metadata">

**Author:** ![masc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/masc/32/470_2.png) [@masc](https://community.awork.com/u/masc)\
**Post date:** [19. Juli 2024 um 09:18 UTC](https://community.awork.com/t/outgoing-api-error-from-awork/1606/3 "2024-07-19T09:18:27Z")

</div>

Hi @Sebastian,  
thank you for your reply.

I don’t know how to change the contents of the payload because I’m trying the webhook proposed by awork directly, without the possibility of modifying it (see the screenshots in post #1)?

In your opinion, should I open a ticket with awork?

---

<div class="post-metadata">

**Author:** ![Sebastian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/sebastian/32/89_2.png) [@Sebastian](https://community.awork.com/u/Sebastian)\
**Post date:** [19. Juli 2024 um 09:39 UTC](https://community.awork.com/t/outgoing-api-error-from-awork/1606/4 "2024-07-19T09:39:01Z")

</div>

In case of a webhook, the content is defined by us. If the tool you are trying to send this to does not understand the content, i.e. expects a different JSON model, you would have to put something in between that modifies the data to the format the application is expecting. This could either be a tool like Zapier or a self-hosted application.

---

<div class="post-metadata">

**Author:** ![masc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/masc/32/470_2.png) [@masc](https://community.awork.com/u/masc)\
**Post date:** [19. Juli 2024 um 09:54 UTC](https://community.awork.com/t/outgoing-api-error-from-awork/1606/5 "2024-07-19T09:54:46Z")

</div>

Ok.  
Is it possible to send me the expected json? Or give me the corresponding doc page?  
Just to make sure we’re talking about the same thing…

---

<div class="post-metadata">

**Author:** ![Sebastian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/sebastian/32/89_2.png) [@Sebastian](https://community.awork.com/u/Sebastian)\
**Post date:** [19. Juli 2024 um 10:25 UTC](https://community.awork.com/t/outgoing-api-error-from-awork/1606/6 "2024-07-19T10:25:05Z")

</div>

Sure, the webhook documentation is here: [Webhooks | awork.com](https://developers.awork.com/webhooks)

I recommend using a tool like [https://webhookinbox.com/](https://webhookinbox.com/) to see what data you would receive in your case.

---

<div class="post-metadata">

**Author:** ![Sebastian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.awork.com/sebastian/32/89_2.png) [@Sebastian](https://community.awork.com/u/Sebastian)\
**Post date:** [19. Juli 2024 um 10:25 UTC](https://community.awork.com/t/outgoing-api-error-from-awork/1606/7 "2024-07-19T10:25:44Z")

</div>

The actual API models of the entities can be found here: [https://openapi.awork.com/](https://openapi.awork.com/)
