API OpenAI Assistant response fails when sending in JSON format

I am performing an integration in ServiceNow with the Assistants API. When executing the request body, it is not being parsed correctly as JSON.
One cause might be that the request body is not in the correct format or that there are invalid characters in the request body.

However, when printing the request body before sending it to the API, I verify that it is in the correct format.

var messageBody = JSON.stringify({
“role”: “user”,
“content”: {
“type”: “text”,
“text”: {
“value”: message
gs.debug(‘Contenido de messageBody :’+messageBody);

sendMessage.setRequestBody({body: messageBody});

Here is an example of the debug output.

[DEBUG] Contenido de messageBody :{“role”:“user”,“content”:{“type”:“text”,“text”:{“value”:“Sistema SAP lento”}}}

Tipo mensaje messageBody es:string

[DEBUG] Message response 1: [object RESTResponseV2]

[DEBUG] Message response getBody: { “error”: { “message”: “Invalid body: failed to parse JSON value.
Please check the value to ensure it is valid JSON.
(Common errors include trailing commas, missing closing brackets, missing quotation marks, etc.)”, “type”: “invalid_request_error”, “param”: null, “code”: “invalid_json” } }

Can you help me understand what might be happening, whether it is an issue with the API or something else?