Custom action fails for unexpected reason

Note: This article applies to the web services data actions integration.

When you test a custom action in Genesys Cloud or use it in Architect for your web services data actions integration, the action always fails, but the web service works with the same inputs in REST API clients like Postman.

By default, Genesys Cloud encodes the data in requests and responses for actions as Transfer-Encoding: chunked. Web services that do not support Transfer-Encoding: chunked return incorrect errors, such as “Invalid JSON” even when the body is valid JSON.

For web services that do not support Transfer-Encoding: chunked, set Transfer-Encoding to buffered in requests. If you set Transfer-Encoding to buffered, then Genesys Cloud includes a Content-Length header behind the scenes and sends all the data in a single request or response. 

You can modify the header in requests with the Simple or the JSON input method.

  1. Click Add Header.
  2. Enter Transfer-Encoding and buffered in the text boxes.

Simple input method for header in action request

Add Transfer-Encoding: buffered to the JSON.

{
  "requestUrlTemplate": "https://www.example.com/health/check/services/${input.service}",
  "requestType": "GET",
  "headers": {
    "Transfer-Encoding": "buffered"
  },
  "requestTemplate": "${input.rawRequest}"
}

For more information, see Test data actions and Add configuration to custom actions.

For more information about the integration, see About the web services data actions integration.