Make REST Call
The Make REST Call action is used to call web-based systems that support REST interfaces
There are times when you need to communicate with other system in real time. USing this action you can make calls to other systems and return information back into the active Record. This action uses JSON REST commands so the other system must be able to support these calls. The detail in setting up the calls depends entirely on how the receiving system expects the call to be made and what information it is expecting.
Options
API Info Tab
Use this tab to specify the basics of the REST call - endpoint, type and authentication info
- Call Type - We currently support GET, POST, PUT and DELETE calls. Select the one you need for this call.
- URL of REST Service - This is the URL or endpoint for the REST service you wish to call.
- Auth User Name - If the other service requires Basic Authentication you can enter the User Name here
- Auth Password - If the other service requires Basic Authentication you can enter the Password here
POST/PUT Data Tab
Use this tab to specify what data you are sending in your POST/PUT call.
- JSON - JSON data to send as a complete POST/PUT packet.
- Multi-Part Form Fields- You can also pass field/value pairs as multi-part form fields. Add an entry for each field.
Document Tab
You can use this to send a single Document in your REST call. The Document must be available by Id or by Record ID / Cat / SubCat / Name and must be less than 2 MB.
- Document ID - ID of the Document to send. If you choose to use the Document ID then the Record / Cat / SubCat / Name values are ignored.
- Record ID - ID of the Record containing the Document to send. If you choose to use the Record ID then you need to also specify Cat / SubCat / Name values to specify the Document to send.
Headers
You can send multiple header values in your REST call. DO NOT use this to send Basic Auth header. That is done on the API Info tab.
- Header Name - Name of the header to send
- Header Value - Value of the header to send
Field Updates
The response from the called REST endpoint will be available for you to store or process.
- Field Name - The name of the DocMgt field to store the returned data
- Source Type - Where to get the data to store
Full Response - This will store the entire JSON response into the field. This is useful if you wish to parse out the data at a later time.
Property - You can use the Source Name field to grab the correct property from the returned JSON
All Headers - This will store all the returned headers into the field. This is useful if you wish to parse out the data at a later time.
Header - You can use the Source Name field to grab the value of correct header from the returned header list
Collection Count - This allows you to store the count of returned data rather than the data itself. Use the Source Name field to specify which collection to count.
- Source Name - If you chose Property, Header or Collection Count you can specify the names of the items to operate on here
Property - If the returned item is an object then you would enter the property name here. If the return is a collection you would need to specify the collection offset and property using "(0).Name" notation. You can use as many levels as you need to get to your data. See the Property Example section below.
Header - Enter the name of the header whose value you wish to return.
Collection Count - If the returned item is a collection you could just leave this blank to get the count. If you need to get a count of a collection that is a property of an object you would need to specify the property name.
Property Example
If the returned data is a complex object you can use several layers of notation values to get to what you want.
Assume the following JSON is returned
[{"score":1.4265534,"show":{"id":722,"name":"The Golden Girls"}},{"score":0.7104603,"show":{"id":57291,"name":"The Holden Girls: Mandy & Myrtle"}}]
If you want to return the "name" property of the first "show" you would use this notation:
0.show.name
Which will return
The Golden Girls
Explanation:
0 - returns the first object in the returned array
show - returns the show object from the first object in the array
name - returns the name property from the show object
Alternative Approach to Property Notation
The alternative to the notation approach would be to use Full Response to get the entire JSON then use the [PROP()] variable to extract the data elements. Store the Full Response into a field (for example 'FULLREST') then use PROP on that field.
[PROP([FULLREST]|0|show|name)]