Retrieve new data from API

Hi all, I am wanting to retrieve dynamic data from the Glide App API. We have business plan, so should have access to advance API. At the moment, this is what I have done:

r = requests.post(
    "https://api.glideapp.io/api/function/queryTables",
    headers={"Authorization": "xxx"},
    json={
        "appID": "xxx",
        "queries": [
            {
                "tableName": "xxx",
                "utc": True
            }
        ]
    }
)

This however gives me all rows for the table. Is there a way to only retrieve certain rows (e.g. rows > date) so that I can re-run the code regularly (e.g. daily) and only add new rows for export?

Thanks in advance,
Skye

Is it a Big Table? If it is, you can do a query based on this section.

Hey @skye ,

I hope this will help you.

I got help from @Darren_Murphy and did some digging around and found this is the way to do it.

curl --location 'https://api.glideapp.io/api/function/queryTables' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxxxxxxxx' \
--data '{
  "appID": "xxxxxxxx",
  "queries": [
    {
      "sql": "SELECT * FROM \"native-table-taableid\" WHERE \"FetchData?\" = TRUE"
    }
  ]
}'

The above curl is for me to filter and get API response when my column with name “FetchData?” has boolean checked meaning “True”

You can use this as benchmark. What I observed was the format of using \ or / and " or " before and after column name or table name is important to get desired output.

Hope this helps.

Regards,
Dilip

Thank you for your help! This is great :slight_smile:

1 Like

Hopefully it solved your case! Let us know if you need anything further.