Jump to content

Recommended Posts

Posted (edited)

Some time ago I start some topic about TeamViewer API

'?do=embed' frameborder='0' data-embedContent>>

Now I have some working example.

Here it is:

#Include "TeamViewer_Common.au3"

;##############
; Configuration
;##############

; API access $v_Token
Local $s_TV_AccessToken= "" ;<-- your access $v_Token, can be left empty when OAuth (below) is configured.

; OAuth: API client id & $s_AuthorizationCode
Local  $i_ClientId, $s_AuthorizationCode
; if all variables are set here, OAuth will be used to request an access $v_Token
$i_ClientId = ""               ;<-- Create an app in your TeamViewer Management Console and insert the client ID here.
$s_ClientSecret = ""            ;<-- Insert your client secret here.
$s_AuthorizationCode = ""      ;<-- Visit https://webapi.teamviewer.com/api/v1/oauth2/authorize?response_type=code&client_id=YOUR$i_ClientIdHERE
                            ;    Login, grant the permissions (popup) and put the code shown in the $s_AuthorizationCode variable here
; export filename
Local $s_FileFullPath_ExportFileNameConnections = @ScriptDir & "\exportConnections.csv"

; Keys which are the columns in den exportConnections.csv
; All possible keys are: id, userid, username, deviceid, devicename, groupid, groupname, start_date, end_date, fee, currency, billed, notes
Local  $s_ConnectionKeys = "username, userid, fee, notes"
Local  $s_ColumnNames = "User name, User ID, Fee, Notes"
Local  $s_LineBreakReplacement = " "


;#########
; includes
;#########


;###########
; Functions
;###########

; Writes a given array of dictionaries to a CSV File with the given filename

;####################
; Main: Export Users as CSV
;####################
; Set locale to US English because fee values are in this format

;check OAuth requirements
If _TV_PingAPI($s_TV_AccessToken) = true Then
;ping API to check connection and $v_Token
    Local $v_ResultConnections

    ;fetch all connections
    $v_ResultConnections = _TV_GetAllConnectionsAPI($s_TV_AccessToken)
    ;write to csv

    MsgBox(0, '$v_ResultConnections', $v_ResultConnections)
Else
    MsgBox(0, '', "No data exported. $v_Token or connection problem.")
EndIf

REQUIRMENTS:

  1. AutoIt 3.3.10.2 ++
  2. TeamViewer_Common.au3 (attached below)
  3. JSON.au3
  4. Native Windows JSON for Auto IT plus OO

HOW TO:

setup this variable

Local $s_TV_AccessToken= ""

and run .......

 

REMARKS:

Still working on it, yet it is only a modest beginning.

For now it is only _TV_PingAPI()  and _TV_GetAllConnectionsAPI()

REMARKS 2:

OAuth: not working yet - please use $s_TV_AccessToken

 

EDIT> BTW:

I know that for now here is a bit of a mess in the UDF :(

TeamViewer_Common.au3

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 1 month later...
  • 1 year later...
Posted (edited)

New Version (still only example ---> this is not full UDF):

REMARK:
For JSON   I use   Chilkat v9.5.0.63   32Bit    (this is Free - I mean Chilkat JSON component - check Chilkat license)
https://www.chilkatsoft.com/downloads_ActiveX.asp
https://www.chilkatsoft.com/refdoc/activex.asp

 

Look in  TeamViewer.ZIP attachment for example showing how to get ConnectionList.
 

EDIT:
http://www.chilkatforum.com/questions/1306/is-the-chilkat-upload-component-freeware

  Quote
0

Yes, the Chilkat Upload component (i.e. the CkUpload C++ class, the CkoUpload Objective-C class, the Chilkat.Upload .NET class, etc. ) is freeware. Except for the individual ActiveX downloads, the Chilkat downloads contain a mixture of both freeware and commercial classes. The freeware classes are marked in the reference documentation (such as here: http://www.chilkatsoft.com/refdoc/csharp.asp ) with a green colored "(F)". Many of the freeware classes are supporting classes used by multiple non-freeware classes (such as Chilkat.Cert). The freeware classes do not need to be unlocked, nor do they expire.

Expand  

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 11/6/2016 at 10:13 PM, mLipok said:

New Version (still only example ---> this is not full UDF):

REMARK:
For JSON   I use   Chilkat v9.5.0.63   32Bit    (this is Free - I mean Chilkat JSON component - check Chilkat license)
https://www.chilkatsoft.com/downloads_ActiveX.asp
https://www.chilkatsoft.com/refdoc/activex.asp

 

Look in  TeamViewer.ZIP attachment for example showing how to get ConnectionList.
 

Expand  

REQUIRMENTS:  link is dead, can you fix this? :D

Posted
  On 11/8/2016 at 4:09 PM, WormIT said:

REQUIRMENTS:  link is dead, can you fix this? :D

Expand  

??
Which one ?

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
;~ #include "OO_JSON.au3"
;~ #include "JSON.au3"
#include "TeamVierwer_JSON.au3"

I'm not using this anymore.
I make my own "Pseudo UDF" called  "TeamViewer_JSON.au3"

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Just for this who's wondering: "If I can use it ?"

Resource link: http://www.chilkatforum.com/questions/1306/is-the-chilkat-upload-component-freeware

 

  Quote

Is that mean for example in ActiveX version, JSON object can be used in commercial application without commercial license ?

I want to ask if you can add some remark/descripion about Freeweare to this followed URL document:https://www.chilkatsoft.com/licensingExplained.asp

link|edit|delete|more ▼

answered 2 hours ago

mLipok's gravatar image

mLipok

Expand  

 

  Quote

Yes, that is correct. The JsonObject and JsonArray are freeware classes and may be used in commercial applications without the need to purchase.

answered 24 mins ago

chilkat's gravatar image

chilkat ♦♦

Expand  

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 2 months later...
Posted

Finally:

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...