REST Endpoint - Raw content
You can configure callable recipes to accept raw content when exposed as a REST endpoint. This allows you to integrate more datatypes (e.g. XML/SOAP and URL Encoded Form) into your workflow.
For example, you can trigger a callable recipe with a raw content body cURL statement:
curl -X POST 'https://apim.workato.com/API-collection-v1/send-raw-content' \ -d '<string>' \ -H 'content-type:text/xml' \ -H 'API-TOKEN: <YOUR_TOKEN>'
Raw request body
When creating your callable recipe, select Raw request body. This configures the recipe to accept any data type.
Select raw request body
There is no need to configure the input for this action.
|Request Content type||The
|Request body (raw)||The full raw body content.|
In this example below, we are receiving XML content from the API call. We use the XML parser to convert the raw content into useable datapills.
Receiving raw content and reading it with the XML parser. See the full sample recipe here.
You can configure your callable recipe to return raw content (text).
- Select the raw response for your recipe trigger .
Select raw response
- Configure the reply in the return response action.
In this example, we are receiving XML content in the API call. We parse the message and use the
File ID to retrieve a text file from storage. Finally, we return a text file to the calling system.
Return raw content from a callable recipe. See the full sample recipe here.
Test on Workato API Platform
Proceed to setup your recipe's REST endpoint on Workato's API platform. Once done, you can test out your new REST endpoint with raw content.
Testing REST endpoint with raw content