Forum Discussion

mathieu_cartel's avatar
mathieu_cartel
Icon for OneStream Employee rankOneStream Employee
3 months ago

Returning a success or failure message from DM via REST API

Hi all,

I'm triggering a DM job using the REST API. The job is running a business rule. I handle errors in the BR but I need to actually return the success or failure as a response to the postman request. Right now, I get a success message no matter what happens in the BR.

Thanks in advance!

1 Reply

  • Russell's avatar
    Russell
    New Contributor III

    I'm not sure what you are using to make your RESTAPI call but...

    You can use 2 REST API calls. The first queues the DM job. This will always return success. The second RESTAPI call will query the status of the job. You can loop until success or failure and handle accordingly. Inside the loop you can put the thread to sleep on an interval, so it doesn't tie up system resources.