תיעוד API של Discourse. לא מוצא את הפרמטר שנשלח.

סיכום מבוסס בינה מלאכותית

A user, Drew-ART, is trying to pull stats from the Admin area into an external site using the Discourse API. They are having trouble finding the “parameter sent” in the request. RGJ explains that the parameter(s) sent can be found after the “?” in the request URL, split by “&”, and then split by “=” into name/value pairs. RGJ provides a breakdown of the example, replacing URL-encoded characters with their plain text equivalents. Drew-ART finds this explanation helpful.

Hi, i’m trying to pull some stats from the Admin area into an external site.

I’ve been following the ‘reverse engineering guide’ but i’m unable to identify where to find required item 3, the parameter sent.

I’ve ‘inspected element’ on the total number of page views.

I had to search through a few names as all the elements are the network > fetch/XHR tab, but after clicking on a few i found one which mentioned ‘consolidated page views’ in it

Item two, the payload method is ‘GET’

Item 1, the request url is at the top

Where would i find item 3, the parameter sent?

For clarity, that text means “the parameter(s) that were sent”, not “the parameter named sent”

The parameter(s) can be found after the ?, so reports%5B...... very long .... 2021-01-24,
Then split them by &
And then you have name/value pairs split by =

You accidentally picked a complex example with lots of parameters, you can replace %5B with [ and %5D with ]

So in this example

  • reports[consolidated_page_views][facets] → past_period
  • reports[consolidated_page_views][start_date] → 2021-12-24

and so on.

Thank you, that’s very helpful :slight_smile: