JSON not Formated

Hi,

We have an automation in place that updates the plannedDuration of a task. However, when we update only the plannedDuration, the description field gets cleared automatically.
To prevent this, we also include the existing description in the update request.

The problem is that we sometimes receive the following error when updating a task:

[400] Failed to read parameter "GeneralTaskForm model" from the request body as JSON.

This seems to happen especially when the description text contains quotes (e.g., " or typographic quotes like or ).
We are using the exact same description text that we previously retrieved from the task via the API.

Do you have any idea what might be causing this issue, or how we can ensure the description is safely passed in the update request?

For Example:
[
{
„url“: „v1/tasks/28407f20-97df-4e49-b0ee-5e2825f4ddbf“,
„body“: „{ "name": "Demo „Auftrag“ “TEST”",\n"plannedDuration": "300",\n"dueOn":"",\n"description": "

  1. gesetzt werden anstelle von "Angebot versendet".

"}“,
„method“: „PUT“,
„headers“: [
{
„key“: „Content-Type“,
„value“: „application/json“
}
]
}
]

Hi @tim.guersch, thank you for reporting this. Do you happen to have the trace-id from the response headers so we can investigate this? Support | awork API | Documentation

Generally, JSON requires strings to be escaped as in this example:

{
  "description": "Please say: \"Hello, world!\""
}

Hi Sebastian,

of course a6c6d9ca7e5f3df0a6d1a0d7de19fe8f

Hi Sebastian,

for your understanding, we use make.com to call the API. We simply reference to the description of the Task we get from our querie.

In awork’s API response, quotes are escaped like this: \"Test\". The make integration my un-escape them. I would expect they would also escape texts in JSON again, but as this is a custom body, they might not do that. The best thing I could think of is that you run a function before sending the data that escapes the strings, but I don’t know make very well unfortunately.

1 „Gefällt mir“