Chamilo-lms: Soap Web Service DeleteUser and Copy Course - Chamilo 1.11.2

Created on 4 Jan 2018  路  3Comments  路  Source: chamilo/chamilo-lms

Consume WS.DeleteUser SOAP

Greetings, I have been trying to consume the webservice to delete users, but I dont fully undertand the parameters needed from this request.

When I call it, the following error appers. I used "die and dump" to view the response log.

image

This is my code:

    if($client!=null){
        $user_id = $account->db_sid;

        $response = $client->call("WSUser.DeleteUser", array(
            'secret_key' => $secret_key,
            //'user_id_field_name' => 'external_user',
            'user_id_value' => $user_id,
        ));
        dd($response); 
        return $response;

    } else {
        return null;
    }

I dont know if the parameter "user_id_field_name" has to be used or not, neither his purpose.

CourseCopy feature

As I have see there is no web service for the copycourse feature, but there are files about it in 'main/coursecopy'.

I would gladly aprecciate if someone could explain me how to make use of this feature, or if it's possible it would be awesome to have the function of copycourse implemented as a Soap Web Service.

Question / Support

All 3 comments

I also need these webservices, if someone have them please share them

I suggest you use main/webservices/registration.soap.php there's an example how to use it here:

https://github.com/chamilo/chamilo-lms/blob/1.11.x/main/webservices/client_soap.php

 $params = [
        'secret_key' => $secret_key,
        'ids' => [
            'original_user_id_value' => $random_user_id,
            'original_user_id_name' => $user_field,
        ]
    ];
    // Delete user
    $result = $client->call('WSDeleteUsers', ['user_ids' => $params]);

Yeah thanks, using the registration.soap.php works like a charm. 馃憤 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sjcqs picture sjcqs  路  6Comments

yourKatharsis picture yourKatharsis  路  7Comments

ghost picture ghost  路  5Comments

aragonc picture aragonc  路  5Comments

annickvdp picture annickvdp  路  4Comments