System context on api-client role causes the site admin pages to error

System context on api-client role causes the site admin pages to error

by Lorenzo Arribas -
Number of replies: 0

Hello,


I've set up a moodle installation and configured the web service following the official docs (e.g. https://docs.moodle.org/34/en/Using_web_services).


The API works fine when I create and use a token for the admin user. But I can't get it to work with a dedicated user and a dedicated role. That role has all the capabilities necessary for the functions I want to invoke (as far as I can see).




 However, when I use the dedicated user's token, the API tells me this 



I've read somewhere that the `webservice/rest:use` capability must be set for the system context too. However, when I activate that option here...


This happens: errors (and stacktraces in debug mode) for all site administration pages afterwards:




I'd appreciate some expert help. I wouldn't want to risk using a god-mode user for our API client.

Thank you in advance for your time smile

Average of ratings: -