0

Retreiving the contents of a Smart View with Browers Get API

Ian J 2 months ago in API updated by Ben Miller 2 months ago 1

I'm trying to understand how to properly use the Get API functions in the browers class. There is an API call for "Return views detailed information, suitable for browser" but I'm struggling with the returned data. I input my Class Name, View ID, Etc, but it is only returning the filtering information and not the actual information present in the smart view. 

I'd like to figure out how to gain a similar functionality to the "XTRF for Sheets" addon, which works well but is a little slow and pops errors frequently. Any help or insight is greatly appreciated! 

Hi Ian,

the endpoint you want to be using is /browser (returns data in tabular JSON format) or /browser/csv (returns CSV data). How to use these endpoints is explained when you click on the grey Browser heading (see screenshot).

It's a GET request, so all the parameters are supplied as URL parameters, stuff like the view ID, maxRows and of course filters. 2 important things about filters:

  1. Tthe parameter names are the same as if you look at the URL of a filtered view in the browser, except they must be prefixed with `q.` (see documentation).
  2. Using this endpoint ignores any filters set in the view – you must create your own filters when calling the /browser endpoint. You may be able to get the filters stored in the view from a different endpoint, I haven't tried that.

Best,

Ben

Image 2518