Tables : Get Rows API error: API Key cannot query tables

Greetings everyone.
I’ve just started building a quite simple application in which I created a table with some fields as “Name”, “Last Name”, among others.

When I try to use the API to get a table’s rows, I get the following error independently of using Bash, Python or JS:
{'message': 'API key cannot query tables'}

I’m using the following python script:

# Get rows requires Business plan or above
import requests

r = requests.post(
    "https://api.glideapp.io/api/function/queryTables",
    headers={"Authorization": "Bearer xxxxxxxxxx"},
    json={
        "appID": "xxxxxxxx",
        "queries": [
            {
                "tableName": "native-table-xxxxxx"
            }
        ]
    }
)
result = r.json()
print(result)

Also, I’m using the following Bash script:

Get rows requires Business plan or above
curl --request POST 'https://api.glideapp.io/api/function/queryTables' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer xxxx-xxxx-xxxx-xxx-xxxx' \
  --data-raw '{
  "appID": "xxxxxx",
  "queries": [
    {
      "tableName": "native-table-xxxxxx"
    }
  ]
}'

Both approaches return exactly the same error as mentioned above.

I’ve tried using another one of the API endpoint, specifically the Add Rows. By using the following python script, I’m successfully able to add rows to my table:

import requests

r = requests.post(
    "https://api.glideapp.io/api/function/mutateTables",
    headers={"Authorization": "Bearer xxxx-xxxx-xxxx-xxxx-xxxx"},
    json={
        "appID": "xxxxx",
        "mutations": [
            {
                "kind": "add-row-to-table",
                "tableName": "native-table-xxxxxx",
                "columnValues": {
                    "Name": "new name by api call",
                    "AGK0b": "new lst name",
                    "Email": "aaa@ubidots.com",
                    "m8C8b": "1993",
                    "Photo": "Photo"
                }
            }
        ]
    }
)
result = r.json()
print(result)

This is the result ( I executed the script twice)

Given the fact that I can add rows to this table, leads me to think that there is nothing wrong with my API key permissions to edit said table. With that in mind, I really can’t tell what am I missing over here regarding this subject. Help is greatly appreciated.

Best regards

Perhaps a silly question, but do you have a Business Plan?

1 Like

I think this might be the likeliest source of the problem, to be honest.

Greetings @Darren_Murphy and @ThinhDinh.

As you mention, I possess a Business Plan.

Then that’s weird. I would suggest submitting a ticket.

Hi Juan, has Glide managed to fix this for you yet? I am having the same issue.

Russ

After implemented the code and had same problem then came here to realize that reading rows doesn’t work in pro plan :neutral_face: and only for wealthy Business plan users, like comon!..

and really, why reading rows is “Advanced API”

I believe that it might cost Glide more to run that, since the standard call will return all rows in the table. It might be costly for them to do that query on the firebase side. Just my guess.

1 Like

yes thats true, but maybe give me raw data (without computed fields) with basic reads as normal API and put full reads with computed columns behind the paywall and that would make more sense to me. I know firebase is pretty generous with their plans in such scenarios

because at then end of the day, I just bypassed glideAPI and went directly to talk to gsheets through googleapis

1 Like