Using PUT and POST functions

-1
Hello,  I had asked a question previously about how to use PUT or POST API methods and although I received positive feedback, I had one remaining question which is how best to call these services.    For example, I need to send data to an external system, but without a call from that external system. Is there a way I can just call the PUT API internally and have it send over to the external system. If so can someone share an example of how this microflow should be constructed?  I have primarily worked with GET and DELETE functions, so this is a bit of a new scenario for me.    Thank you in advance.  
asked
2 answers
0

If your application is sending data to an external service you would need to make sure that external service supports a PUT endpoint for your data. They should have a spec for the data they are expecting. If this is JSON you could create a JSON structure in your Mendix app and build an Export Mapping based on this. You would then use this in your Call REST action in a Microflow to map the data from an entity into the correct structure to PUT to the external service. Make sure you select PUT as the HTTP Method for the Call REST action. Depending on the returned data from this call you may also need an Import Mapping to handle the response from the external service.

https://docs.mendix.com/refguide/call-rest-action/

I hope this makes sense and helps.
 

answered
0

Hi Alexander,

 

First , We should create a rest (post or put) service in the application you are going to receive the data. That service will have an endpoint . You should call that endpoint from the application you are sending the data. When calling that endpoint it will trigger the microflow in the application you are receiving the data. We will receive the data in the httprequest . Create an import import mapping and save the data.
 

Hope this helps :)

answered