1.In this example, we will use the REST Call function to post new details from Thereforeā¢ on to the web service. Begin the process by creating a Call REST Service workflow task within a workflow.
2.Set the request type (to either GET, POST, PUT, DELETE or PATCH depending on the instruction), in this example, we will use the POST type.
|
Note:
•In the resource URL field, macros can be used to create more flexibility in sending and receiving information to the web service.
•If it is necessary to set parameters as part of the REST Call, these can be defined in the Parameters tab within the above dialog.
•Multiple REST Calls can be carried out with one Call REST Service task. This way, variables can be saved and credentials only have to be entered once. An example on how to utilize this feature can be found in the Additional Resources: https://therefore.net/help/Online/en-us/AR/conn_md365_bc_cpi.html |
3.Complete the details requires in the Authorization tab in order to authorize the application against the external system. In this example, we are using the OAuth (Authorization Code).
4.Then define any additional headers that are required from the call within the Header tab. Click the Add... button to define additional headers. In this example, we only require an 'Accept' header where we are asking the web service that we would like a json to be returned instead of an xml.
5.In the Body section, a structure needs to be defined for which the new document will be based. In this example. fields within the document can be populated by index data values.
6.In the Status Codes section, define the codes that indicate a successful outcome. If the call provides a successful outcome, then the workflow instance can be routed to the next task.
7.Then define the Response Handling information in order to arrange how current information is updated based on the response of the REST Call. In this example, the newly created document's "Bill Id" will be included in the index data of Thereforeā¢ (under InvoiceId and Invoice No).
|
Note:
Before processing a workflow, click the Test button to check that the REST Call Function can communicate with the web service's API for the defined actions.
|
8.Once all the required information has been included, click OK. At this point, the actual workflow instance can be initiated.
|
Note: REST calls were designed for making outgoing calls to 3rd party applications. Although itās possible to use REST calls to call the Therefore API, to solve advanced requirements, the feature is limited especially when working with index data information.
|
|