on-demand release 4.0dev+
[moodle.git] / webservice / upgrade.txt
CommitLineData
106c55fb
DW
1This files describes API changes in /webservice/*
2information provided here is intended especially for developers.
3
4This information is intended for authors of webservices, not people writing webservice clients.
5
c07f15d7
DM
6=== 3.11 ===
7
8* The method webservice::get_user_capabilities() is deprecated now without a replacement. It has been used
9 internally only to populate the list of missing capabilities. That functionality has been improved so that
10 it no longer needs this standalone method.
11
25bc7a3d
DP
12=== 3.10 ===
13
14* The class externallib_advanced_testcase, used in unit tests, has a new function called "configure_filters" to easily configure filters for external functions testing.
15
6a1ad7c6
MN
16=== 3.8 ===
17
18* Ajax calls can now specify a cache key. This allows for better caching capabilities on servers. If a cache key
19 is passed and the web service call does not require the user to be logged in we will attempt to use GET for the
20 request. This allows for things like proxy caching on URLs. The cache key must be changed if we do not want to
21 retrieve what has been cached and want to perform the request again.
cd43240d
JL
22* External function core_webservice_external::get_site_info() now returns the user private access key "userprivateaccesskey".
23 This key could be used for fetching files via the tokenpluginfile.php script instead webservice/pluginfile.php to avoid
24 multiple GET requests that include the WS token as a visible parameter.
20570e5d
JL
25* External function core_webservice_external::get_site_info() now returns a new field "userissiteadmin" indicating if
26 the current user is a site administrator.
6a1ad7c6 27
355c37b8
JL
28=== 3.7 ===
29
30* External function core_webservice_external::get_site_info() now returns the current site theme (for the user).
31
bef5777f
JL
32=== 3.4 ===
33
34* External function core_webservice_external::get_site_info() now returns the calendar type used in the site and
35 by the user in the sitecalendartype and usercalendartype fields.
2c1080ef
MG
36* Implementations of forms for test clients now must follow naming schema: WSFUNCTIONNAME_testclient_form
37 The old naming schema WSFUNCTIONNAME_form caused conflicts with existing classes.
38 New class webservice_test_client_base_form can be used as a base class for such forms.
bef5777f 39
89823b1a
JL
40=== 3.2 ===
41
42* webservice->get_external_functions now returns the external function list ordered by name ASC.
ff092320
JL
43* The filearea optional parameter has been removed from webservice/upload.php.
44 Since Moodle 3.1 all the uploads go to the draft area.
af8b948e 45* external_format_text() function: component, filearea and itemid are now optional parameters.
833be5e4
JL
46 In some contexts those parameteres are not necessary because is not required to do a file rewrite via
47 file_rewrite_pluginfile_urls.
43695b6a 48* External function get_site_info now returns the site course ID. This new field is marked as VALUE_OPTIONAL for backwards compatibility.
69cbe359
JL
49* A new field "privatetoken" has been added to the "external_tokens" table.
50 This private token must be safely stored (or not stored at all) by the client because it will be used in places where a request
51 must be double-checked.
52 This token should not be passed via GET paramaters and it must be transmitted only via https.
53 This token is generated only in login/token.php after the user credential has been confirmed. It can't be generated by admins.
89823b1a 54
638f751a
JP
55=== 3.1 ===
56
633e2643
DP
57* The xmlrpc backend has changed, Zend_XmlRpc has been dropped and there might be slight differences in
58 responses. Fault strings that were generated by Zend_XmlRpc_XXX_Exception exceptions (i.e. 'Method
59 "[methodname]" does not exist') are no longer used which may display a different error message depending
60 on the string returned by the getMessage() method of the thrown exception.
8e2707b9 61* The xmlrpc server is no longer enabled when the Mobile service is activated.
13ae7db2 62* Support for the AMF protocol has been dropped completely.
b5e6ec44 63* As Zend Framework has been removed, the webservice_zend_* classes have also been removed.
f23e9b6b
CB
64* Zend_SOAP has been dropped. The native PHP SoapClient and SoapServer classes are now being used instead. WSDL is now
65 generated by the new class webservice_soap_wsdl. For fault strings, a different error message might be shown depending
66 on the string returned by the getMessage() method of the thrown exception.
67* With Zend_SOAP dropped, moodle_zend_soap_server is now also deprecated.
68* As mentioned in the 2.9 notes, deprecated web service functions have now been removed.
ad1bfe6a
CB
69* Since our new XML-RPC server implementation does not support introspection, it is critical that all clients send
70 parameters in the correct order.
ff092320
JL
71* File uploading to the user private file area via the webservice/upload.php script is not supported anymore.
72 Only uploads to the draft area are allowed.
13ae7db2 73
6ee188b1
DM
74=== 3.0 ===
75
76* WS protocols webservice/myprotocol:use capabilities were defined with a high riskbitmask value
77 when the fact that a user has that capability does not imply any risk, but other capabilities
78 that the user may have do. If your ws protocol does not imply and risk by itself, you can remove the
79 riskbitmask from your $capabilities array in webservice/myprotocol/db/access.php
9748791b
JL
80* New function for formatting external strings: external_format_strings, it should be used as a replacement of format_string in
81 external functions.
82 All the occurrences of format_strings have been replaced with this new function.
6ee188b1 83
3c1aa6fd
DM
84=== 2.9 ===
85
86* The deprecated functions can not be added to services anymore and
87 a debugging message for developers is triggered when viewing an existing
88 services using them. It is recommended to replace calls to the deprecated
89 functions for calls to the proposed replacements. If you are using a moodle
90 mobile app fork, it is recommended to update your customisations on top of
91 the latest moodle mobile app version.
92
93 The web services functions that will be finally deprecated in the next
94 moodle version are:
95 - moodle_course_create_courses
96 - moodle_course_get_courses
97 - moodle_enrol_get_enrolled_users
98 - moodle_enrol_get_users_courses
99 - moodle_enrol_manual_enrol_users
100 - moodle_file_get_files
101 - moodle_file_upload
102 - moodle_group_add_groupmembers
103 - moodle_group_create_groups
104 - moodle_group_delete_groupmembers
105 - moodle_group_delete_groups
106 - moodle_group_get_course_groups
107 - moodle_group_get_groupmembers
108 - moodle_group_get_groups
109 - moodle_message_send_instantmessages
110 - moodle_notes_create_notes
111 - moodle_role_assign
112 - moodle_role_unassign
113 - moodle_user_create_users
114 - moodle_user_delete_users
115 - moodle_user_get_course_participants_by_id
116 - moodle_user_get_users_by_courseid
117 - moodle_user_get_users_by_id
118 - moodle_user_update_users
119 - core_grade_get_definitions
120 - core_user_get_users_by_id
121 - moodle_webservice_get_siteinfo
122
6d28e2cf
JL
123* External function core_webservice_external::get_site_info now returns additional optional fields:
124 - advancedfeatures: Array listing Moodle advanced features and if enabled or not.
125 - usercanmanageownfiles: Whether the my files option is disabled.
126 - userquota: User storage quota.
127 - usermaxuploadfilesize: Files upload size limit.
128
3c1aa6fd 129
e5d48aad
130=== 2.7 ===
131
132* All webservice server.php and simpleserver.php scripts must define('WS_SERVER', true)
133 before including config.php file.
134
135
106c55fb
DW
136=== 2.6 ===
137
138* webservice/upload.php
139Accepts 2 new post parameters to allow uploading of files to a users draft area.
140 - filearea should be either 'private' (default) or 'draft'
141 - itemid unused if the filearea is 'private', for 'draft' it can be the id of a previously
142 created draft area - or 0 which will generate a new draft area for the files.
143