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?
Forgot to mention that all requests come from localhost
Hm.. got it working by using file_get_contents() instead of CURL. Weird...