teamviewer.com link icon
or
Ask The Community

Example of a Connection Report using API call

Hi,

I have a working powershell script to pull a list of all of our endpoints.

-----------------------------------------------

$token = Read-Host -Prompt "Enter your API account token now"

$bearer = "Bearer",$token

$header = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"

$header.Add("authorization", $bearer)

$request = Invoke-RestMethod -Uri "https://webapi.teamviewer.com/api/v1/devices" -Method Get -Headers $heade

$request.devices | Select-Object -Property "remotecontrol_id","alias","online_state","last_seen","groupid" | Export-Csv "C:\TVDevicesListExport.csv"

-----------------------------------------------------


I need to call /api/v1/reports/connections to download a .csv of the default connection report generated for a group. 

For example, I go the Tensor Portal, click on desired group, then click 'Connection Reports' and export to .CSV. That is my end goal and I want to do that programmatically. If anyone has an example of generating a connection report using the TeamViewer API, that would be very helpful. +1 if you're doing it using Azure Functions or something similar.

Answers

  • Akiho
    Akiho Posts: 730 Moderator
    edited October 2021

    Hi @Test3713,

    Thank you for contacting us, and welcome to the Community.

    If you are urgent, please kindly to contact Support Team directly. So that Support Team may assist you further.

    Thank you for your understanding and patience.

    Best Regards,

    Akiho


    Japanese Community Moderator / コミュニティモデレーター

  • RomanTechs
    RomanTechs Posts: 1 Newbie
    edited September 2021

    Hi @Akiho_S , I messaged you ticket ID

    I was not able to get an example for pulling a connection report via API from the TeamViewer support team. If you can direct this ticket to the correct person, that would be appreciated. Thank you.