What is the correct way to catch DB changes from API actions?

Thanks for the info @Sergey_Androsov ,

The problem with this one (the Create Order service) is that after I return the response back to the invoker of the API, I need to branch to a HTTPS POST call to a foreign API, but the results of THIS call (which I’m assuming is the error) are being returned to the caller instead of what I’m actually trying to return: (the “SOSPostObject”).

Here’s the error that I get when I try this: (Triggered by the HTTPS POST call in the POST to SOS API function)

Wed Aug 14 2024 10:03:54 GMT-0400 (Eastern Daylight Time) | SERVER_CODE | ERROR | [1843458] Error:

## Object moved to [here](https://develop.backendless.com/error.aspx?status=HYbB5vm9hJPmFvTGq3cdGjfzxNqYhDqwsANSPNpHdw9JThVINObXDQ%3d%3d).

at checkStatus (/usr/local/lib/node_modules/backendless-coderunner/node_modules/backendless-request/lib/request.js:343:9) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I’m not sure what the correct way to accomplish this is.

In other words, I need to POST to another API AFTER the record is created in the DB by this service, and still return the proper response of the newly created object back to the caller of the API.

Steps:
#1 : Create the new record in the DB
#2 : Return the newly created object back to the API invoker
#3 : Make a separate call to the foreign API and simply write the results of the call to the RT Logs.

Mike