Set permissons via API

Hi there!

I’m developing a tool which reads users from a database, creates them in Nextcloud, sends them an email (with the link to the Nextcloud instance, username and pw).
Then the tools creates a folder for each new created user in the Admin enviroment and shares this folder with the appropriate user.
I create everything (user, folder, share) via the api.

First of all, most is working perfectly but …

When the tool creates the share, the tool sends following command to the server:


This command creates the share but with the wrong permissons. I want to create the share in ReadOnly (see permissons=1) but the created share has got the permissons=31 (it’s default value). So the user can do everything.

Something similar happens when creating the users.
This commands creates the new user:


This actually will create the user with it’s password, but won’t set the email address.

What’s wrong with my POST values?

I write the tool in C# and to communicate with the server I use a HttpWebRequest Object. I write the POST values as you can see to the URL and send it to the server.

What I am missing? Where is my error?

Thanks a lot!