Discourse API Reports

Hello!
I am trying to use the reporting functionality found in the Discourse api via a node app on a different server.

When I issue my requests (whether on the server or in postman) I get a 404 that the url was not found?

Is this function depreceated or still around? Can’t seem to figure it out.

http://docs.discourse.org/#tag/Reports%2Fpaths%2F~1page_view_total_reqs%2Fget

Do we need to rebuild the docs.discourse.org site @blake?

1 Like

No the doc site is working just fine, but the url for that endpoint may have been documented wrong :blush:.

@jordan1909 can you try hitting this endpoint on your site?

Looks like you will need to include /admin/reports and all correct params

5 Likes

@blake

So this works in my browser but I need to get the JSON data back for usage elsewhere and everytime I issue the query anywhere else I get a raw dump of the page?

Any idea what I’m missing? Issuing a GET request here.

Postman URL

Try adding .json to the end of the URL

5 Likes

@david

I :heart: you

3 Likes

I had previously marked this as solved however if I execute the request via Postman or in an Ajax query I am getting a 404. Is this available to the api for external calls? Am I missing something?

Does anyone have an example of getting this value via an Ajax request or even Postman?

Are you including an API key in your postman request?

@david

Clearly I have been staring at my screen too long. :man_facepalming:

I take it the value is api_key not ap_key.

I’ll go hide in the corner and think about what I’ve done.

3 Likes

This topic was automatically closed after 2424 days. New replies are no longer allowed.