Issue with the "addSite" API-Call


(Scheinkultur) #1

Hi,

maybe i forgot something, but when i call the API with:
http://XXXXXXXX/piwik/index.php?module=API…ebsite&urls[0]=http://example.org&urls[1]=http://example-alias.org

i get an:
“You can’t access this resource as it requires a ‘superuser’ access.”

Unfortunately, the user i took the token_auth from is definitly declared as “administrator” fot “all” websites…

Any ideas? I tried a lot already but maybe i forgot something?
btw. creating a new site with the frontend works…

Thanks!


(vipsoft) #2

token_auth comes from the dashboard.

It’s not the hashed password in config.ini.php.


(Scheinkultur) #3

[quote=vipsoft @ Jul 27 2009, 04:08 PM]token_auth comes from the dashboard.

It’s not the hashed password in config.ini.php.[/quote]

i took it from the dashboard… from a new user which i assigned to be an “administrator”-user for all websites

any other ideas? style_emoticons/<#EMO_DIR#>/smile.gif


(vipsoft) #4

It has to be the superuser, not just someone with admin access.

Admins are given access over specific websites. Existing admins have no access to a site yet to be created.


(havard) #5

I struggeled with the same thing for long, but for me I simply had mistyped the parameter as “auth_token” instead of “token_auth”. style_emoticons/<#EMO_DIR#>/biggrin.gif

The superuser token_auth which vipsoft refers to can be found in the Piwik web interface on the API page: http://<yourserver+pathToPiwik>/piwik/index.php?module=API&action=listAllAPI&idSite=1&period=day&date=yesterday


(Neoh59) #6

Hi,

I’m a beginner with Piwik. I have read the FAQ and see that only the superuser can create users and sites.
I don’t understand, when I’m logged with non-superuser :
the link to add a user is not displayed in the tab “Users” => I agree
the link to add a site is displayed in the tab “Sites” and if I try to add a site I have the message “it requires superuser access” => I disagree

Why the link to add a site is displayed if I’m not the superuser ? (perhaps there is a good reason)

Thank you

Neoh

PS: Sorry for my poor english.


(Matthieu Aubry) #7

This is a bug, I created a ticket: http://dev.piwik.org/trac/ticket/1053