Add configuration to custom actions for integrations
When creating a custom action, first add contracts and then add configuration. The configuration defines how the action implements the contracts. For more information, see Create a custom action and Add contracts to custom actions.
- Click the Configuration tab.
- Select the HTTP method.
- Under Request, configure the request that the action sends to the web service. Genesys recommends configuring the request by using the fields under Simple.
Tip: Click the properties under Available Inputs to copy and quickly paste them in the request. These properties come from your input contract. For more information, see Add contracts to custom actions. You can use macros with the templates. For more information, see Velocity macros for data actions.
Enter information for the fields that appear. The fields that appear vary depending on the HTTP method selected and the contracts added.
Notes:- For the AWS Lambda data actions integrations and Google Cloud Functions, see the following Special request configurations section.
- Excessively nested JSON objects can affect the performance of the data action service. To maintain the performance, the depth of JSON objects is limited to 50 levels. For more information, see Limits in Genesys Cloud Developer Center.
- Request URL Template
Set the Request URL Template to the remote endpoint that your HTTP request hits.
- Headers (optional)
Key-value pairs that are added as HTTP headers on the request that is sent to the remote endpoint.
Note: If you are setting the Accept header, you must use a JSON media type as the header value. - Transfer Encoding
If your web service does not support Transfer-Encoding set to chunked, add Transfer-Encoding: buffered under headers. For more information, see Custom action fails for unexpected reason.
- Authorization
You can include authorization information in the request configuration. For more information, see How to use the User Defined credential type and How to use the User Defined (OAuth) credential type.
- Request URL Template
Set the Request URL Template to the ARN of your AWS Lambda function. For more information, see Create IAM resources to invoke AWS Lambda functions.
- Request Type
Set Request Type to POST. This HTTP method ensures that the action sends any request body with the request configuration.
- Headers
Key-value pairs that are added to a custom map on the clientContext object. The clientContext object is in turn a value on the invocation context object. If the following attributes exist, they are automatically set on the context object:
- ININ-Organization-Id
- ININ-Home-Organization-Id
- ININ-Correlation-Id
- ININ-User-Id
- ININ-Integration-Id
For a Java example of the clientContext object, see Interface ClientContext.
- Request Template
Any values that you specify under Request Template will be available in the event parameter of the invoked AWS Lambda function.
- Request URL Template
Set the Request URL Template to the location of the Google Cloud Function that you want the data action to execute: https://{location-of-function}-{project-owning-function}/{function-name}.
- Request Type
Set Request Type to POST.
- Request Template
Set Request Template to ${input.rawRequest}.
- Under Response, add the JSON configuration.
The JSON configuration defines how the response from the web service or AWS Lambda function is processed.
You can use the response in other actions or the following example as a guide for creating the JSON. For more information about using macros with the success template, see Velocity macros for data actions.
Tip: Click the properties under Available Outputs to copy and quickly paste them in the response. These properties come from in your output contract. For more information, see Add contracts to custom actions.{ "translationMap": { "buildNumber": "$.Build-Version", "serviceName": "$.name", "status": "$.Status" }, "successTemplate": "{\r\n \t\"build\": ${buildNumber},\r\n \t\"name\": ${serviceName},\r\n\"status\": ${status}\r\n }" }
For a detailed explanation of the parts of the response, see Response configuration for data actions.
Special request configuration
The request configuration for custom actions that are associated with the Adobe or AWS Lambda data actions integrations or that execute the Google Cloud Functions vary from the standard request configuration for web services.
For a detailed explanation of the parts of the request, see Request configuration for data actions.
People knowledgeable about JSON can use the JSON input option. Use requests in other actions or the following example as a guide for creating the JSON.
{
"requestUrlTemplate": "https://www.example.com/health/check/services/${input.service}",
"requestType": "GET",
"headers": {},
"requestTemplate": "${input.rawRequest}"
}
Next, test the action for validation and execution errors.
For more information, see About custom actions for integrations.
For more information about the integrations, see About the data actions integrations.