Trying to use the API to create a site


(Rainer) #1

Hi,

I’m trying to use curl to create a new site.

curl -v --data “?module=API&method=SitesManager.addSite&siteName=test.site&urls=http://www.test.site&timezone=CET&currency=CHF&format=xml&token_auth=bla” https://myserver/matomo/

I get a code 302 from this, with a redirect

location: index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday

Is there a way to see what has gone wrong?

Using v3.8.1 on PHP 7.3.


(Lukas Winkler) #2

Hi,

I’m pretty sure the --data parameter of curl shouldn’t start with ?.