Trigger exposed rest api to all the consumers.
Question

Hi All,


Can anyone let me know, how can I trigger an Outsystems exposed API to all the consumers of this exposed API.

This should be triggered from the respective outsystems application to all the applications consuming this api.

Any ideas welcome.


Thanks,

Hello @Roshan Gupta , what you mean about trigger?  Can you give another example?

Regards,

Márcio C.


Thanks Marcio for the quick response.


What my requirement is, in my core module i have exposed a rest api.

I am fetching data from one of my entities in this api.

Now when ever there is change in this database entity, a record is added or updated.

This api should be invoked wherever this it is consumed, and reflect the changes wherever it is consumed.


Now is it a bit clear?


Thanks

Hello @Roshan, 

I guess you want something like if you make some changes, the web service should trigger that change to all the consumers. Am I correct?

In such a case, you need to create the web service on the consumers' side. And call it on the producer module so the changes can be communicated to the target machine. 


Kind regards 

Divya Nayak


You got this correct.

Thanks for the Suggestion, nice one.

But any other way round, without involving the consumer into this ?

Through producer module itself.


Thanks


Actually in your case, if you want to communicate through the web service, you should be knowing the target machine. But if you expose the service in producer, you won't be having.

I believe service action can help you as well.

Service action: In OutSystems, a Service Action is a REST-based remote call to another process, but its usage is very similar to public Server Actions. Exposing a Service Action generates a weak dependency from the consumer to the producer module, in a loosely coupled way.

I hope this helps you

Thanks Divya, will check and update if this works :)


Any Updates, how you have fulfilled the requirement.
It will be helpful for the rest of the people if they come across such a case.


Hello Roshan Gupta,

Could you please tell me what action your service is performing ? Is that service used for data syncing ?

Whatever Divya has mentioned that´s right. But if it´s really needed, you can set the timer at the producer end and periodically call your service within that timer. But be cautious, this will add overhead on performance due to unnecessary calls ! The same can be done from target machine too ! Take your call wisely.

Another workaround could be to have BPT set up for the specific entity and based on the create\update of that specific field, you can execute your api call.

But above suggestions, totally depends on what action you want to execute through your service.

Thanks,

Vani

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.