Paging is used to break up the data returned from an endpoint into small chunks. Every service is different and there are several different paging methods available to use in SmartConnect.
Setup for Service Destinations
- Navigate to Service Destinations on the Rest Service Maintenance page.
- Enter an Action Name for a new service destination.
- Choose a group for the service destination if groups are being used.
- Click the Edit Service button to configure the service destination.
Settings
- Name – Name of service destination. Defaults in from step 2 above.
- Linked Entity – Uses field and endpoint settings from an existing Service Data Source. Leave blank to setup these settings manually.
- Group – Defaults in from step 3 above.
- Endpoint – Set the endpoint of the service destination. Do not include the Base Url portion of the url that was defined on the main settings page.
- Request Method – Set the method required for the endpoint as defined in the service api.
- Response Type – Display only field to show the response type of the service.
- Clear unmapped values – Option to remove fields from payload if they are not mapped, but are included in the Body definition.
- Uses value pairs – Option to define how value pairs are defined. Once enabled, enter the value pair key.
-
- Value Pair Key – In this example, the value pair key is property.
-
- Clear blank values – Option to remove fields from payload if the mapped value is blank.
Action Notes
Enter any notes regarding the use and setup of the service destination.
Fields
You can manually enter each field available from the service endpoint or use the Load Fields option to import fields using the available options.
- From Entity – Copy fields from an existing rest data source you have already setup.
- From File – Select a JSON or XML file to choose fields to import.
- From JSON/XML – This option will change between JSON and XML depending on the body type the service uses. Paste in your JSON or XML fields and select the desired fields after clicking the parse button.
When entering fields manually, enter the field name, the Path using dot notation, and the field type.
Set the required option if the field must be mapped and sent to the service.
Body
- Set the type of data that will be sent to the service destination.
- Define how the source data is sent to the service destination based on the service api. For example, the below json is used to create an order and order lines.
In SmartConnect, enter the body as above and then use the Insert Field drop down to replace the values with field place holders from the fields defined in the Fields section above.
Since there can be more than one item per order, the items will need to be defined as a child entity below. The child entity is referenced the same as fields by using the Insert Child Entity drop down and the entire child entity template will be inserted into the placeholder when an integration runs.
Child Entities
Click the Add Child Entity button to add a new child entity.
Setting Tab
Child Entity Key – Enter a name for the child entity. This is the value that will be used to reference it from the main body.
Description – Enter a child entity description.
Parent Entity – Choose the parent entity.
Fields Tab
You can manually enter each field available from the service endpoint or use the Load Fields option to import fields using the available options.
- From Entity – Copy fields from an existing rest data source you have already setup.
- From File – Select a JSON or XML file to choose fields to import.
- From JSON/XML – This option will change between From JSON and From XML depending on the body type the service uses. Paste in your JSON or XML fields and select the desired fields after clicking the parse button.
When entering fields manually, enter the field name, the Path using dot notation, and the field type.
Set the required option if the field must be mapped and sent to the service.
Using the same example, the child entity will only require the line_item fields in the image below.
Template Tab
In SmartConnect, enter the body as above in the highlighted red box and then use the Insert Field drop down to replace the values with field place holders from the fields defined on the Fields tab.
Parameters
- Default Parameters Section- Default parameters are parameters available to use from the main parameters setup page for the service.
- Use Default Parameters- Check this box if the default parameters are to be used for the endpoint. When unchecked, the lower parameters section will be used.
- Parameters Section- These are endpoint specific parameters. Use these if parameters are needed, but they are not setup as default parameters or if there are default parameters that shouldn’t be included for this endpoint.
- Clear Empty- Check this box to Clear the parameter when a request is made if it is blank.
Headers
- Default Headers Section- Default headers are headers available to use from the main headers setup page for the service.
- Use Default headers- Check this box if the default headers are to be used for the endpoint. When unchecked, the lower headers section will be used.
- Entity Headers Section- These are endpoint specific headers. Use these if headers are needed, but they are not setup as default headers or if there are default headers that shouldn’t be included for this endpoint.
- Clear Empty- Check this box to Clear the header when a request is made if it is blank.
Variables
List of variables created in the main rest variables section.
- Value – Change the default value of the variable for the specific destination.
- Mappable – Makes the variable available to map source data to when setting up an integration.