Hello all,
Imagine I'd want to create a RESTfull API as part of my MODX website. I'd like to allow, for example, a mobile application to query some of the content from my MODX database. I've found the post on the RTFM pages concerning the option to do so
https://docs.modx.com/revolution/2.x/developing-in-modx/advanced-development/developing-rest-servers
The question that comes to my mind is a matter of authentication. In the example on the above mentioned page I found the following code:
if (!$rest->checkPermissions()) {
$rest->sendUnauthorized(true);
}
Now how in the world could I get my mobile application to authenticate against the MODX api? Can I create a login API to which I can send a request with a password and username and get a token (or whatever is stored in the session after loggin in using the regular flow) in return?