Project

General

Profile

Web services » History » Version 9

Yannick Warnier, 30/06/2010 06:02

1 6 Yannick Warnier
h1. Web services
2
3 2 Yannick Warnier
{{>toc}}
4 3 Yannick Warnier
5 6 Yannick Warnier
h2. Chamilo > 1.8.7
6 1 Yannick Warnier
7 6 Yannick Warnier
The following documentation gives a complete description of the behaviour of the Chamilo Web Services.
8
We use SOAP as a Web Service application protocol (although it would be easy to extend to other protocols). As such, all communication should be sent using SOAP headers and received using a SOAP parser.
9
10
The 'secret_key' is a mandatory parameter to connect to the web services. It is composed of the $_configuration['secret_key'] value inside of the LMS's main/inc/conf/configuration.php file (which can be changed, it is only used for web services at the time of writing) and the IP address of the caller.
11
12
For example, if I am calling the webservice from an IP address of 134.23.25.34, I will have to generate an SHA1 encrypted string from this IP addess with the secret key. This can be done for example, in PHP, through the command:
13
<pre>$security_key = 'abcdef1234567890';
14
$ip_address = '134.23.25.34';
15
$secret_key = sha1($ip_address.$security_key);</pre>
16
17
The $secret_key variable must then be added to the Web Service call.
18
19
Calling the SOAP web services scripts is generally done through a URL of this kind:
20
http://campus.chamilo.org/main/webservices/soap.php. You can check the list of available functions through a call to http://campus.chamilo.org/main/webservices/soap.php?wsdl
21
22
You can check how your IP is detected by the server, calling the http://campus.chamilo.org/main/webservices/testip.php script. The first line can be cut
23
and used as the IP address to put in the $ip_address variable above (just remove the end-of-line character at the end of the first line).
24
25 8 Yannick Warnier
h3. External identifiers
26
27
For most Web Services provided, an identifier and a value are expected by Chamilo. For example, if you import your users from an Oracle database, you might use a unique ID coming from the *LUSERID* field and worth *1504*. When calling Chamilo, we assume you will give us the user ID as you know it in *your* system. That is, we expect you'll give us *LUSERID* as the *user_id_field_name* parameter, and *1504* as the *user_id_value*.
28
29
When you do that, Chamilo is able to find, inside its database, which user you are referencing, because Chamilo kept this reference at the time of calling.
30
31 6 Yannick Warnier
h3. WSUser.DisableUser
32
33
Disables one user
34 1 Yannick Warnier
35 8 Yannick Warnier
h4. Input
36
37 1 Yannick Warnier
<pre>
38 8 Yannick Warnier
array(
39
 'secret_key' => 'abcdef1234567890',
40
 'user_id_field_name' => 'external_user',
41
 'user_id_value' => '1504',
42
);
43 1 Yannick Warnier
</pre>
44
45 8 Yannick Warnier
h4. Output
46
47 6 Yannick Warnier
<pre>
48 8 Yannick Warnier
nothing (or error message)
49 6 Yannick Warnier
</pre>
50
51
h3. WSUser.DisableUsers
52 1 Yannick Warnier
53
Disables several users in one call.
54 6 Yannick Warnier
55 8 Yannick Warnier
h4. Input
56
57 1 Yannick Warnier
<pre>
58 8 Yannick Warnier
array(
59
'secret_key' => 'abcdef1234567890',
60
 array( 
61
  0=>array('user_id_field_name' => 'external_user', 'user_id_value' => '1504'),
62
  1=>array('user_id_field_name' => 'external_user', 'user_id_value' => '1582'),
63
 )
64
);
65 6 Yannick Warnier
</pre>
66 1 Yannick Warnier
67 8 Yannick Warnier
h4. Output
68
69 1 Yannick Warnier
<pre>
70 8 Yannick Warnier
array(
71
  0=>array('code'=>0,'message'=>'Operation was successful'),
72
  1=>array('code'=>0,'message'=>'Operation was successful'),
73
);
74 6 Yannick Warnier
</pre>
75
76
h3. WSUser.EnableUser
77
78 7 Yannick Warnier
Enables one user
79 6 Yannick Warnier
80 9 Yannick Warnier
h4. Input
81
82 1 Yannick Warnier
<pre>
83 9 Yannick Warnier
array(
84
 'secret_key' => 'abcdef1234567890',
85
 'user_id_field_name' => 'external_user',
86
 'user_id_value' => '1504',
87
);
88 1 Yannick Warnier
</pre>
89
90 9 Yannick Warnier
h4. Output
91
92 6 Yannick Warnier
<pre>
93 9 Yannick Warnier
nothing (or error message)
94 7 Yannick Warnier
</pre>
95 6 Yannick Warnier
96 7 Yannick Warnier
h3. WSUser.EnableUsers
97 1 Yannick Warnier
98
Enables several users in one call.
99 6 Yannick Warnier
100 9 Yannick Warnier
h4. Input
101
102 1 Yannick Warnier
<pre>
103 9 Yannick Warnier
array(
104
'secret_key' => 'abcdef1234567890',
105
 array( 
106
  0=>array('user_id_field_name' => 'external_user', 'user_id_value' => '1504'),
107
  1=>array('user_id_field_name' => 'external_user', 'user_id_value' => '1582'),
108
 )
109
);
110 6 Yannick Warnier
</pre>
111 1 Yannick Warnier
112 9 Yannick Warnier
h4. Output
113
114 1 Yannick Warnier
<pre>
115 9 Yannick Warnier
array(
116
  0=>array('code'=>0,'message'=>'Operation was successful'),
117
  1=>array('code'=>0,'message'=>'Operation was successful'),
118
);
119 7 Yannick Warnier
</pre>
120 1 Yannick Warnier
121
h3. WSUser.DeleteUser
122 6 Yannick Warnier
123 1 Yannick Warnier
Deletes one user
124
125 9 Yannick Warnier
h4. Input
126
127 1 Yannick Warnier
<pre>
128 9 Yannick Warnier
array(
129
 'secret_key' => 'abcdef1234567890',
130
 'user_id_field_name' => 'external_user',
131
 'user_id_value' => '1504',
132
);
133 6 Yannick Warnier
</pre>
134
135 9 Yannick Warnier
h4. Output
136
137 7 Yannick Warnier
<pre>
138 9 Yannick Warnier
nothing (or error message)
139 1 Yannick Warnier
</pre>
140 6 Yannick Warnier
141 1 Yannick Warnier
h3. WSUser.DeleteUsers
142
143
Deletes several users in one call
144
145 9 Yannick Warnier
h4. Input
146
147 1 Yannick Warnier
<pre>
148 9 Yannick Warnier
array(
149
'secret_key' => 'abcdef1234567890',
150
 array( 
151
  0=>array('user_id_field_name' => 'external_user', 'user_id_value' => '1504'),
152
  1=>array('user_id_field_name' => 'external_user', 'user_id_value' => '1582'),
153
 )
154
);
155 1 Yannick Warnier
</pre>
156 6 Yannick Warnier
157 9 Yannick Warnier
h4. Output
158
159 6 Yannick Warnier
<pre>
160 9 Yannick Warnier
array(
161
  0=>array('code'=>0,'message'=>'Operation was successful'),
162
  1=>array('code'=>0,'message'=>'Operation was successful'),
163
);
164 1 Yannick Warnier
</pre>
165
166
h3. WSUser.CreateUser
167
168
Creates one user
169
170 9 Yannick Warnier
h4. Input
171
172 1 Yannick Warnier
<pre>
173 9 Yannick Warnier
array(
174
'secret_key' => 'xsd:string',
175
'firstname' => 'xsd:string',
176
'lastname' => 'xsd:string',
177
'status' => 'xsd:int',
178
'loginname' => 'xsd:string',
179
'password' => 'xsd:string',
180
'encrypt_method' => 'xsd:string',
181
'user_id_field_name' => 'xsd:string',
182
'user_id_value' => 'xsd:string',
183
'visibility' => 'xsd:int',
184
'email' => 'xsd:string',
185
'language' => 'xsd:string',
186
'phone' => 'xsd:string',
187
'expiration_date' => 'xsd:string',
188
'extras' => 'tns:extra_field[]'
189
);
190 6 Yannick Warnier
</pre>
191 1 Yannick Warnier
192 9 Yannick Warnier
h4. Output
193
194 1 Yannick Warnier
<pre>
195 9 Yannick Warnier
int new_user_id
196 1 Yannick Warnier
</pre>
197
198
h3. WSUser.CreateUsers
199
200
Creates several users in one call.
201
202 9 Yannick Warnier
h4. Input
203
204 1 Yannick Warnier
<pre>
205 9 Yannick Warnier
array(
206
 'secret_key' => 'xsd:string',
207
 array(
208
  0 => array(
209
   'firstname' => 'xsd:string',
210
   'lastname' => 'xsd:string',
211
   'status' => 'xsd:int',
212
   'loginname' => 'xsd:string',
213
   'password' => 'xsd:string',
214
   'encrypt_method' => 'xsd:string',
215
   'user_id_field_name' => 'xsd:string',
216
   'user_id_value' => 'xsd:string',
217
   'visibility' => 'xsd:int',
218
   'email' => 'xsd:string',
219
   'language' => 'xsd:string',
220
   'phone' => 'xsd:string',
221
   'expiration_date' => 'xsd:string',
222
   'extras' => 'tns:extra_field[]'
223
  ),
224
  1 => array(
225
   'firstname' => 'xsd:string',
226
   'lastname' => 'xsd:string',
227
   'status' => 'xsd:int',
228
   'loginname' => 'xsd:string',
229
   'password' => 'xsd:string',
230
   'encrypt_method' => 'xsd:string',
231
   'user_id_field_name' => 'xsd:string',
232
   'user_id_value' => 'xsd:string',
233
   'visibility' => 'xsd:int',
234
   'email' => 'xsd:string',
235
   'language' => 'xsd:string',
236
   'phone' => 'xsd:string',
237
   'expiration_date' => 'xsd:string',
238
   'extras' => 'tns:extra_field[]'
239
  )
240
 )
241
);
242 1 Yannick Warnier
</pre>
243
244 9 Yannick Warnier
h4. Output
245
246 1 Yannick Warnier
<pre>
247 9 Yannick Warnier
array(
248
 0 => array(
249
  'result' => 'xxx',
250
  'user_id_value' => 1504,
251
  'user_id_generated' => 1
252
 ),
253
 1 => array(
254
  'result' => 'xxx',
255
  'user_id_value' => 1504,
256
  'user_id_generated' => 1
257
 ),
258
);
259 6 Yannick Warnier
</pre>
260
261
h3. WSUser.EditUser
262
263 7 Yannick Warnier
Edits one user
264 1 Yannick Warnier
265 9 Yannick Warnier
h4. Input
266
267 7 Yannick Warnier
<pre>
268 1 Yannick Warnier
</pre>
269
270 9 Yannick Warnier
h4. Output
271
272 6 Yannick Warnier
<pre>
273 1 Yannick Warnier
</pre>
274 6 Yannick Warnier
275
h3. WSUser.EditUsers
276
277 1 Yannick Warnier
Edits several users in one call.
278
279 9 Yannick Warnier
h4. Input
280
281 1 Yannick Warnier
<pre>
282
</pre>
283 6 Yannick Warnier
284 9 Yannick Warnier
h4. Output
285
286 1 Yannick Warnier
<pre>
287 6 Yannick Warnier
</pre>
288
289 9 Yannick Warnier
290 1 Yannick Warnier
h3. WSCourse.DeleteCourse
291
292 6 Yannick Warnier
Deletes one course
293 7 Yannick Warnier
294 9 Yannick Warnier
h4. Input
295
296 6 Yannick Warnier
<pre>
297 7 Yannick Warnier
</pre>
298 6 Yannick Warnier
299 9 Yannick Warnier
h4. Output
300
301 6 Yannick Warnier
<pre>
302
</pre>
303 1 Yannick Warnier
304 9 Yannick Warnier
305 6 Yannick Warnier
h3. WSCourse.DeleteCourses
306
307 1 Yannick Warnier
Deletes several courses in one call.
308
309 9 Yannick Warnier
h4. Input
310
311 7 Yannick Warnier
<pre>
312 1 Yannick Warnier
</pre>
313 6 Yannick Warnier
314 9 Yannick Warnier
h4. Output
315
316 1 Yannick Warnier
<pre>
317
</pre>
318 6 Yannick Warnier
319 9 Yannick Warnier
320 1 Yannick Warnier
h3. WSCourse.CreateCourse
321
322 6 Yannick Warnier
Creates one course
323 7 Yannick Warnier
324 9 Yannick Warnier
h4. Input
325
326 7 Yannick Warnier
<pre>
327 6 Yannick Warnier
</pre>
328
329 9 Yannick Warnier
h4. Output
330
331 6 Yannick Warnier
<pre>
332
</pre>
333 1 Yannick Warnier
334 9 Yannick Warnier
335 6 Yannick Warnier
h3. WSCourse.CreateCourses
336
337
Creates several courses in one call.
338 1 Yannick Warnier
339 9 Yannick Warnier
h4. Input
340
341 7 Yannick Warnier
<pre>
342 1 Yannick Warnier
</pre>
343
344 9 Yannick Warnier
h4. Output
345
346 1 Yannick Warnier
<pre>
347
</pre>
348 6 Yannick Warnier
349 9 Yannick Warnier
350 6 Yannick Warnier
h3. WSCourse.EditCourse
351 1 Yannick Warnier
352 6 Yannick Warnier
Edits one course
353
354 9 Yannick Warnier
h4. Input
355
356 1 Yannick Warnier
<pre>
357 6 Yannick Warnier
</pre>
358
359 9 Yannick Warnier
h4. Output
360
361 6 Yannick Warnier
<pre>
362 7 Yannick Warnier
</pre>
363 6 Yannick Warnier
364 9 Yannick Warnier
365 7 Yannick Warnier
h3. WSCourse.ListCourses
366 6 Yannick Warnier
367
Lists courses
368 1 Yannick Warnier
369 9 Yannick Warnier
h4. Input
370
371 6 Yannick Warnier
<pre>
372 1 Yannick Warnier
</pre>
373
374 9 Yannick Warnier
h4. Output
375
376 6 Yannick Warnier
<pre>
377 1 Yannick Warnier
</pre>
378 6 Yannick Warnier
379 9 Yannick Warnier
380 7 Yannick Warnier
h3. WSCourse.SubscribeUserToCourse
381 1 Yannick Warnier
382
Subscribes one user to one course
383 6 Yannick Warnier
384 9 Yannick Warnier
h4. Input
385
386 1 Yannick Warnier
<pre>
387 6 Yannick Warnier
</pre>
388
389 9 Yannick Warnier
h4. Output
390
391 6 Yannick Warnier
<pre>
392
</pre>
393
394 9 Yannick Warnier
395 1 Yannick Warnier
h3. WSCourse.UnsubscribeUserFromCourse
396 6 Yannick Warnier
397
Unsubscribes one user from one course.
398 1 Yannick Warnier
399 9 Yannick Warnier
h4. Input
400
401 7 Yannick Warnier
<pre>
402 6 Yannick Warnier
</pre>
403 1 Yannick Warnier
404 9 Yannick Warnier
h4. Output
405
406 6 Yannick Warnier
<pre>
407 1 Yannick Warnier
</pre>
408
409 9 Yannick Warnier
410 6 Yannick Warnier
h3. WSCourse.GetCourseDescriptions
411 1 Yannick Warnier
412
Gets the list of course descriptions.
413 6 Yannick Warnier
414 9 Yannick Warnier
h4. Input
415
416 1 Yannick Warnier
<pre>
417 6 Yannick Warnier
</pre>
418
419 9 Yannick Warnier
h4. Output
420
421 1 Yannick Warnier
<pre>
422 6 Yannick Warnier
</pre>
423 7 Yannick Warnier
424 9 Yannick Warnier
425 1 Yannick Warnier
h3. WSCourse.EditCourseDescription
426 6 Yannick Warnier
427
Edits one description of one course.
428
429 9 Yannick Warnier
h4. Input
430
431 6 Yannick Warnier
<pre>
432
</pre>
433 1 Yannick Warnier
434 9 Yannick Warnier
h4. Output
435
436 6 Yannick Warnier
<pre>
437 1 Yannick Warnier
</pre>
438
439 9 Yannick Warnier
440 7 Yannick Warnier
h3. WSSession.CreateSession
441 6 Yannick Warnier
442 1 Yannick Warnier
Creates one session.
443 7 Yannick Warnier
444 9 Yannick Warnier
h4. Input
445
446 1 Yannick Warnier
<pre>
447
</pre>
448 6 Yannick Warnier
449 9 Yannick Warnier
h4. Output
450
451 1 Yannick Warnier
<pre>
452 6 Yannick Warnier
</pre>
453
454 9 Yannick Warnier
455 1 Yannick Warnier
h3. WSSession.DeleteSession
456 6 Yannick Warnier
457
Deletes one session.
458 7 Yannick Warnier
459 9 Yannick Warnier
h4. Input
460
461 6 Yannick Warnier
<pre>
462 7 Yannick Warnier
</pre>
463 1 Yannick Warnier
464 9 Yannick Warnier
h4. Output
465
466 6 Yannick Warnier
<pre>
467
</pre>
468 1 Yannick Warnier
469 9 Yannick Warnier
470 6 Yannick Warnier
h3. WSSession.EditSession
471
472 1 Yannick Warnier
Edits one session.
473
474 9 Yannick Warnier
h4. Input
475
476 1 Yannick Warnier
<pre>
477
</pre>
478 6 Yannick Warnier
479 9 Yannick Warnier
h4. Output
480
481 1 Yannick Warnier
<pre>
482 7 Yannick Warnier
</pre>
483 6 Yannick Warnier
484 9 Yannick Warnier
485 1 Yannick Warnier
h3. WSSession.SubscribeUserToSession
486
487 6 Yannick Warnier
Subscribes one user to one session.
488
489 9 Yannick Warnier
h4. Input
490
491 6 Yannick Warnier
<pre>
492
</pre>
493
494 9 Yannick Warnier
h4. Output
495
496 7 Yannick Warnier
<pre>
497 6 Yannick Warnier
</pre>
498 7 Yannick Warnier
499 9 Yannick Warnier
500 6 Yannick Warnier
h3. WSSession.UnsubscribeUserFromSession
501
502
Unsubscribes one user from one session
503
504 9 Yannick Warnier
h4. Input
505
506 6 Yannick Warnier
<pre>
507
</pre>
508 7 Yannick Warnier
509 9 Yannick Warnier
h4. Output
510
511 6 Yannick Warnier
<pre>
512
</pre>
513
514 9 Yannick Warnier
515 6 Yannick Warnier
h3. WSSession.SubscribeCourseToSession
516
517
Subscribes one course to one session.
518
519 9 Yannick Warnier
h4. Input
520
521 6 Yannick Warnier
<pre>
522 7 Yannick Warnier
</pre>
523 6 Yannick Warnier
524 9 Yannick Warnier
h4. Output
525
526 6 Yannick Warnier
<pre>
527
</pre>
528
529 9 Yannick Warnier
530 6 Yannick Warnier
h3. WSSession.UnsubscribeCourseFromSession
531
532 7 Yannick Warnier
Unsubscribes one course from one session
533 6 Yannick Warnier
534 9 Yannick Warnier
h4. Input
535
536 6 Yannick Warnier
<pre>
537
</pre>
538
539 9 Yannick Warnier
h4. Output
540
541 6 Yannick Warnier
<pre>
542
</pre>
543
544
545 1 Yannick Warnier
546 5 Yannick Warnier
h2. Chamilo <= 1.8.7: registration.soap.php
547 1 Yannick Warnier
548
The following documentation gives a complete description of the behaviour of the Chamilo Web Services. These services will have been renamed after Chamilo 1.8.7 to use a more neutral naming convention (starting with WS directly instead of using a platform-specific name).
549
550
We use SOAP as a Web Service application protocol. As such, all communication should be sent using SOAP headers and received using a SOAP parser.
551
552
In order to connect to the web services, one mandatory field is the 'secret_key', which is composed of the $_configuration['secret_key'] value inside of the LMS's main/inc/conf/configuration.php file (which can be changed, it is only used for web services at the time of writing) and the IP address of the caller.
553
554
For example, if I am calling the webservice from an IP address of 134.23.25.34, I will have to generate an SHA1 encrypted string from this IP addess with the secret key. This can be done for example, in PHP, through the command:
555 2 Yannick Warnier
<pre>$security_key = 'abcdef1234567890';
556 1 Yannick Warnier
$ip_address = '134.23.25.34';
557 2 Yannick Warnier
$secret_key = sha1($ip_address.$security_key);</pre>
558 1 Yannick Warnier
559 2 Yannick Warnier
The $secret_key variable must then be added to the Web Service call.
560
561 1 Yannick Warnier
Calling the SOAP web services scripts is generally done through a URL of this kind:
562 2 Yannick Warnier
http://campus.chamilo.org/main/webservices/registration.soap.php. You can check the list of available functions through a call to http://campus.chamilo.org/main/webservices/registration.soap.php?wsdl
563
564
You can check how your IP is detected by the server, calling the http://campus.chamilo.org/main/webservices/testip.php script. The first line can be cut
565
and used as the IP address to put in the $ip_address variable above (just remove the end-of-line character at the end of the first line).
566
567
h3. DokeosWSCreateUsers
568 3 Yannick Warnier
569 1 Yannick Warnier
This function adds users into dokeos/chamilo, the password param is not encrypted
570
Input params
571
Follow the new structure:
572 4 Yannick Warnier
<pre>$params = array(
573 1 Yannick Warnier
         'users' =>array(          // array of users params, you can create many users
574
passing arrays of params
575
                array('firstname' => 'Christian',           //required
576
                       'lastname' => 'XXX',                 //required
577
                       'status' => '5', //required, (1 => teacher, 5 => learner)
578
                       'email' => 'XXX@gmail.dom',
579
                              //optional, follow the same format (example@domain.com)
580
                       'loginname' => 'usuario1',           //required
581
                       'password' => '12345',               //required
582
                       'language' => 'spanish',             //optional
583
                       'phone' => '12345678',               //optional
584
                      'expiration_date' => '0000-00-00 00:00:00',
585
                            //optional, follow the same format
586
                      'original_user_id_name' => 'USER',
587
                            //required, field name about original user id
588
                      'original_user_id_value' => '1',
589
                            //required, field value about original user id
590
                      'extra' => array (
591
                            //optional, extra fields about user's extras data,
592
                            //you can insert several extra fields
593
                            array('field_name' => 'direccion',
594
                                   'field_value' => 'Arquimedes 260'),
595
                                   // field name with your field value
596
                            array('field_name' => 'DNI',
597
                                   'field_value' => '416766220')
598
                                   // field name with your field value
599
                      )
600
              )
601
       ),
602
       'secret_key' => sha1('123')
603
       //required, secret key ("your IP address and security key from dokeos")
604
       // encrypted with sha1
605 4 Yannick Warnier
);</pre>
606 1 Yannick Warnier
Output params
607
The results are shown like follow structure:
608 4 Yannick Warnier
<pre>       array (
609 1 Yannick Warnier
          0 =>
610
            array (
611
               'original_user_id_value' => string '1',            // original user id that
612
you sent like param
613
               'result' => string '8'                    // new user id from dokeos,
614
return 0 if user in not inserted with sucess
615
              )
616 4 Yannick Warnier
       )</pre>
617 2 Yannick Warnier
618
h3. DokeosWSCreateUsersPasswordCrypted
619
620 1 Yannick Warnier
This function adds users into dokeos, the password param (your password with a salt) is
621
encrypted. It's very important sent the salt into an extra field param with field_name 'salt',
622
otherwise the user will be able login in
623
Input params
624
Follow the new structure:
625 4 Yannick Warnier
<pre>$params = array(
626 1 Yannick Warnier
       'users' =>array(
627
              // array of users params, you can create many users passing
628
              // arrays of params
629
              array(
630
                      'firstname' => 'Christian',                // required
631
                      'lastname' => 'XXX',                       // required
632
                     'status' => '5',
633
                            // required, (1 => teacher, 5 => learner)
634
                     'email' => 'XXX@gmail.dom',
635
                            // optional, follow the same format (example@domain.com)
636
                     'loginname' => 'usuarioA',             // required
637
                     'password' => md5('--christian--12345--'),
638
                            // required, it's important to define the salt into
639
                            // an extra field param
640
                     'encrypt_method' => 'md5',
641
                            // required, check if the encrypt is the same
642
                            // as dokeos configuration
643
                     'language' => 'spanish',               // optional
644
                     'phone' => '12345678',                 // optional
645
                     'expiration_date' => '0000-00-00 00:00:00',
646
                            // optional, follow the same format
647
                     'original_user_id_name' => 'USER',
648
                            //required, field name about original user id
649
                     'original_user_id_value' => '10',
650
                            //required, field value about original user id
651
                     'extra' => array (
652
                            //required, you must define at least field name 'salt'
653
                            // with the same value than your encryption
654
                            array('field_name' => 'salt',
655
                                  'field_value' => 'christian'),
656
                            array('field_name' => 'DNI',
657
                                  'field_value' => '123456')
658
                     )
659
              ),
660
              'secret_key' => sha1('123')
661
                     //required, secret key ("your IP address and security key
662
                     // from dokeos") encrypted with sha1
663 4 Yannick Warnier
       );</pre>
664 1 Yannick Warnier
Output params
665
The results are shown like follow structure:
666 4 Yannick Warnier
<pre>       array
667 1 Yannick Warnier
          0 =>
668
            array
669
               'original_user_id_value' => string '10'
670
                     // original user id that you sent like param
671
               'result' => string '8'
672
                     // new user id from dokeos, 0 if your operation is failed
673
                     // or a msg about your encrypt method
674 4 Yannick Warnier
</pre>
675 2 Yannick Warnier
676
h3. DokeosWSEditUsers
677
678 1 Yannick Warnier
This function edits users into dokeos, the password param is not encrypted
679
Input params
680
Follow the new structure:
681 4 Yannick Warnier
<pre>$params = array(
682 1 Yannick Warnier
       'users' =>array(
683
              // array of users params, you can edit many users passing
684
              // arrays of params
685
              array(
686
                     'original_user_id_value' => '1',
687
                            //required, field value about original user id
688
                     'original_user_id_name' => 'USER',
689
                            //required, field name about original user id
690
                     'firstname' => 'Christian',               //required
691
                     'lastname' => 'XXX',                      //required
692
                     'username' => 'usuario1',                 //required
693
                     'password' => '12345',                    //required
694
                     'email' => 'XXX@gmail.dom',
695
                            //optional, follow the same format (example@domain.com)
696
                     'status' => '5',
697
                            //optional, (1 => teacher, 5 => learner)
698
                     'phone' => '12345678',                    //optional
699
                     'expiration_date' => '0000-00-00 00:00:00',
700
                            //optional, follow the same format
701
                     'extra' => array (
702
                            //optional, extra fields about user's extras data,
703
                            // you can insert several extra fields
704
                            array('field_name' => 'direccion',
705
                                   'field_value' => 'Arquimedes 260'),
706
                                   // field name with your field value
707
                            array('field_name' => 'DNI',
708
                                   'field_value' => '416766220')
709
                                   // field name with your field value
710
                     )
711
             )
712
       ),
713
       'secret_key' => sha1('123')
714
              //required, secret key ("your IP address and security key
715
              // from dokeos") encrypted with sha1
716 4 Yannick Warnier
);</pre>
717 1 Yannick Warnier
Output params
718
The results are shown like follow structure:
719 4 Yannick Warnier
<pre>       array
720 1 Yannick Warnier
          0 =>
721
            array
722
               'original_user_id_value' => string '1'
723
                     // original user id that you sent like param
724
               'result' => string '1'
725
                     // '1' if your operation is Ok, '0' otherwise
726 4 Yannick Warnier
</pre>
727 2 Yannick Warnier
728
h3. DokeosWSEditUsersPasswordCrypted
729
730 1 Yannick Warnier
This function edits users into dokeos, if you edit password it must be encrypted with sha1
731
(password with a salt), and don't forget define the salt into extra field with field name 'salt',
732
otherwise the user will be able log in.
733
Input params
734
Follow the new structure:
735 4 Yannick Warnier
<pre>$params = array(
736 1 Yannick Warnier
       'users' =>array( // array of users params, you can edit many users
737
passing arrays of params
738
               array(
739
                      'original_user_id_value' => '10',
740
                              //required, field value about original user id
741
                      'original_user_id_name' => 'USER',
742
                              //required, field name about original user id
743
                      'firstname' => 'Christian',             // required
744
                      'lastname' => 'XXX',                    // required
745
                      'username' => 'usuarioA',               // required
746
                      'password' => md5('--christian--12345--'),
747
                              // required, it's important to define the salt into
748
                              // an extra field param
749
                      'encrypt_method' => 'md5',
750
                              // required, check if the encrypt is the same than
751
                              // dokeos configuration
752
                      'email' => 'XXX@gmail.dom',
753
                              // optional, follow the same format (example@domain.com)
754
                      'status' => '5', // required, (1 => teacher, 5 => learner)
755
                      'phone' => '12345678', // optional
756
                      'expiration_date' => '0000-00-00 00:00:00',
757
                              // optional, follow the same format
758
                      'extra' => array (
759
                              //required, you must define at least field name 'salt'
760
                              // with the same value than your encryption
761
                      array('field_name' => 'salt',
762
                              'field_value' => 'christian'),
763
                      array('field_name' => 'DNI',
764
                              'field_value' => '123456')
765
              )
766
       ),
767
       'secret_key' => sha1('123') //required, secret key ("your IP address and
768
security key from dokeos") encrypted with sha1
769 4 Yannick Warnier
);</pre>
770 1 Yannick Warnier
Output params
771
The results are shown like follow structure:
772 4 Yannick Warnier
<pre>array
773 1 Yannick Warnier
   0 =>
774
     array
775
        'original_user_id_value' => string '10'
776
               // original user id that you sent like param
777
        'result' => string '8'
778
               // new user id from dokeos, 0 if your operation is failed
779
               // or a msg about your encrypt method
780 4 Yannick Warnier
</pre>
781 2 Yannick Warnier
782
h3. DokeosWSDeleteUsers
783
784 1 Yannick Warnier
This function only disable users into dokeos, if you want delete from database you can
785
delete it from user list into your dokeos portal
786
Input params
787
Follow the new structure:
788 4 Yannick Warnier
<pre>$params = array(
789 1 Yannick Warnier
       'users' =>array(
790
              // array of users params, you can delete many users passing
791
              // arrays of params
792
              array(
793
                    'original_user_id_name' => 'USER',
794
                           //required, field name about original user id
795
                    'original_user_id_value' => '1',
796
                           //required, field value about original user id
797
             )
798
       ),
799
       'secret_key' => sha1('123') //required, secret key ("your IP address and
800
security key from dokeos") encrypted with sha1
801 4 Yannick Warnier
);</pre>
802 1 Yannick Warnier
Output params
803
The results are shown like follow structure:
804 4 Yannick Warnier
<pre>array
805 1 Yannick Warnier
   0 =>
806
     array
807
        'original_user_id_value' => string '1'
808
              // original user id that you sent like param
809
        'result' => string '1'
810
              // '1' if your operation is Ok, '0' otherwise
811 4 Yannick Warnier
</pre>
812 2 Yannick Warnier
813 4 Yannick Warnier
h3. DokeosWSCreateCourse
814 2 Yannick Warnier
815 1 Yannick Warnier
This function creates courses into dokeos
816
Input params
817
Follow the new structure:
818 4 Yannick Warnier
<pre>$params = array(
819 1 Yannick Warnier
       'courses' =>array(
820
              // array of courses params, this depend your memory limit,
821
              // it is recommended not passing 3 courses
822
              array(
823
                    'title' => 'Religion',         // required
824
                    'category_code' => 'LANG',     // required (LANG,PROJ)
825
                    'wanted_code' => '',
826
                           // optional, if it's not defined dokeos will
827
                           // generate it
828
                    'tutor_name' => 'Christian Fasanando', // optional
829
                    'course_language' => 'spanish',            // optional
830
                    'original_course_id_name' => 'CURSO',
831
                           //required, field name about original course id
832
                    'original_course_id_value' => '1',
833
                           //required, field value about original course id
834
                    'extra' => array (
835
                           array('field_name' => 'edicion',
836
                                  'field_value' => 'Arquimedes 260'),
837
                           array('field_name' => 'libros',
838
                                  'field_value' =>'XXX')
839
                    )
840
             )
841
       ),
842
       'secret_key' => sha1('123')
843
              //required, secret key ("your IP address
844
              //and security key from dokeos") encrypted with sha1
845 4 Yannick Warnier
);</pre>
846 1 Yannick Warnier
Output params
847
The results are shown like follow structure:
848 4 Yannick Warnier
<pre>array
849 1 Yannick Warnier
   0 =>
850
     array
851
        'original_course_id_value' => string '1'
852
              // original course id that you sent like param
853
        'result' => string 'RELIGION'
854
       // new course code from dokeos, '0' if the operation has been failed
855 4 Yannick Warnier
</pre>
856 2 Yannick Warnier
857 4 Yannick Warnier
h3. DokeosWSCreateCourseByTitle
858 1 Yannick Warnier
859
This function creates courses into dokeos by title
860
Input params
861
Follow the new structure:
862 4 Yannick Warnier
<pre>$params = array(
863 1 Yannick Warnier
       'courses' =>array(
864
              // array of courses params, this depend your memory limit,
865
              //it's recommended not passing 3 courses
866
              array(
867
                     'title' => 'Religion',         // required
868
                     'tutor_name' => 'Christian Fasanando', // optional
869
                     'original_course_id_name' => 'CURSO',
870
                           //required, field name about original course id
871
                     'original_course_id_value' => '1',
872
                           //required, field value about original course id
873
                     'extra' => array (
874
                           array('field_name' => 'edicion',
875
                                  'field_value' => Arquimedes 260'),
876
                           array('field_name' => 'libros',
877
                                  'field_value' =>'XXX')
878
                     )
879
             )
880
       ),
881
       'secret_key' => sha1('123')
882
              //required, secret key ("your IP address and security key
883
              // from dokeos") encrypted with sha1
884 4 Yannick Warnier
);</pre>
885
886 1 Yannick Warnier
Output params
887
The results are shown like follow structure:
888 4 Yannick Warnier
<pre>array
889 1 Yannick Warnier
   0 =>
890
     array
891
        'original_course_id_value' => string '1'
892
              // original course id that you sent like param
893
        'result' => string 'RELIGION'
894
              // new course code from dokeos, '0' if the operation has been failed
895 4 Yannick Warnier
</pre>
896 2 Yannick Warnier
897
h3. DokeosWSEditCourse
898
899 1 Yannick Warnier
This function edits courses into dokeos
900
Input params
901
Follow the new structure:
902 4 Yannick Warnier
<pre>$params = array(
903 1 Yannick Warnier
       'courses' =>array(
904
              // array of courses params, this depend your memory limit,
905
              // it's recommended not passing 3 courses
906
              array(
907
                    'tutor_id' => '1',              // required
908
                    'title' => 'Religion',          // required
909
                    'category_code' => 'LANG',      // required
910
                    'department_name' => '',        // optional
911
                    'department_url' => '',         // optional
912
                    'course_language' => 'english',       // optional
913
                    'visibility' => '3',
914
                           // optional ('0' = closed,'1' = private access,
915
                           // '2' = access allowed for users registered on
916
                           // the platform, '3' = access allowed for
917
                           // the whole world )
918
                    'subscribe' => '1', // optional ('0' = denied, '1' = allowed)
919
                    'unsubscribe' => '0', //optional ('0' = denied, '1' = allowed)
920
                    'visual_code' => '',
921
                           // optional, if it's not defined
922
                           // dokeos will be generate it
923
                    'original_course_id_name' => 'CURSO',
924
                           //required, field name about original course id
925
                    'original_course_id_value' => '1',
926
                           //required, field value about original course id
927
                    'extra' => array (        //optional
928
                           array('field_name' => 'edicion',
929
                                  'field_value' => 'Arquimedes 260'),
930
                           array('field_name' => 'libros',
931
                                  'field_value' =>'XXX')
932
                    )
933
             )
934
       ),
935
       'secret_key' => sha1('123') //required, secret key ("your IP address and
936
security key from dokeos") encrypted with sha1
937 4 Yannick Warnier
);</pre>
938 1 Yannick Warnier
Output params
939
The results are shown like follow structure:
940 4 Yannick Warnier
<pre>array
941 1 Yannick Warnier
   0 =>
942
     array
943
        'original_course_id_value' => string '1'
944
              // original course id that you sent like param
945
        'result' => string '1'
946
              // '1' if the operation is OK, '0' otherwise
947 4 Yannick Warnier
</pre>
948 1 Yannick Warnier
949 2 Yannick Warnier
h3. DokeosWSDeleteCourse
950
951 1 Yannick Warnier
This function set visibility to '0', this not allow a user to access it, if you want remove from
952
database you must delete from courses list into your dokeos portal
953
Input params
954
Follow the new structure:
955 4 Yannick Warnier
<pre>$params = array(
956 1 Yannick Warnier
       'courses' =>array(
957
              // array of courses params, this depend your memory limit,
958
              // it's recommended not passing 3 courses
959
              array(
960
                     'original_course_id_value' => '1',
961
                              //required, field value about original course id
962
                     'original_course_id_name' => 'CURSO',
963
                              //required, field name about original course id
964
             )
965
       ),
966
       'secret_key' => sha1('123')
967
              //required, secret key ("your IP address and security key
968
              // from dokeos") encrypted with sha1
969 4 Yannick Warnier
);</pre>
970 1 Yannick Warnier
Output params
971
The results are shown like follow structure:
972 4 Yannick Warnier
<pre>array
973 1 Yannick Warnier
   0 =>
974
     array
975
        'original_course_id_value' => string '1'
976
              // original course id that you sent like param
977
        'result' => string '1'
978
              // '1' if the operation is OK, '0' otherwise
979 4 Yannick Warnier
</pre>
980 2 Yannick Warnier
981 1 Yannick Warnier
h3. DokeosWSCreateSession
982
983
This function creates sessions into dokeos
984
Input params
985
Follow the new structure:
986 4 Yannick Warnier
<pre>$params = array(
987 1 Yannick Warnier
       'sessions' =>array(                    // array of session params, you can create
988
many session
989
              array(
990
                     'name' => 'SESION3',             //required
991
                     'year_start' => '2000', // required if nolimit param is '1'
992
                     'month_start' => '11', // required if nolimit param is '1'
993
                     'day_start' => '10', // required if nolimit param is '1'
994
                     'year_end' => '2001', //required if nolimit param is '1'
995
                     'month_end' => '12',      //required if nolimit param is '1'
996
                     'day_end' => '11',        //required if nolimit param is '1'
997
                     'nb_days_acess_before' => '0',
998
                     // optional, define access delays of the coach (days before)
999
                     'nb_days_acess_after' => '0',
1000
                     // optional, define access delays of the coach (days after)
1001
                     'nolimit' => '0',
1002
                            // required, 0 = no limit time, 1 = limit time
1003
                     'user_id' => '3', // required, a user id from dokeos
1004
                     'original_session_id_name' => 'SESION',
1005
                            //required, field name about original session id
1006
                     'original_session_id_value' =>'3',
1007
                            //required, field value about original session id
1008
                     'extra' => array ( // optional
1009
                            array('field_name' => 'edicion',
1010
                                   'field_value' => 'Arquimedes 260'),
1011
                            array('field_name' => 'libros',
1012
                                   'field_value' =>'XXX')
1013
                     )
1014
             )
1015
       ),
1016
       'secret_key' => sha1('123')
1017
              //required, secret key ("your IP address and security key from
1018
              // dokeos") encrypted with sha1
1019 4 Yannick Warnier
);</pre>
1020 1 Yannick Warnier
Output params
1021
The results are shown like follow structure:
1022 4 Yannick Warnier
<pre>array
1023 1 Yannick Warnier
   0 =>
1024
     array
1025
        'original_session_id_value' => string '3'
1026
              // original session id that you sent like param
1027
        'result' => string '11'
1028 2 Yannick Warnier
              // new session id from dokeos, '0' if the operation has been failed
1029 4 Yannick Warnier
</pre>
1030 2 Yannick Warnier
1031 1 Yannick Warnier
h3. DokeosWSEditSession
1032
1033
This function edits a session into dokeos
1034
Input params
1035
Follow the new structure:
1036 4 Yannick Warnier
<pre>$params = array(
1037 1 Yannick Warnier
       'sessions' =>array( // array of session params, you can edit many session
1038
              array(
1039
                     'name' => 'SESION3',      //required
1040
                     'year_start' => '2000', // required if nolimit param is '1'
1041
                     'month_start' => '11', // required if nolimit param is '1'
1042
                     'day_start' => '10',     // required if nolimit param is '1'
1043
                    'year_end' => '2001',     //required if nolimit param is '1'
1044
                    'month_end' => '12',      //required if nolimit param is '1'
1045
                    'day_end' => '11',        //required if nolimit param is '1'
1046
                    'nb_days_acess_before' => '0',
1047
                    // optional, define access delays of the coach (days before)
1048
                    'nb_days_acess_after' => '0',
1049
                    // optional, define access delays of the coach (days after)
1050
                    'nolimit' => '0',
1051
                           // required, 0 = no limit time, 1 = limit time
1052
                    'user_id' => '3', // required, a user id from dokeos
1053
                    'original_session_id_name' => 'SESION',
1054
                           //required, field name about original session id
1055
                    'original_session_id_value' =>'3',
1056
                           //required, field value about original session id
1057
                    'extra' => array ( // optional
1058
                           array('field_name' => 'edicion',
1059
                                  'field_value' => 'Arquimedes 260'),
1060
                           array('field_name' => 'libros', 'field_value' =>'XXX')
1061
                    )
1062
             )
1063
       ),
1064
       'secret_key' => sha1('123')
1065
              //required, secret key ("your IP address and security key
1066
              //from dokeos") encrypted with sha1
1067 4 Yannick Warnier
);</pre>
1068 1 Yannick Warnier
Output params
1069
The results are shown like follow structure:
1070 4 Yannick Warnier
<pre>array
1071 1 Yannick Warnier
   0 =>
1072
     array
1073
        'original_session_id_value' => string '3'
1074
              // original session id that you sent like param
1075
        'result' => string '1'
1076
              // '1' if the operation is OK, '0' otherwise
1077 4 Yannick Warnier
</pre>
1078 1 Yannick Warnier
1079 2 Yannick Warnier
h3. DokeosWSDeleteSession
1080
1081 1 Yannick Warnier
This function deletes a session from database into dokeos
1082
Input params
1083
Follow the new structure:
1084 4 Yannick Warnier
<pre>$params = array(
1085 1 Yannick Warnier
       'sessions' =>array(
1086
              // array of session params, you can delete many session
1087
              array(
1088
                    'original_session_id_value' =>'3',
1089
                           //required, field value about original session id
1090
                    'original_session_id_name' => 'SESION',
1091
                           //required, field name about original session id
1092
             )
1093
       ),
1094
       'secret_key' => sha1('123')
1095
              //required, secret key ("your IP address and security key
1096
              //from dokeos") encrypted with sha1
1097 4 Yannick Warnier
);</pre>
1098 1 Yannick Warnier
Output params
1099
The results are shown like follow structure:
1100 4 Yannick Warnier
<pre>array
1101 1 Yannick Warnier
   0 =>
1102
     array
1103
        'original_session_id_value' => string '3'
1104
              // original session id that you sent like param
1105
        'result' => string '1'
1106
              // '1' if the operation is OK, '0' otherwise
1107 4 Yannick Warnier
</pre>
1108 2 Yannick Warnier
1109 4 Yannick Warnier
h3. DokeosWSSubscribeUserToCourse
1110 1 Yannick Warnier
1111 2 Yannick Warnier
This function suscribe many users to a course into dokeos
1112 1 Yannick Warnier
Input params
1113
Follow the new structure:
1114 4 Yannick Warnier
<pre>$params = array(
1115 1 Yannick Warnier
       'userscourses' =>array(
1116
              // array of userscourses params, you can suscribe many users
1117
              //into many courses
1118
              array(
1119
                     'original_user_id_values' => array('1','2'),
1120
                     // required, array of field value about original user id
1121
                     'original_user_id_name' => 'USER',
1122
                           //required, field name about original user id
1123
                     'original_course_id_value' => '1',
1124
                           //required, field value about original course id
1125
                     'original_course_id_name' => 'CURSO',
1126
                           //required, field name about original course id
1127
              )
1128
       ),
1129
       'secret_key' => sha1('123')
1130
              //required, secret key ("your IP address and security key
1131
              // from dokeos") encrypted with sha1
1132 4 Yannick Warnier
);</pre>
1133 1 Yannick Warnier
Output params
1134
The results are shown like follow structure:
1135 4 Yannick Warnier
<pre>$output[] = array(
1136 1 Yannick Warnier
       'original_user_id_value' =>$orig_user_id_value[$i],
1137
       'original_course_id_value' =>$orig_course_id_value[$i],
1138
       'result' => $results[$i]);
1139
array
1140
   0 =>
1141
     array
1142
        'original_user_id_value' => string '1,2'
1143
              // original users id that you sent like param
1144
        'original_course_id_value' => string '1'
1145
              // original course id that you sent like param
1146
        'result' => string '1'
1147
              // '1' if the operation is OK, '0' otherwise
1148 4 Yannick Warnier
</pre>
1149 2 Yannick Warnier
1150
h3. DokeosWSUnSubscribeUserFromCourse
1151 1 Yannick Warnier
1152
This function unsuscribe many users from courses into dokeos
1153
Input params
1154
Follow the new structure:
1155 4 Yannick Warnier
<pre>$params = array(
1156 1 Yannick Warnier
       'userscourses' =>array(               // array of userscourses params, you can
1157
unsuscribe many users from many courses
1158
              array(
1159
                    'original_user_id_values' => array('1','2'),
1160
                           // required, array of field value about original user id
1161
                    'original_user_id_name' => 'USER',
1162
                           //required, field name about original user id
1163
                    'original_course_id_value' => '1',
1164
                           //required, field value about original course id
1165
                    'original_course_id_name' => 'CURSO',
1166
                           //required, field name about original course id
1167
             )
1168
       ),
1169
       'secret_key' => sha1('123') //required, secret key ("your IP address and
1170
security key from dokeos") encrypted with sha1
1171 4 Yannick Warnier
);</pre>
1172 1 Yannick Warnier
Output params
1173
The results are shown like follow structure:
1174 4 Yannick Warnier
<pre>array
1175 1 Yannick Warnier
   0 =>
1176
     array
1177
        'original_user_id_value' => string '1,2'
1178
              // original users id that you sent like param
1179
       'original_course_id_value' => string '1'
1180
              // original course id that you sent like param
1181
       'result' => string '1'
1182
              // '1' if the operation is OK, '0' otherwise
1183 4 Yannick Warnier
</pre>
1184 2 Yannick Warnier
1185
h3. DokeosWSSuscribeUsersToSession
1186 1 Yannick Warnier
1187
This function suscribe many users to sessions into dokeos
1188
Input params
1189
Follow the new structure:
1190 4 Yannick Warnier
<pre>$params = array(
1191 1 Yannick Warnier
       'userssessions' =>array(
1192
              // array of userssessions params, you can suscribe many users
1193
              //into many sessions
1194
              array(
1195
                     'original_user_id_values' => array('1','2'),
1196
                           // required, array of field value about original user id
1197
                     'original_user_id_name' => 'USER',
1198
                           //required, field name about original user id
1199
                     'original_session_id_value' => '1',
1200
                           //required, field value about original session id
1201
                     'original_session_id_name' => 'SESION',
1202
                           //required, field name about original session id
1203
             )
1204
       ),
1205
       'secret_key' => sha1('123')
1206
              //required, secret key ("your IP address and security key
1207
              // from dokeos") encrypted with sha1
1208 4 Yannick Warnier
);</pre>
1209 1 Yannick Warnier
Output params
1210
The results are shown like follow structure:
1211 4 Yannick Warnier
<pre>array
1212 1 Yannick Warnier
   0 =>
1213
     array
1214
        'original_user_id_value' => string '1,2'
1215
              // original users id that you sent like param
1216
       'original_session_id_value' => string '1'
1217
              // original session id that you sent like param
1218
       'result' => string '1'
1219
              // '1' if the operation is OK, '0' otherwise
1220 4 Yannick Warnier
</pre>
1221 2 Yannick Warnier
1222
h3. DokeosWSUnsuscribeUsersFromSession
1223 1 Yannick Warnier
1224
This function unsuscribe many users from sessions into dokeos
1225
Input params
1226
Follow the new structure:
1227 4 Yannick Warnier
<pre>$params = array(
1228 1 Yannick Warnier
       'userssessions' =>array(
1229
              // array of userssessions params, you can unsuscribe many users
1230
              // from many sessions
1231
              array(
1232
                     'original_user_id_values' => array('1','2'),
1233
                           // required, array of field value about original user id
1234
                     'original_user_id_name' => 'USER',
1235
                           //required, field name about original user id
1236
                     'original_session_id_value' => '1',
1237
                           //required, field value about original session id
1238
                     'original_session_id_name' => 'SESION',
1239
                           //required, field name about original session id
1240
             )
1241
       ),
1242
       'secret_key' => sha1('123')
1243
              //required, secret key ("your IP address and security key
1244
              // from dokeos") encrypted with sha1
1245 4 Yannick Warnier
);</pre>
1246 1 Yannick Warnier
Output params
1247
The results are shown like follow structure:
1248 4 Yannick Warnier
<pre>array
1249 1 Yannick Warnier
   0 =>
1250
     array
1251
        'original_user_id_values' => string '1,2'
1252
              // original users id that you sent like param
1253
        'original_session_id_value' => string '1'
1254
              // original session id that you sent like param
1255
        'result' => string '1'
1256
              // '1' if the operation is OK, '0' otherwise
1257 4 Yannick Warnier
</pre>
1258 2 Yannick Warnier
1259
h3. DokeosWSSuscribeCoursesToSession
1260 1 Yannick Warnier
1261
This function suscribe many courses to sessions into dokeos
1262
Input params
1263
Follow the new structure:
1264 4 Yannick Warnier
<pre>$params = array(
1265 1 Yannick Warnier
       'coursessessions' =>array(
1266
              // array of coursessessions params, you can suscribe many
1267
              // courses from many sessions
1268
              array(
1269
                     'original_course_id_values' => array('1','2'),
1270
                     // required, array of field values about original course id
1271
                     'original_course_id_name' => 'CURSO',
1272
                     //required, field name about original course id
1273
                     'original_session_id_value' => '1',
1274
                     //required, field value about original session id
1275
                     'original_session_id_name' => 'SESION',
1276
                     //required, field name about original session id
1277
             )
1278
       ),
1279
       'secret_key' => sha1('123')
1280
              //required, secret key ("your IP address
1281
              // and security key from dokeos") encrypted with sha1
1282 4 Yannick Warnier
);</pre>
1283 1 Yannick Warnier
Output params
1284
The results are shown like follow structure:
1285 4 Yannick Warnier
<pre>array
1286 1 Yannick Warnier
   0 =>
1287
     array
1288
        'original_course_id_values' => string '1,2'
1289
              // original courses id that you sent like param
1290
       'original_session_id_value' => string '1'
1291
              // original session id that you sent like param
1292
       'result' => string 'RELIGION,MATE'
1293
              // deparment urls of courses suscribed, '0' otherwise
1294 4 Yannick Warnier
</pre>
1295 1 Yannick Warnier
1296
h3. DokeosWSUnsuscribeCoursesFromSession
1297 2 Yannick Warnier
1298
This function unsuscribe many courses from sessions into dokeos
1299
Input params
1300 1 Yannick Warnier
Follow the new structure:
1301 4 Yannick Warnier
<pre>$params = array(
1302 1 Yannick Warnier
       'coursessessions' =>array(
1303
                    // array of coursessessions params, you can unsuscribe
1304
                    //many courses from many sessions
1305
              array(
1306
                    'original_course_id_values' => array('1','2'),
1307
                    // required, array of field values about original course id
1308
                    'original_course_id_name' => 'CURSO',
1309
                    //required, field name about original course id
1310
                    'original_session_id_value' => '1',
1311
                    //required, field value about original session id
1312
                    'original_session_id_name' => 'SESION',
1313
                    //required, field name about original session id
1314
             )
1315
       ),
1316
       'secret_key' => sha1('123')
1317
              //required, secret key ("your IP address and security key
1318
              // from dokeos") encrypted with sha1
1319 4 Yannick Warnier
);</pre>
1320 1 Yannick Warnier
Output params
1321
The results are shown like follow structure:
1322 4 Yannick Warnier
<pre>array
1323 1 Yannick Warnier
   0 =>
1324
     array
1325
       'original_course_id_values' => string       '1,2'
1326
              // original courses id that you      sent like param
1327
       'original_session_id_value' => string       '1'
1328
              // original session id that you      sent like param
1329
       'result' => string '1'
1330
              // '1' if the operation is OK,       '0' otherwise
1331 4 Yannick Warnier
</pre>
1332 1 Yannick Warnier
1333
h3. DokeosWSCourseDescription
1334
1335
This function return categories list from course description, if the value is a string '' it
1336 2 Yannick Warnier
means there are not title and content by category. Actually exits only 8 categories what you
1337
can modify title and content, see course description tool in your portal dokeos
1338
Input params
1339 1 Yannick Warnier
Follow the new structure:
1340 4 Yannick Warnier
<pre>$params = array(
1341 1 Yannick Warnier
       'original_course_id_name' => 'CURSO',
1342
              // required, field name about original course id
1343
       'original_course_id_value' => '2',
1344
              // required, field value about original course id
1345
       'secret_key' => sha1('123')
1346
              // required, secret key ("your IP address and security key
1347
              // from dokeos") encrypted with sha1
1348 4 Yannick Warnier
 );</pre>
1349 1 Yannick Warnier
Results
1350
Return categories list about course description
1351
1352
h3. DokeosWSEditCourseDescription
1353
1354
This function modify title and content about categories from course description
1355 2 Yannick Warnier
Input params
1356
Follow the new structure:
1357 4 Yannick Warnier
<pre>
1358 1 Yannick Warnier
$params = array(
1359
       'course_desc' =>array(
1360
              // array course description params, you can create modify
1361
              // many titles and contents
1362
              array(
1363
                     'course_desc_id' => '1',
1364
                            //required, category id from course description (1-8),
1365
                            // see results of DokeosWSCourseDescription function
1366
                            //for more information
1367
                     'course_desc_title' => 'Descripcion',
1368
                            //required, title about a category you want modify
1369
                     'course_desc_content' => 'descripcion mod',
1370
                            //required, content about a category you want modify
1371
                     'original_course_id_name' => 'CURSO',
1372
                            //required, field name about original course id
1373
                      'original_course_id_value' => '2'
1374
                             //required, field value about original course id
1375
             )
1376
        ),
1377
        'secret_key' => sha1('123')
1378
              //required, secret key ("your IP address and security key
1379
              //from dokeos") encrypted with sha1
1380
);
1381 4 Yannick Warnier
</pre>
1382 1 Yannick Warnier
Output params
1383
The results are shown like follow structure:
1384 4 Yannick Warnier
<pre>
1385 1 Yannick Warnier
array
1386
   0 =>
1387
     array
1388
        'original_course_id_value' => string '10'
1389
              // original course id that you sent like param
1390
        'result' => string '1'
1391
              // '1' if operation is OK, 0 otherwise
1392 4 Yannick Warnier
</pre>
1393 1 Yannick Warnier
NOTE: In all functions above if your secret key param is incorrect they'll return an empty array
1394 2 Yannick Warnier
1395 4 Yannick Warnier
h3. DokeosWSCreateUserPasswordCrypted
1396 2 Yannick Warnier
1397
This function adds only a user into dokeos, the password param (your password with a
1398 1 Yannick Warnier
salt) is encrypted. It's very important sent the salt into an extra field param with
1399
field_name 'salt', otherwise the user will be able login in .
1400
Input params
1401
Follow the new structure:
1402 4 Yannick Warnier
<pre>
1403 1 Yannick Warnier
$params =
1404
        array(
1405
              'firstname' => 'Christian',                 // required
1406
              'lastname' => 'XXX',                        // required
1407
              'status' => '5',
1408
                      // required, (1 => teacher, 5 => learner)
1409
              'email' => 'XXX@gmail.dom',
1410
                      // optional, follow the same format (example@domain.com)
1411
              'loginname' => 'usuarioIV',                 // required
1412
              'password' => md5('--christian--12345--'),
1413
                      // required, it's important to define the salt
1414
                      // into an extra field param
1415
              'encrypt_method' => 'md5',          // required, check if the encrypt
1416
                      // is the same than dokeos configuration
1417
              'language' => 'spanish',                    // optional
1418
              'phone' => '12345678',                      // optional
1419
              'expiration_date' => '0000-00-00 00:00:00',
1420
                      // optional, follow the same format
1421
              'original_user_id_name' => 'USER',
1422
                      //required, field name about original user id
1423
              'original_user_id_value' => 'A5',
1424
                      //required, field value about original user id
1425
               'extra' => array (
1426
                      //required, you must define at least field name 'salt'
1427
                      // with the same value than your encryption
1428
                      array(
1429
                             'field_name' => 'salt',
1430
                             'field_value' => 'christian'),
1431
                      array(
1432
                             'field_name' => 'DNI',
1433
                             'field_value' => '123456')
1434
         ),
1435
         'secret_key' => sha1('123')
1436
               //required, secret key ("your IP address and security key
1437
               // from dokeos") encrypted with sha1
1438 4 Yannick Warnier
         );</pre>
1439 1 Yannick Warnier
Output params
1440
A string about result:
1441 4 Yannick Warnier
<pre>-1 - Secret key is incorrect
1442 1 Yannick Warnier
        new user id from dokeos - If the operation is OK
1443
0 - If the operation has failed
1444 4 Yannick Warnier
</pre>
1445 2 Yannick Warnier
1446
h3. DokeosWSEditUserPasswordCrypted
1447
1448 1 Yannick Warnier
This function edits only a user into dokeos, if you edit password it must be encrypted with
1449
sha1 (password with a salt), and don't forget define the salt into extra field with field name
1450
'salt', otherwise the user will be able log in.
1451
Input params
1452
Follow the new structure:
1453 4 Yannick Warnier
<pre>$params =
1454 1 Yannick Warnier
         array(
1455
               'original_user_id_value' => '10',
1456
                      //required, field value about original user id
1457
               'original_user_id_name' => 'USER',
1458
                      //required, field name about original user id
1459
               'firstname' => 'Christian',               // required
1460
               'lastname' => 'XXX',                      // required
1461
               'username' => 'usuarioA',                 // required
1462
               'password' => md5('--christian--12345--'),
1463
                      // required, it's important to define the salt into
1464
                      // an extra field param
1465
               'encrypt_method' => 'md5',
1466
               // required, check if the encrypt is the same
1467
               // than dokeos configuration
1468
               'email' => 'XXX@gmail.dom',
1469
               // optional, follow the same format (example@domain.com)
1470
               'status' => '5', // required, (1 => teacher, 5 => learner)
1471
               'phone' => '12345678', // optional
1472
               'expiration_date' => '0000-00-00 00:00:00',
1473
                      // optional, follow the same format
1474
               'extra' => array (
1475
                      //required, you must define at least field name 'salt'
1476
                     // with the same value than your encryption
1477
                     array('field_name' => 'salt',
1478
                           'field_value' => 'christian'),
1479
                     array('field_name' => 'DNI',
1480
                           'field_value' => '123456')
1481
              ),
1482
              'secret_key' => sha1('123')
1483
                     // required, secret key ("your IP address and security
1484
                     // key from dokeos") encrypted with sha1
1485
);
1486 4 Yannick Warnier
</pre>
1487 1 Yannick Warnier
Output params
1488
A string about result:
1489 4 Yannick Warnier
<pre>-1 - Secret key is incorrect
1490 1 Yannick Warnier
 1 - If the operation is OK
1491
 0 - If the operation has failed
1492 4 Yannick Warnier
</pre>
1493 1 Yannick Warnier
1494 4 Yannick Warnier
h3. DokeosWSCreateUser
1495 2 Yannick Warnier
1496
This function adds only a user into dokeos, the password param is not encrypted
1497 1 Yannick Warnier
Input params
1498
Follow the new structure:
1499 4 Yannick Warnier
<pre>$params =
1500 1 Yannick Warnier
       array(
1501
              'firstname' => 'Christian',            //required
1502
              'lastname' => 'XXX',                   //required
1503
              'status' => '5',
1504
                     //required, (1 => teacher, 5 => learner)
1505
              'email' => 'XXX@gmail.dom',
1506
                     //optional, follow the same format (example@domain.com)
1507
              'loginname' => 'usuario1',             //required
1508
              'password' => '12345',                 //required
1509
              'language' => 'spanish',               //optional
1510
              'phone' => '12345678',                 //optional
1511
              'expiration_date' => '0000-00-00 00:00:00',
1512
                     //optional, follow the same format
1513
              'original_user_id_name' => 'USER',
1514
                     //required, field name about original user id
1515
              'original_user_id_value' => '1',
1516
                     //required, field value about original user id
1517
              'extra' => array (
1518
                     //optional, extra fields about user's extras data,
1519
                     //you can insert several extra fields
1520
                     array('field_name' => 'direccion',
1521
                           'field_value' => 'Arquimedes 260'),
1522
                           // field name with your field value
1523
                     array('field_name' => 'DNI',
1524
                           'field_value' => '416766220')
1525
                           // field name with your field value
1526
              ),
1527
       'secret_key' => sha1('123')
1528
              //required, secret key ("your IP address and security key
1529
              // from dokeos") encrypted with sha1
1530
     );
1531 4 Yannick Warnier
</pre>
1532 1 Yannick Warnier
Output params
1533
A string about result:
1534 4 Yannick Warnier
<pre>          -1 - Secret key is incorrect
1535 1 Yannick Warnier
            new user id from dokeos - If the operation is OK
1536
          0 - If the operation has failed
1537 4 Yannick Warnier
</pre>
1538 1 Yannick Warnier
1539 4 Yannick Warnier
h3. DokeosWSEditUser
1540 1 Yannick Warnier
1541
This function edits only a user into dokeos, the password param is not encrypted
1542
Input params
1543
Follow the new structure:
1544 4 Yannick Warnier
<pre>
1545 2 Yannick Warnier
$params =
1546
       array(
1547
              'original_user_id_value' => '1',
1548 1 Yannick Warnier
                     //required, field value about original user id
1549
              'original_user_id_name' => 'USER',
1550
                     //required, field name about original user id
1551
              'firstname' => 'Christian',             //required
1552
              'lastname' => 'XXX',                    //required
1553
              'username' => 'usuario1',               //required
1554
              'password' => '12345',                  //required
1555
              'email' => 'XXX@gmail.dom',
1556
                     //optional, follow the same format (example@domain.com)
1557
              'status' => '5',
1558
                     //optional, (1 => teacher, 5 => learner)
1559
              'phone' => '12345678',                  //optional
1560
              'expiration_date' => '0000-00-00 00:00:00',
1561
                     //optional, follow the same format
1562
              'extra' => array (
1563
                     //optional, extra fields about user's extras data,
1564
                     // you can insert several extra fields
1565
                     array('field_name' => 'direccion',
1566
                            'field_value' => 'Arquimedes 260'),
1567
                            // field name with your field value
1568
                     array('field_name' => 'DNI',
1569
                            'field_value' => '416766220')
1570
                            // field name with your field value
1571
              ),
1572
              'secret_key' => sha1('123')
1573
                     //required, secret key ("your IP address and security key
1574
                     // from dokeos") encrypted with sha1
1575
           );
1576 4 Yannick Warnier
</pre>
1577 1 Yannick Warnier
Output params
1578
A string about result:
1579 4 Yannick Warnier
<pre>
1580 1 Yannick Warnier
          -1 - Secret key is incorrect
1581
            1 - If the operation is OK
1582
          0 - If the operation has failed
1583 4 Yannick Warnier
</pre>
1584
h3. DokeosWSDeleteUser
1585 1 Yannick Warnier
1586
This function only disable only a user into dokeos, if you want delete from database you
1587 2 Yannick Warnier
can delete it from user list into your dokeos portal
1588
Input params
1589
Follow the new structure:
1590 4 Yannick Warnier
<pre>
1591 1 Yannick Warnier
$params =
1592
       array(
1593
               'original_user_id_name' => 'USER',
1594
                     //required, field name about original user id
1595
               'original_user_id_value' => '1',
1596
                     //required, field value about original user id
1597
               'secret_key' => sha1('123')
1598
                     //required, secret key ("your IP address and security key
1599
                     // from dokeos") encrypted with sha1
1600
             );
1601 4 Yannick Warnier
</pre>
1602 1 Yannick Warnier
Output params
1603
A string about result:
1604 4 Yannick Warnier
<pre>
1605 1 Yannick Warnier
          -1 - Secret key is incorrect
1606
            1 - If the operation is OK
1607
          0 - If the operation has failed
1608 4 Yannick Warnier
</pre>