Error message (400 bad request) at simple DataAction

Hi there,

I'm trying to get to understand the Data Actions feature, so I created a very simple one. The idea is that with the contactlist ID i fetch the name of that contact list.

But somehow I keep getting the error below:

{
  "message": "The request could not be understood by the server due to malformed syntax.",
  "code": "bad.request",
  "status": 400,
  "messageParams": {},
  "contextId": "c327948b-2639-472c-bbdf-bcfd6da60519",
  "details": [
    {
      "errorCode": "ACTION.PROCESSING"
    }
  ],
  "errors": [
    {
      "message": "REST call for action execute failed. Message:requestUrlTemplate could not be resolved into a fully qualified URL. [c327948b-2639-472c-bbdf-bcfd6da60519]",
      "code": "BAD_REQUEST",
      "status": 400,
      "messageParams": {},
      "details": [],
      "errors": []
    }
  ]
}

Input Contract:
{
"title": "Contact Lists Request",
"description": "Requests contact lists",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"required": [
"id"
],
"properties": {
"id": {
"description": "The Contaclist ID",
"type": "string"
}
},
"additionalProperties": true
}

Output Contract
{
"title": "Contact Lists Response",
"description": "Returns contact lists",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"name": {
"description": "The name of the contactlist",
"type": "string"
}
},
"additionalProperties": true
}

Configuration Request
{
"requestUrlTemplate": "/api/v2/outbound/contactlists/{input.id}", "requestType": "GET", "headers": { "Content-Type": "application/json" }, "requestTemplate": "{\"id\": \"{input.id}"}"
}

Configuration Responset
{
"translationMap": {},
"translationMapDefaults": {},
"successTemplate": "${rawResult}"
}

Thanks in advance,
BR,
Rob

Hello,

I think you are not using the appropriate integration.
You need to leverage the PureCloud/Genesys Cloud Data Action (integration) if you want to perform Platform API requests.
See here for more info (note: the integration has been renamed Genesys Cloud Data Action).

Based on the error you get, I think you have used the Web Services Data Action integration (requests made to 3rd party Web Services via full url).

As a note, once you create this Data Action, using a PureCloud/Genesys Cloud Data Action integration, you don't need to modify the requestTemplate in the Configuration Request. I mean that you are performing an HTTP GET - so what is sent in the body does not matter.
I used something like this:

{
  "requestUrlTemplate": "/api/v2/outbound/contactlists/${input.id}",
  "requestType": "GET",
  "headers": {
    "Content-Type": "application/json"
  },
  "requestTemplate": "${input.rawRequest}"
}

Regards,

1 Like

Hi Jerome,

Thanks! what a stupid mistake to make. It works now :slight_smile:

BR,
Rob

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