Invalid API Key ONLY for tables query


I’ve been able to use my api key to query reports, report, and events but get:

‘status’: 401, ‘error’: ‘Invalid key specified.’

when I try to query tables. Any idea what is causing this?


Do you have an example URL that is failing?


Yeah, that would be good to add… :stuck_out_tongue:

Using python and the requests library. This worked:
requests.get(“” + key)

This did not:
requests.get(“‘damage-taken’/VhmB61LqvrRQPFwJ?end=9201998?api_key=” + key)

I have been using the developer site to generate the urls.


You have a ? in front of api_key that should be a &


Hmm, ok, the error message changed! I did:
requests.get(“‘damage-taken’/VhmB61LqvrRQPFwJ?start=1511926903194&end=9201998&api_key=” + key)

And got:
{‘status’: 400, ‘error’: ‘Invalid command specified.’}

I think I’m missing a required parameter for the link?

Edit: I also tried the & on a request that had previously worked, and that resulted in the ‘invalid key’ error.


So I’ve worked out that the issue is with query fields in general.

So if I do:
requests.get(“” + api_key)

with no queries attached, then everything works fine. However, I have been unable to get any version that includes a query to work. e.g.

requests.get(“‘hps’&api_key=” + api_key)

does not work and I get the following details:
{‘status’: 400, ‘error’: ‘Invalid metric specified.’}

Is there something that I am doing wrong with either the query or the use of the link?

Edit: Hmm, just noticed that the query, when posted here does actual ’ around the hps, however, when I’m looking at the link it’s giving me %27 - with this make a difference?

Nvm! Worked it out, need to remove the quotation marks from the query info