Jump to content

Recommended Posts

Posted

This is TeamViewer.au3 UDF for TeamViewer API.

; #INDEX# ========================================================================
; Title .........: TeamViewer.au3
; AutoIt Version : 3.3.10.2++
; Language ......: English
; Description ...: A collection of function for use with TeamViewer API
; Author ........: mLipok
; Modified ......:
; URL ...........:
; URL ...........: https://www.teamviewer.com/
; URL ...........: https://www.teamviewer.com/en/integrations/
; URL ...........: https://integrate.teamviewer.com/en/develop/api/get-started/
; URL ...........: https://downloadeu1.teamviewer.com/integrate/TeamViewer_API_Documentation.pdf
; Remarks .......: This UDF was created based on TeamViewer_API_Documentation.pdf v 1.4.1
; Remarks .......: This UDF is using Free Chilkat component look here https://www.autoitscript.com/forum/files/file/433-chilkat-udf/
; Remarks .......: Documentation is "work in progress"
; Date ..........: 2017/02/08
; Version .......: 0.1.1 BETA - Work in progress
; ================================================================================

in TeamViewer_Example.au3 you can see few examples:

 

Func _Example()

    ; If not exist then create new INI file from template
    If Not FileExists('TeamViewer_Example.ini') Then FileCopy('TeamViewer_Example — Template.ini', 'TeamViewer_Example.ini')

    ; Read Access Token from INI
    Local $sTV_AccessToken = IniRead('TeamViewer_Example.ini', 'Settings', 'AccessToken', '')
    If $sTV_AccessToken = '' Then
        ; Your Access Token, can be left empty when OAuth (below) is configured.

        ; ClientId = <----------------- Create an app in your TeamViewer Management Console and insert the client ID to the INI
        ; ClientSecret = <------------- Insert your client secret to the INI
        ; 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 AuthorizationCode variable to the INI

        Local $sTVOAuth_ClientID = IniRead('TeamViewer_Example.ini', 'OAuth2', 'ClientID', '')
        Local $sTVOAuth_ClientSecret = IniRead('TeamViewer_Example.ini', 'OAuth2', 'ClientSecret', '')

        _IECreate('https://webapi.teamviewer.com/api/v1/oauth2/authorize?response_type=code&client_id=' & $sTVOAuth_ClientID)
        ; Local $sTVOAuth_AuthorizationCode = IniRead('TeamViewer_Example.ini', 'OAuth2', 'authorizationCode', '')
        Local $sTVOAuth_AuthorizationCode = InputBox('AuthorizationCode', 'Please provide TV OAuth2 AuthorizationCode')
        If @error Then Return

        If $sTVOAuth_ClientID Then $sTV_AccessToken = _TVAPI_RequestOAuth2_AccessToken($sTVOAuth_ClientID, $sTVOAuth_ClientSecret, $sTVOAuth_AuthorizationCode)
    EndIf

    If $sTV_AccessToken Then _TVAPI_AccessToken($sTV_AccessToken)

    If _TVAPI_Ping() = True Then ; ping API to check connection and $sTV_AccessToken
        _Example_TeamViewer__1_Devices_SaveToFile()
;~      _Example_TeamViewer__2_Devices_ChangeDetails()
;~      _Example_TeamViewer__3_Devices_GetDevicesSingleID()
;~      _Example_TeamViewer__4_Reports_GetAllConnections()
;~      _Example_TeamViewer__5_Users_GetUserInfomation()
;~      _Example_TeamViewer__6_Groups_ListGroups()
;~      _Example_TeamViewer__7_Devices_AddDeleteDevice()
    Else
        MsgBox(0, '_TVAPI_Ping', "$v_Token or connection problem.")
    EndIf
EndFunc   ;==>_Example

You can download it here:

I'm using TeamViewer_Example.ini to store my secret tokens/keys.

[Settings]
AccessToken=

[OAuth2]
ClientID=
ClientSecret=
authorizationCode=

 

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

Please comment and use of course.
Maybe you found some bugs/issues.
 

Please for your understanding, because this is only BETA version of this UDF, and will be BETA until the finish to add other functions and do not complete the documentation ...... With the latter is the most difficult :) 

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 2/8/2017 at 3:47 AM, BetaLeaf said:

Really cool UDF. This will be very helpful in my future projects. Thanks!

 

Sidenote: Is this in the wrong section? Shouldn't this be posted in https://www.autoitscript.com/forum/forum/9-autoit-example-scripts/ where UDFs belong?

Expand  

Thanks.

As to you Sidenote:
No.
This is proper forum, as I need your cooperation in this BETA project :)

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 2/8/2017 at 3:48 AM, meoit said:

@mLipok - Thanks for update.

Expand  

You welcome.

 

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 weeks later...
Posted

Hey @BetaLeaf , @meoit and @Danyfirex , do you have any further comments, maybe some concepts ?

btw.
I was working in the background on this UDF and I have plan to update it next week.

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

  • 4 months later...
Posted

Hi

Just downloaded this.

Teamviewer.au3 contains this

#cs
    v0.1.1 BETA
    2017/02/08
    .   First official version - mLipok


    @LAST
#ce

The following:

#include "TeamVierwer_JSON.au3"

Can't open... Where do I get this file?

Also requires Chilkat UDF which was easy to find.

Perhaps an index of all required files in the first post?   

Skysnake

Skysnake

Why is the snake in the sky?

  • 2 weeks later...
Posted
  On 7/8/2017 at 2:56 PM, Skysnake said:

#include "TeamVierwer_JSON.au3"

Expand  

Just comment this line as this is not needed anymore.

  On 7/8/2017 at 2:56 PM, Skysnake said:

Also requires Chilkat UDF which was easy to find.

Expand  

Yes this is easy to find:

 

 

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...