SatNOGS DB - Telemetry API endpoint

In the latest release of SatNOGS DB, API key authentication is needed for accessing Telemetry API endpoint. If you have scripts using this API endpoint, you need to update them in order to authenticate with API key.

Steps for getting the API key and use it:

  1. Login to https://db.satnogs.org
  2. Click on the avatar of your account at the top right
  3. Select "Settings/API Key
  4. Copy your API Key
  5. Add “Authorization” header on your requests with value “Token <your_API_key>”, for example “Token 1234567890asdfghjkl”
8 Likes

Thansk for the update @fredy, great news. I ll adapt Glouton asap.

Here is an example of python code using the lib requests to make the call :

requests.get(self._url, params=params, headers={'Authorization': 'Token 1234567890asdfghjkl'})
4 Likes

That’s strange… I have tested it with space, as it is noted in REST framework, and works fine. I’ll take a look later to make sure what happens. Thanks!

1 Like

I tought it could be package requests related, but if i print the raw HTTP request, the ‘:’ are in it :slight_smile:

GET /api/observations/?satellite__norad_cat_id=28654&start=2019-04-09T00%3A51%3A54&end=2019-04-13T00%3A51%3A54&page=1&format=json HTTP/1.1
Host: network.satnogs.org
User-Agent: python-requests/2.22.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Authorization: Token:11abcxxxxx

I’ve just tested it in python 2 and 3 and it works only with the space:

>>> import requests
>>> requests.get('https://db.satnogs.org/api/telemetry/?satellite=43784', headers={'Authorization': 'Token:**********************************************'})
<Response [401]>
>>> requests.get('https://db.satnogs.org/api/telemetry/?satellite=43784', headers={'Authorization': 'Token **********************************************'})
<Response [200]>

oh… this is the request on Network Observations endpoint and at least for now it doesn’t need an API token to work. The API token for now is only on DB Telemetry endpoint.

1 Like

Oh, ok , i was thinking that it was made for both my bad :slight_smile: But that’s weird because when i retried to get observations without the auth (that’s why i added it) , it didn’t work, and now, it’s ok … well maybe i miss click or something somewhere sorry.

2 Likes

Would be great to add hint / help link to the API definition: https://db.satnogs.org/api/?format=api about Authentication.

1 Like

Could you please open an issue about it in https://gitlab.com/librespacefoundation/satnogs/satnogs-db/issues. Thanks!