Getting Data Using a REST Operation

  • Updated

Sometimes a rule author will want to access data from external websites that have exposed data through REST-based services. Typically web websites will use REST when they want to have as broad a reach as possible, allowing people to use simple HTTP verbs to manage data.

InRule supports being able to retrieve data through the use of a REST Operation.

This example will use the freely available test OData endpoint at http://services.odata.org/V4/OData/ OData.svc. The test OData endpoint exposes the following EntitySets:

mceclip39.png

For this scenario, we will walk through setting up a connection to this OData endpoint and consume it via business rules.

Adding a REST Service

mceclip40.png

Adding a REST Operation that will query products by rating

Adding a REST Operation that will query products by rating.png

Calling a REST Service using the Execute REST Action function

  1. Select "Execute REST Service" from the Right Click "Add" -> "Actions" menu on a ruleset
  2. Provide an Expression for each input to the REST Operation and assign the result of the call to either a text variable or a text field

Execute Rest Service.png

Looking up a specific value from the Execute REST Action response

mceclip43.png

 

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.