The HTTP request body defines the data you send to your destination application. You do not need to build a request body for your HTTP imports. You can build the request body if you desire, but it is not necessary. If you choose to set this field, the data is sent to the destination application as you wrote it. If you don’t, the data coming from the last flow step is sent to the destination application in the HTTP request body.
Caution: You don’t need to configure an HTTP request body, but if you do it will modify the way your data is sent to the destination application.
Contents
The HTTP request body defines the data you send to your destination application. To create your request body you’ll need a sample request from your application’s API, a basic understanding of XML or JSON, and some familiarity with handlebars expressions. Handlebars let you map Export and Import application fields, perform dynamic arithmetic calculations on exported values, and dynamically encode and decode data during integration.
Important: Building the request body is only necessary if you have an HTTP import.
The relative URI is the resource path portion of an API endpoint. Some examples are: /product or /bulkUpdate/orders. This value is combined with the base URI defined in the connection resource associated with your import. The base URI and relative URI complete a fully qualified URL describing an API endpoint.
You need a flow to create your request body, including a source, mapped field records, and a relative URI.
In your HTTP import, scroll to find the HTTP request body field. Click Handlebars on the right-hand side to open the < a href="/hc/en-us/articles/360043040652" rel="noopener" target="_blank"> Advanced field editor (AFE).

Review the Advanced field editor (AFE)
The Advanced field editor (AFE) is a user interface available for certain fields where the output is generated using dynamic data, like creating an HTTP request body with handlebars expressions.

Resources available for your handlebars template
This section displays your available fields, example data, and connection details. You must manually add additional fields and example data, including any fields used in field mappings. You can also use Create lookups to dynamically retrieve information from the destination application.
Click preview to evaluate your handlebars template
This provides a preview of the handlebars template including all your populated fields.
Build your HTTP request body
The best option for building a request body is to paste an example request from your destination application’s API and add your handlebar expressions. You can use import mappings to associate fields, for example, a "Purchaser" field in a source application would correspond to a "Person" field in the destination application. The sample JSON data below is taken from the source application:
{
"Group1":
{
"Shopper1":
[
{
"Purchaser":"Human",
"Email":"email.at.email.com",
"Name":"JohnSmith"
}
]
This source application data can be directly mapped to a destination application. Notice the difference between the field names where "Purchaser" in the source application is "Person" in the destination application:
{{#each people}} { "{{Customer1}}": { "{{Person}}", "{{BuyerEmail}}", {{BuyerName}}" }
…and so on. You don’t need to create associations in your handlebars expressions because they’ve already been created in your field mappings.
Once you’ve written your HTTP request body, use Preview to evaluate the template and finish your body. Then, Save and close your import.
Comments
1 comment
It would be great to have some additional details here about AFE 1.0 vs AFE 2.0
Please sign in to leave a comment.