<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Using_web_services</id>
	<title>Using web services - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Using_web_services"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Using_web_services&amp;action=history"/>
	<updated>2026-05-06T16:28:55Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Using_web_services&amp;diff=6245&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Using_web_services&amp;diff=6245&amp;oldid=prev"/>
		<updated>2024-10-18T06:47:22Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 06:47, 18 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Using_web_services&amp;diff=6244&amp;oldid=prev</id>
		<title>1&gt;Marycooch: Reverted edits by Marycooch (talk) to last revision by Rwthornton</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Using_web_services&amp;diff=6244&amp;oldid=prev"/>
		<updated>2024-05-01T10:36:26Z</updated>

		<summary type="html">&lt;p&gt;Reverted edits by &lt;a href=&quot;/index.php?title=%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F:%D0%92%D0%BA%D0%BB%D0%B0%D0%B4/Marycooch&quot; title=&quot;Служебная:Вклад/Marycooch&quot;&gt;Marycooch&lt;/a&gt; (&lt;a href=&quot;/index.php?title=%D0%9E%D0%B1%D1%81%D1%83%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5_%D1%83%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA%D0%B0:Marycooch&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Обсуждение участника:Marycooch (страница не существует)&quot;&gt;talk&lt;/a&gt;) to last revision by &lt;a href=&quot;/index.php?title=%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA:Rwthornton&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Участник:Rwthornton (страница не существует)&quot;&gt;Rwthornton&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Web services}}&lt;br /&gt;
This document explains how an administrator can set up a web service for users to access a service. Each user will have a specific and unique security key (also known as a &amp;quot;token&amp;quot;) to access the service.&lt;br /&gt;
== Enabling web services==&lt;br /&gt;
[[Image:Enable_web_service.jpg|thumb|Enabling web services]]&lt;br /&gt;
# Access &amp;#039;&amp;#039;Administration &amp;gt; Site administration &amp;gt; Advanced features&amp;#039;&amp;#039;&lt;br /&gt;
# Check &amp;#039;Enable web services&amp;#039; then click &amp;#039;Save Changes&amp;#039;&lt;br /&gt;
Note: For security reasons, web services should only be enabled if you intend to make use of it.&lt;br /&gt;
== Enabling protocols ==&lt;br /&gt;
[[Image:Enable_protocol.jpg|thumb|left|Enabling protocols]]&lt;br /&gt;
Usually external applications that users wish to use dictate which protocols should be enabled. &lt;br /&gt;
# Access &amp;#039;&amp;#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Web services &amp;gt; Manage protocols&amp;#039;&amp;#039;&lt;br /&gt;
# Enable the protocols (SOAP, REST, XMLRPC, AMF, ...) as required&lt;br /&gt;
&lt;br /&gt;
== Enabling web service function documentation ==&lt;br /&gt;
[[Image:Security keys and documentation.jpg|thumb|Security keys page with documentation link]]&lt;br /&gt;
Enabling web service function documentation (also on the Manage protocols page) results in user-specific web service documentation being available for each user on their [[Security keys]] page. This option is mainly useful to web service client developers. If nobody is creating a web service client, there is no need to enable this feature.&lt;br /&gt;
== Creating a custom external service ==&lt;br /&gt;
If none of the pre-build web services match your needs, you can create a custom service i.e. select which of the standard web service functions are available via that service.&lt;br /&gt;
&lt;br /&gt;
You can enable only the specific functions that you need to expose, so not compromising on security.&lt;br /&gt;
[[Image:Create a service.jpg|thumb|Creating a service|left]]&lt;br /&gt;
# Access &amp;#039;&amp;#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Web services.&amp;#039;&amp;#039;&lt;br /&gt;
# Click Add new custom service&lt;br /&gt;
#* &amp;#039;Authorised users only&amp;#039; - If enabled, you will need to select the authorised users manually. Otherwise all users with appropriate permissions are allowed&lt;br /&gt;
#* &amp;#039;Required capability&amp;#039; - If enabled, any user accessing the web service will be checked against this selected capability. (This is just an additional optional security layer.)&lt;br /&gt;
# Enter a name and check Enabled&lt;br /&gt;
# Click the button &amp;#039;Add service&amp;#039;&lt;br /&gt;
==Adding functions to the service==&lt;br /&gt;
[[Image:Select a web service function.jpg|thumb|Adding functions to the service]]Your service is currently empty and doesn&amp;#039;t do anything. Web service functions need to be added. Your choice will be dictated by what you allow the external application to do. For this example, select &amp;#039;Create group&amp;#039;.&lt;br /&gt;
# Click &amp;#039;Add functions&amp;#039; link&lt;br /&gt;
# Select &amp;#039;create group&amp;#039; function and click the &amp;#039;Add functions&amp;#039; button&lt;br /&gt;
&amp;#039;&amp;#039;Note that deprecated functions can not be added to services although the ones that are already part of a service can remain there until they are removed from Moodle codebase.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
You should be back to the service functions list. &amp;#039;Required capabilities&amp;#039; are indicated for each function. Users need the required capabilities to run a function. The function descriptions in the API Documentation can also give you more information about the required capabilities (&amp;#039;&amp;#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Web services &amp;gt; API Documentation&amp;#039;&amp;#039;).&lt;br /&gt;
&lt;br /&gt;
==Enabling capabilities==&lt;br /&gt;
The final step is to grant appropriate permissions. The following capabilities should be allowed:&lt;br /&gt;
* [[Capabilities/moodle/webservice:createtoken|moodle/webservice:createtoken]] - for allowing users to generate a security key&lt;br /&gt;
* [[Capabilities/webservice/rest:use|webservice/rest:use]], [[Capabilities/webservice/soap:use|webservice/soap:use]], [[Capabilities/webservice/xmlrpc:use|webservice/xmlrpc:use]], [[Capabilities/webservice/amf:use|webservice/amf:use]] which match the enabled protocols.&lt;br /&gt;
* The service &amp;#039;&amp;#039;Required capability&amp;#039;&amp;#039; if set (&amp;#039;&amp;#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Web services &amp;gt; Manage services &amp;gt;&amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; link&amp;#039;&amp;#039;).&lt;br /&gt;
* The required capabilities for the web service functions. These required capabilities are listed when you add a function to the service. For more information about roles and capabilities, read the [[Manage roles]] documentation.&lt;br /&gt;
Once done, the web service should be set up. Users should be able to [[Security keys|obtain a personal security key]].&lt;br /&gt;
&lt;br /&gt;
= Alternative settings =&lt;br /&gt;
== Authorise only specific users==&lt;br /&gt;
[[Image:Authorised users link.jpg|thumb]] [[Image:Authorised user selection page.jpg|thumb]]&lt;br /&gt;
# &amp;#039;&amp;#039;Administration &amp;gt; Site Administration &amp;gt; Server &amp;gt; Web services &amp;gt; External Services&amp;#039;&amp;#039;&lt;br /&gt;
# Select &amp;#039;&amp;#039;&amp;#039;Authorised users&amp;#039;&amp;#039;&amp;#039; link (the service must have been set as &amp;#039;&amp;#039;&amp;#039;Authorised users only&amp;#039;&amp;#039;&amp;#039; in the &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; link)&lt;br /&gt;
# Select some users and click &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Moodle indicates if some capabilities need to be assigned to an authorised user. Moreover, if you click on the authorised user fullname, you can set up some specific options: &amp;#039;&amp;#039;IP restriction&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Valid until&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Create a token  ==&lt;br /&gt;
[[Image:Create_token.jpg|thumb]]&lt;br /&gt;
This feature allows you to create a token for specific user. It can be useful if a user doesn&amp;#039;t have the moodle/create:token capability. This is also the only way to create a token for an administrator. For security reason, tokens are not automatically generated in the administrator security keys page.&lt;br /&gt;
# &amp;#039;&amp;#039;Administration &amp;gt; Site Administration &amp;gt; Server &amp;gt; Web services &amp;gt; Manage tokens&amp;#039;&amp;#039;&lt;br /&gt;
# Click on &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Select the created user and service&lt;br /&gt;
# Click on &amp;#039;&amp;#039;&amp;#039;Saves changes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
As you created a token for this user, you do not need to assign &amp;quot;&amp;#039;&amp;#039;moodle/webservice:createtoken&amp;#039;&amp;#039;&amp;quot; to him/her.&lt;br /&gt;
Finally, note that, as for authorised users, you can also set &amp;#039;&amp;#039;IP restriction&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Valid until&amp;#039;&amp;#039; on a token.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[http://www.joomdle.com/wiki/Preparing_Moodle_20#Setting_up_Moodle_Web_services Joomdle documentation about setting Moodle web services]&lt;br /&gt;
[[de:Webservices nutzen]]&lt;br /&gt;
[[fr:Utilisation des services Web]]&lt;br /&gt;
[[ja:ウェブサービスを使用する]]&lt;/div&gt;</summary>
		<author><name>1&gt;Marycooch</name></author>
	</entry>
</feed>