Accessing Private Data [reportData] in Object - api/processed_report via Curl in PHP

Hello, Forum. I’m currently at a loss for ideas and hoping for a nudge in the right direction.

Here’s the issue:

I’m coming from GA but want to recreate my PHP script with Matomo. It’s a list of the top posts of today to display on the website, automated via PHP and Curl, regenerated three times an hour.

I successfully generated that data, and it works when I do it manually, as I am recognized as logged in. But when I call that script via Curl, I, understandably, get the Matomo error that I need to be logged in.

I created an application password and used that in the Curl call, which was successful, but [reportData] in the returned object is empty, as I believe it is marked as private. (This should have the rows of data for the pages by pageviews.)

empty

I’m not sure what to do now, as I thought authenticating myself with the Wordpress application password would be enough to get access.

Is there a way to get that data? If so, can you give me a hint as to how?

Thank you for your time.
Jo

Hi @Johna_Timmeth
Is it possible for you to add an authentication token to the endpoint?

It’s Matomo for Wordpress, so sadly no token.

Hello @Johna_Timmeth Yes, you are correct. Matomo for WordPress doesn’t support our HTTP API but instead supports the WordPress REST API.