Problems with IoT application tokens

USQL
USQL Posts: 3
edited April 2023 in IoT Forum

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?

Tagged:

Best Answer

Answers

  • mircea_c
    mircea_c Posts: 146 Staff member 🤠

    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

  • USQL
    USQL Posts: 3

    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