Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) Dropbox: Get Space UsageDemonstrates how to get the Dropbox space usage information for the current user's account. For more information, see https://www.dropbox.com/developers/documentation/http/documentation#users-get_space_usage
; This example requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oRest = ObjCreate("Chilkat.Rest") ; Connect to the www.dropbox.com endpoint. Local $bTls = True Local $iPort = 443 Local $bAutoReconnect = True Local $bSuccess = $oRest.Connect("api.dropboxapi.com",$iPort,$bTls,$bAutoReconnect) If ($bSuccess <> True) Then ConsoleWrite($oRest.LastErrorText & @CRLF) Exit EndIf $oRest.AddHeader("Authorization","Bearer DROPBOX-ACCESS-TOKEN") Local $sResponseStr = $oRest.FullRequestNoBody("POST","/2/users/get_space_usage") If ($oRest.LastMethodSuccess <> True) Then ConsoleWrite($oRest.LastErrorText & @CRLF) Exit EndIf ; Success is indicated by a 200 response status code. If ($oRest.ResponseStatusCode <> 200) Then ; Examine the request/response to see what happened. ConsoleWrite("response status code = " & $oRest.ResponseStatusCode & @CRLF) ConsoleWrite("response status text = " & $oRest.ResponseStatusText & @CRLF) ConsoleWrite("response header: " & $oRest.ResponseHeader & @CRLF) ConsoleWrite("response body (if any): " & $sResponseStr & @CRLF) ConsoleWrite("---" & @CRLF) ConsoleWrite("LastRequestStartLine: " & $oRest.LastRequestStartLine & @CRLF) ConsoleWrite("LastRequestHeader: " & $oRest.LastRequestHeader & @CRLF) Exit EndIf $oJsonResponse = ObjCreate("Chilkat.JsonObject") $oJsonResponse.Load($sResponseStr) $oJsonResponse.EmitCompact = False ConsoleWrite($oJsonResponse.Emit() & @CRLF) ; { ; "used": 3032115, ; "allocation": { ; ".tag": "individual", ; "allocated": 2147483648 ; } ; } ; |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.