WebService createUser

Do you want to create a native client or integrate with third party applications: webservices are the solution.

Moderator: car031

saidmsl
Posts: 10
Joined: Wed May 04, 2016 5:10 am

WebService createUser

Wed May 04, 2016 7:40 pm

Hi,

does anyone have a working code for adding an user?
i just get :
Fault occurred while processing.
agaspa
Posts: 714
Joined: Tue Apr 20, 2010 8:24 am

Re: WebService createUser

Thu May 05, 2016 8:22 am

Hi said,
Which programming language are you using?
Can you tell me the exact version nuomber of LogicalDOC you have installed?
Br
Alex
saidmsl
Posts: 10
Joined: Wed May 04, 2016 5:10 am

Re: WebService createUser

Thu May 05, 2016 4:34 pm

Hi,

i'm using LD 7.4.2
i'm using Php (sorry , was assuming it's clear)

i was able to create an user finally the only thing i do not understand it's the groups :

$user['groupIds'] = (object)array(2);

the user is created as an admin and cannot change the group (it's disabled)

i just want to add it to normal users : author, publisher

what is the right way for this?

Rgds
agaspa
Posts: 714
Joined: Tue Apr 20, 2010 8:24 am

Re: WebService createUser

Tue May 10, 2016 10:20 am

Hi Said,
the ID of Author group is 2, the ID of the group Publisher is -10000

so your code should be:

Code: Select all

  
// set the group memberships
$usr ['groupIds'] = [2, -10000]; // Author and Publisher
See also the attached package
Attachments
security-addUser.zip
create a new user adding it to the specified groups
(61.2 KiB) Downloaded 678 times
saidmsl
Posts: 10
Joined: Wed May 04, 2016 5:10 am

Re: WebService createUser

Tue May 10, 2016 5:03 pm

Thanks

it works

but there is a bug in the declaration, the code should be :
$usr['groupIds'] = array(2,-10000);
agaspa
Posts: 714
Joined: Tue Apr 20, 2010 8:24 am

Re: WebService createUser

Tue May 10, 2016 6:29 pm

It works with PHP 5.4.43
saidmsl
Posts: 10
Joined: Wed May 04, 2016 5:10 am

Re: WebService createUser

Tue May 10, 2016 7:00 pm

not with php 5.3

Return to “Web Services”

Who is online

Users browsing this forum: No registered users and 8 guests