Problem authenticating with POST Request

(Boxhammer Michael) #1

Hello everyone,

we are currently facing a problem with authentication of out POST Requests. We cannot seem to authenticate via the token_auth parameter. We always get a “not authenticated” reply (html code of the matomo login screen).
We tried every possible authentication method.

Can someone hep us with this? We couldn’t find a solution anywhere for this. This is for a larger request we have to send via POST.

Thanks in advance for your help.

(Lukas Winkler) #2


For me the following does work:

curl --data "module=API&method=UsersManager.getUsers&token_auth=THETOKEN" -v http://dev.matomo/index.php

How are you making POST requests?

(Boxhammer Michael) #3

We are making the requests serverside with standard server-side POST and GET Requests.

With curl it would look something like this:

curl -d "module=API&method=API.getBulkRequest&format=json&token_auth=TOKEN&urls[0]=URLOFREQUEST" -H "Content-Type : application/json; charset=UTF-8, Content-Length: 'content length param' " -X POST "url of matomo"

But it doesn’t work with any type of POST request (url does not really matter). According to documentation, this should work as well as simple GET Requests.

(Lukas Winkler) #4

In that case I’d recommend you to try it out with curl to see if it works in theory.

Matomo doesn’t differentiate between POST and GET parameters as far as I know.