how to direct back to home page after published REST service

0
Hi    A question: how can I direct the user back to the home page after a publised rest service is triggered? More specific to my case: I am sending a request to an endpoint which redirects me to a certain website. I click a button there to authenticate the user and I am redirected to a certain url. This url is configured as an endpoint for a publised rest service. At the end of that microflow, I'd like the user to return back to the home page.   Thanks all.
asked
1 answers
2

You won’t have the Mendix frontend available from microflow in your published REST service so you can’t use a Show Page action to do this.

You do have the $HttpResponse object available in your microflow. What you can do is add a new HttpHeader object associated to the $HttpResponse. In the HttpHeader set the key to be “Location” and the value to be “/”. Return the $HttpResponse at the end of your microflow. When the browser sees the location header it should reload your application from the homepage. If you need it go to a deeplink just replace the “/” with the value of the deeplink.

https://docs.mendix.com/refguide/http-request-and-response-entities/


Hope this helps

answered