Add Element to existing Rollup

Hello Matomo Team,

I have an issue, I created a rollup with many elements inside (rollups and sites) through API, my first add request length was about 1750 car.

http://xxxxxxxxxxxx/matomo/?module=API&method=RollUpReporting.addRollUp&name=Directions&timezone=Europe/Paris&currency=EUR&token_auth=xxxxxxx&sourceIdSites[0]=7187&sourceIdSites[1]=7190&sourceIdSites[2]=&sourceIdSites[3]=7193&sourceIdSites[2]=&sourceIdSites[5]=7197....sourceIdSites[69]=7783

Because of url length limitation I have to update it with another request to add the remaining sites I want to track, but when I tried this :

http://xxxxxxxxxx/matomo/?module=API&method=RollUpReporting.updateRollUp&timezone=Europe/Paris&currency=EUR&sourceIdSites[70]=7784&sourceIdSites[71]=7785&format=JSON&token_auth=xxxxx&idSite=8037

I noticed that all measurable added with the first request were deleted…

How can I just add sites/rollup from API to an existing rollup without re-send all datas (impossible because of url length limitation).

Thank you in advance for your help.

Hi,

That’s not really an answer to your question, but you can send all API parameters via POST instead of GET which means the URL length limit doesn’t matter anymore and if you have set up post_max_size high enough you can set gigabytes of sourceIdSites[x]=x.

Hi,

Thanks for your answer, you said to send a POST request but have I to keep send parameters in URL or another format ? If I have to use another format could you give me an example ? I didn’t find this information in API doc.

Where can I set post_max_size value if needed ?

I found the syntax for POST request.

But is it planned to add an API Endpoint to Add or Remove Sites without make a complete reset of the rollup ?

1 Like