Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Sales Force API JSON error

    Posted 05-21-2025 19:09

    I am getting this error when posting on a SalesForce API.

    {
      "message": "The request could not be understood by the server due to malformed syntax.",
      "code": "bad.request",
      "status": 400,
      "messageParams": {},
      "contextId": "cacf7962-1580-401f-9b73-bdcc4b8e897b",
      "details": [
        {
          "errorCode": "ACTION.REMOTE_ENDPOINT"
        }
      ],
      "errors": [
        {
          "message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: [{\"message\":\"Unrecognized field \\\"input_WantsText\\\" at [line:1, column:25]\",\"errorCode\":\"JSON_PARSER_ERROR\"}] [cacf7962-1580-401f-9b73-bdcc4b8e897b]",
          "code": "BAD_REQUEST",
          "status": 400,
          "messageParams": {},
          "details": [],
          "errors": []
        }
      ]
    }
    This is the contract which is very simple in itself

    {
      "title": "inputs",
      "type": "object",
      "properties": {
        "input_WantsText": {
          "type": "boolean"
        },
        "input_ANI": {
          "type": "string"
        }
      }
    }
    However when testing with POSTMAN it looks like Sales Force is expecting an Array which is not allowed in Genesys JSON formatting. This request format works fine in Postman which has hard coded values.

    {
      "inputs": [
        {
          "input_ANI": "1112223333",
          "input_WantsText": true
        }
      ]
    }

    Any assistance is appreciated since I tried to format with Array but the Genesys JSON editor does not allow it.


    #DataActions
    #Integrations

    ------------------------------
    Cisco Amaya
    ------------------------------


  • 2.  RE: Sales Force API JSON error

    Posted 06-06-2025 15:01

    Hi Cisco,

    Instead of an array input, you would need to input each element in the array as a separate object at the top level of the input, like "input1", input2", etc.



    ------------------------------
    Jacob Shaw
    Sr. Software Engineer
    ------------------------------