Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

Re: Example of web services token from external application

$
0
0

by Arshad Syed.  

1. First check in moodle site you have enable WEB services or not

how to enable:

1=>site adm->plugins->web services->overview->click on "Enable web services"-> Enable web services "Mark Checkbox".

2=>site adm->plugins->web services->manage Protocols->Enable (which ever protocol you want).

3=>site adm->plugins->web services-> manage tokens->click Add button->select user you want to give access for APIs-> It will generates token(use for accessing APIs).


How to get token:

https://www.yourmoodle.com/login/token.php?username=USERNAME&password=PASSWORD&service=SERVICESHORTNAME


How to use web services:

http://www.yoursite.com/webservice/rest/server.php?wstoken=7c6b2cba5c27e8eabbb8cd8c69c8e5c0&wsfunction=core_completion_get_activities_completion_status&courseid=7&userid=5&moodlewsrestformat=json;

'header' => "Content-type: application/x-www-form-urlencoded",
'method' => 'POST'


Regards

Arshad Syed

https://www.3esofttech.com/


Viewing all articles
Browse latest Browse all 2361

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>