HTTP based Request for module UsersManager.addUser - No action taken

Hello :slight_smile:

first of all - great job done guys, Piwik is an awesome product.

Though I’m experiencing a bit of problem with the UsersManager.

My intention is to create from within the existing superUser Account new Users, with each holding also new sites.
In concrete terms, one new User-Account for each of our clients, administered from within our superUser Account.

So, I was trying to build the HTTP Request for the Browser to both create the new User and setting its access.

Try I- pushing both methods into one Request:


http://stats.none-of-ur-biz.de/piwik.php?
&module=API
&method=UsersManager.addUser
&userLogin=test123
&password=test123
&email=my.name@outlook.com
&alias=resa
&method=UsersManager.setUserAccess
&userLogin=test123
&access=view
&idSite=all
&token_auth=dexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxce3

throwing no error, giving also no result.

Try II - 2 separat Requests:

{HTTP REQUEST for adding a new user}

http://stats.none-of-your-biz.de/piwik.php?
&module=API
&method=UsersManager.addUser
&userLogin=test123
&password=test123
&email=my.name@outlook.com
&alias=resa
&token_auth=dexxxxxxxxxxxxxxxxxxxxxxxxce3

{HTTP REQUEST for setting its access rights}

http://stats.none-of-your-biz.de/piwik.php?
&module=API
&method=UsersManager.setUserAccess
&userLogin=test123
&access=view
&idSite=all
&token_auth=dexxxxxxxxxxxxxxxxxxxxxxxxxxxce3

I’m sorry to have to bother you with this, but so far I did not find any clue in the documentation or in forums, that seemed completely useful in my case.

Greets,
Becci

Dear guys,

solved it, but thanks anyways.

The only Problem was in the first row of my HTTP-Request,

http://stats.none-of-your-biz.de/piwik.php?

For the second Example in my posting to work, you need to remove the letters ‘piwik.php’ but leave the ‘?’

so it would look like this:

[b][i]http://stats.none-of-your-biz.de/?[/i][/b]
&module=API
&method=UsersManager.addUser
&userLogin=test123
&password=test123
&email=my.name@outlook.com
&alias=resa
&token_auth=dexxxxxxxxxxxxxxxxxxxxxxxxce3

Server response:

<result><success message="ok"/></result>

hope this can be of assistance for others, since there is no official example in the documentation :slight_smile:

greets from germany

Maybe the tutorial is a bit hard to find, but it’s there: Tutorial: Get your top 10 keywords: Integrate - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

Thanks for posting the answer here!