Create webservice token using a webservice

Create webservice token using a webservice

by anoop kumar -
Number of replies: 2

Is there any possible webservice in Moodle to create user webservice token for non-admin users by authenticating using admin login or token.

Average of ratings: -
In reply to anoop kumar

Re: Create webservice token using a webservice

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

use login/token.php, it requires username, password and service (a service defined in the Moodle site)

It will return a JSON object containing the user token

More info here: https://docs.moodle.org/dev/Creating_a_web_service_client#How_to_get_a_user_token

Regards, Juan

In reply to Juan Leyva

Re: Create webservice token using a webservice

by anoop kumar -

Thanks for your reply Juan. But what I actually need is, not to get the already generated token, but to generate/create token for a particular user using a webservice request from admin. ie. we will use admin user token in the request.