Legacy Dev Forum Posts

 View Only

Sign Up

Error in Data Action due to malformed syntax

  • 1.  Error in Data Action due to malformed syntax

    Posted 06-05-2025 18:40

    DaviniaGarridoLope | 2017-12-15 13:37:02 UTC | #1

    Hello, I am trying to implement a Data Action to make a consulted transfer and then include it in a script. But I only get this result:

    "status": 400, "code": "bad.request", "message": "The request could not be understood by the server due to malformed syntax.",

    I attach here the code that I am using for the petition:

    Action Contracts

    Input

    { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Transferencia consultada", "description": "Transferencia consultada", "type": "object", "required": [ "conversationId", "participantId" ], "properties": { "conversationId": { "type": "string", "description": "conversationId" }, "participantId": { "type": "string", "description": "participantId" } } }

    Output

    { "$schema": "http://json-schema.org/draft-04/schema#", "title": "e", "description": "", "type": "object", "properties": { "DESTINATIONID": { "type": "string", "title": "DESTINATIONID", "description": "DESTINATION_ID" } } }

    Configuration

    Request

    { "requestUrlTemplate": "/api/v2/conversations/calls/${input.conversationId}/participants/${input.participantId}/consult", "requestType": "POST", "headers": {}, "requestTemplate": "{\"speakTo\": \"DESTINATION\",\"destination\": {\"address\": \"+34678678678\"}}" }

    Response

    { "translationMap": { "DESTINATIONID": "$.destinationParticipantId" }, "successTemplate": "{\n \"DESTINATIONID\": ${DESTINATION_ID}}" }

    Are my contracts or configuration coded incorrectly?

    Thanks in advance.


    Jason_Mathison | 2017-12-15 15:44:02 UTC | #2

    Unfortunately, I am pretty sure that the API you are trying to use is only available to a logged in user that is a participant in the conversation. The conversation APIs currently do not have support for non-user accounts to manipulate conversations.

    This issue appears to be similar to the situation in a different forum post. Take a look at Tim's suggestions for how you could implement a solution: https://developer.mypurecloud.com/forum/t/error-403-when-executing-purecloud-data-action/2222/


    tim.smith | 2017-12-15 15:52:12 UTC | #3

    The 400 error is because you have some misconfiguration in your request, but Jason is correct that you cannot use this API with client credentials even if you correct the configuration.


    system | 2018-01-15 15:52:08 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 2251