Many web services require the use of a path parameter to complete a request. For example, the Teamwork Add Time Entry endpoint requires a project id to be able to add time an invoice: base_url/invoices/{id}/lineitems.json. If we entered the project id path parameter directly in the url, the endpoint will only work for one project. SmartConnect can dynamically switch out this value with values from a data source using a rest variable.
Setting up the process
I’m going to assume you already have a web service setup and working. The next step is to add a Variable from the Rest Service Maintenance page.
Next, we add the variable in place of the path parameter on the Service Action endpoint. Variables are enclosed in double square brackets.
The last step is to set the variable to be mappable so it can be replaced with mapped values from our data source.
Now, when setting up an integration process using this Service Action, you will have a mappable variable shown in red because the path parameter is a required value. This will replace the path parameter with any values you have in your source data.
This is powerful if you need to dynamically change out a path parameter for a value coming from your source data. Next time we will take it a bit further and incorporate the use of global variables in service entities and actions.
If you have any more questions, please reach out to us at sales@eonesolutions.com