REST API BR for data being pushed into OneStream

IBK
New Contributor III

Hello,

I have a REST API which has been tested in POSTMAN. The problem is data is being pushed into OneStream. So how would this work in the BR. Any help would be appreciated.

 

Thank You,

Indu

4 REPLIES 4

js11
New Contributor II

Hello, you can't actually "push" data into OneStream. When you say you "have a REST API", are you referring to an External REST API? I assume so, but just wanted to check. Assuming this is an external REST API, you can use the HttpClient class which is part of the System.Net.Http namespace from within a business rule to "pull" the data from your REST endpoint. This would typically be done from a Connector Business Rule. You would then parse the response into a DataTable and then use api.Parser.ProcessDataTable to process the data into a OneStream workflow.

IBK
New Contributor III

Hi Stephens. Thank you for your quick response. So it always is a pull and a push into OneStream is not possible. It is an external API ,  So the sequence of events would be:

1. The external API will invoke the BR in OneStream through DataManagement/DataSequence

2. Then BR goes out to the external Api and pulls the data from the REST API.

3. Parse the json response into a datatable.

Am I missing something?

 

Thank You,

Indu

 

 

 

js11
New Contributor II

Hi Indu,

That is correct. You can trigger the process using the OneStream REST API to trigger the DM job.

If you are trying to automate a workflow import, I would recommend using the Batch Harvest process where you would place trigger files (empty files) into the batch harvest directory on the file share which are named with the workflow, scenario, and period (see batch harvest in the design and reference guide for batch harvest naming conventions). Then from the Extensibility Business Rule, you can execute the Batch Harvest engine which will run the workflows. As each workflow runs, it will use a Connector Business rule which will then perform your steps 2 and 3 above, reaching out to the external API, parsing the data into a data table and passing it to the parser.

If you are automating some other type of data load, then it would all be done within the Extensibility Business Rule and would not involve workflows.

Hope this helps!

IBK
New Contributor III

Thank You js11 . Thank You . The trigger of the REST Api happens from the external system if that is possible. 

The whole idea is when something gets updated in the external system they want to pass it to Onstream and update it. I am not sure how feasible it is to do one record at a time. 

Thank You,

Indu