Problems with IoT application tokens
Hello, I am trying to receive an IoT application token using the API call:
https://api.teamviewer-iot.com/<token>/[version]/apptokens
where <token> is taken from the TV portal under https://teamviewer-iot.com/en/apikey.
and [version] left out or "v1.0". The API returns:
{'error': {'code': '106', 'desc': 'Error.requested action allowable for owner only.'}}
I am using Python 3.7 and the requests-lib::
...response = requests.get("https://api.teamviewer-iot.com/<token>/[version]/apptokens")...
Revoking the API key using
https://api.teamviewer-iot.com/<token>/[version]/revoke
works fine!
Could you please help me what I am doing wrong?
Best Answer
-
Hi,
I hope this will help.
The token is a permanent token and it won't be expired unless you renew it from the IoT dashboard.5
Answers
-
Hi USQL,
You can select directly 'API KEY' from IoT dashboard (https://teamviewer-iot.com/) after login.
Open the drop-down menu on the top right corner of the page and select 'API KEY'.
Could you tell the use case for getting via the api call ?
Regards
Tech Support IoT
0 -
Hi Mircea,
the use case is a more or less completely automated setup of an edge gateway to run the TeamViewer IoT Agent. So after power-on of the edge gateway, the box should connect to the TeamViewer IoT platform using the API not knowing the current "apllication key" which might change for some reason. In other APIs, it is quite common that a user-based API token, which does not change over time, is used to get a "session token" to use the API.
Regards
0 -
Hi,
I hope this will help.
The token is a permanent token and it won't be expired unless you renew it from the IoT dashboard.5