Use Rest API to receive Token - Mendix Forum

Use Rest API to receive Token

0

Hey guys I´m currently trying to find out how to use  REST API´s in Mendix. 

I want to build a simple GET operation to receive a token. First I tried it by building a microflow and just add a “Call REST service” Action and add following code into the location field: ‘curl -X GET "http://**********/rest/api/***/Token" -H "accept: application/json" ’. It didn’t work. Than I tried to build a published Rest Service (like in the learning path). This didn´t work either for me. 

Please help!

 

 

asked
3 answers
1

There's a learning path for the native REST in Mendix:
https://gettingstarted.mendixcloud.com/link/module/98/lecture/825
As well as documentation that I personally found very handy when I started with it; Consume a REST service:
https://docs.mendix.com/howto7/integration/consume-a-rest-service#1-introduction
And publish a rest service:
https://docs.mendix.com/howto7/integration/publish-rest-service

This documentation is for Mendix 7 btw since you said you were on 7.23
Your question is a bit too undetailed to properly understand where you go wrong with your problem.
Good luck!

answered
0

 

This is my configuration of the REST service but it´s not working, I get this errors when I try to use the microflow: “An error has occurred while handling the request. [User 'Anonymous_50cfa956-9fe2-42a8-b9f8-645f8b937f29' with session id '9d877653-XXXX-XXXX-XXXX-XXXXXXXXb51d' and roles 'Administrator']” and a Client Error.  

answered
0

It looks like you're on the right track using the Call REST service action.

However, you should use http://**********/rest/api/***/Token in the location field and add a header with Key=Accept and Value=application/json

answered