• Hi

    I’m trying to retrieve data via the Slimstat REST API but am getting errors when I use the “&&&” operator as part of the filter. I’m using the code below to generate the URL:

            $params = [
                'token'     => $token,
                'function'  => 'count',
                'dimension' => 'id',
                'filters'   => 'month equals 7&&&year equals 2022'
            ];
    
            $link = "{$url}wp-json/slimstat/v1/get?" . http_build_query($params);

    The request works fine if I simplify the condition to “month equals 7”.

    Can you please tell me the correct way to specify the and condition in this context.

    • This topic was modified 2 years, 7 months ago by gryphon26.
    • This topic was modified 2 years, 7 months ago by gryphon26.
    • This topic was modified 2 years, 7 months ago by gryphon26.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jason Crouse

    (@coolmann)

    Hi,

    what kind of error do you get?

    Jason

    Thread Starter gryphon26

    (@gryphon26)

    Hi Jason, thanks for the reply. Sorry, I’ve just realised I didn’t explain the error.

    Basically the number that is returned does not reconcile to the statistics shown from within Slimstat. It does not seem that the filters above are being applied.

    What I am ultimately trying to do is retrieve a count of unique human IP addresses between two specified dates. Can you please tell me the correct function/dimension/filter syntax to achieve this.

    Thanks so much for the help (and awesome plugin).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Correct REST API url for ‘and’ in filters’ is closed to new replies.