API v2 - Admin provisioning: create user

Hello,

I’m trying to create a user by the following command:

curl -u admin:password -X POST -F 'resourceType=user' -F 'userPass=password' --url "http://url.it/api/v2/admin/people/group/subgroup/newUser"

curl -u admin:password -X POST --url 'http://url.it/api/v2/admin/people/group/subgroup/newUser?resourceType=user&userPass=password'

with both commands, the answer is always this:

<?xml version="1.0" encoding="UTF-8"?><tree ><reload_instruction object="data" node="" file=""/><message type="SUCCESS">Gruppo creato con successo</message></tree>

which means “group created successfully”. Why is the group created instead of the user?

Thanks in advance and sorry for my english ;p

Hi,
did you use this part of the api.v2 guide ? https://pydio.com/en/pydio-api-v2#!/Provisioning/createPeople

then you should have something that will look like this

Hi,

thanks for your reply. I’ve run this command now:

After the first command, nothing happen. After the second, “Group succesfully created”…why!? :weary:

Yes it’s a strange behavior i had the same message displaying when i was testing it,
i will ask the devs about it.

Oh ok, glad to know that.
Do you know if there are other ways to create users via scripts?

Hello,
no news about this thread?

EDIT: maybe @charles can help me? :pray:

Hi,

You can also create user from this endpoint.

http://@HOST/pydio/api/ajxp_conf/create_user/yournewusername/yournewuserpass

Pass the Authorization as admin

Thank you! In this way it works.
Just another question, how can I also pass the group path in which the user will be created?

Thanks again

EDIT: I tried with:
curl http://admin:pass@url.it/api/ajxp_conf/user_update_group/file/group_path+?file=newuser&group_path=%2Fgroup%2Fsubgroup

but return “No users moved. Something went wrong!”. Any ideas?

Hi try this

{{url}}/api/ajxp_conf/user_update_group/{{user}}{{group_role_id}}?format=json

Great, it works! :wink:
Thanks!