Project

General

Profile

Web services » History » Version 6

Yannick Warnier, 30/06/2010 03:24

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