link icon
Ask The Community

TeamViewer is one of the winners of the European Customer Centricity Award 🥳

Please find more information here.

Quick help on how to get going with Python?

Hi all,

I'm a beginner when it comes to coding, and I've never used the TeamViewer API before.

Could someone help me just to get started with the API in Python, and show me some code example on how to lets say create / list all sessions?

I created an app, and got a client id and client secret.

Here's a little sample:


import requests

client_id = 'XXXX-XXXXXXXX'
clientt_secret = 'XXXXXXXXXXXX

url='base_url =''

headers = {"content-type": "application/json", "Authorization": "Bearer "+client_id}

test = requests.get(base_url+'sessions', headers=headers)

All I get is <Response [401]>.

If someone could provide a short example just to get my going, that would have been great.