Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API requests always return login form #13723

Closed
gplcart opened this issue Nov 17, 2018 · 2 comments
Closed

API requests always return login form #13723

gplcart opened this issue Nov 17, 2018 · 2 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@gplcart
Copy link

gplcart commented Nov 17, 2018

Hello
Trying to create a new website using API.
The GET request looks like so:

GET /analytics/index.php HTTP/1.0
Host: my-site.com

module=API&method=SitesManager.addSite&format=json&siteName=teste&urls%5B0%5D=http%3A%2F%2Ftest.com&token_auth=MY_KEY

The query returns HTML code of login form. I also tried to use other methods from https://developer.matomo.org/api-reference/reporting-api#SitesManager with the same result

Seems like a permission problem.

How to solve this?

@gplcart
Copy link
Author

gplcart commented Nov 17, 2018

Forgot to mention that all requests come from localhost

@gplcart
Copy link
Author

gplcart commented Nov 17, 2018

Hm.. got it working by using file_get_contents() instead of CURL. Weird...

@gplcart gplcart closed this as completed Nov 17, 2018
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants