Forum Discussion

IBK's avatar
IBK
New Contributor III
4 months ago

REST API data push into OneStream. How can we create a custom response back to the calling system

Another system on the network is pushing data into OneStream using a REST API. OneStream has a DataManagement group and a step to absorb this data. Is there a way we can pass back a custom response to the calling system?

 

Thank You for all your help in advance.

Indu

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    If you want to send back an error message, you could wrap your sequence into an Extender rule; on failure, you throw the exception with a message and *I think* this will be returned by the API call. The job will appear as failed though.

    If instead you want to return some extra info on success, I think you will need to implement a polling system. One way to do that would be to build a Data Adapter that launches a Dashboard DataSet rule, which will return the necessary info; and then execute that from the endpoint api/DataProvider/GetAdoDataSetForAdapter . This rule will have to be smart enough to figure out when the job is completed (by querying either Task Activity, or Error Log, or the data itself), and return some "in progress" data if it's not. The client will just keep polling GetAdoDataSetForAdapter as long as necessary.

  • IBK's avatar
    IBK
    New Contributor III

    Thank You very much.  So the external system will make 2 calls to the OneStream API. 

    One using the Datamanagement Step as it is doing right now and the other will be api/DataProvider/GetAdoDataSetForAdapter to get the extended result from OneStream application.

    Am I summarizing it correctly?

    Thank You,

    Indu