Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(Excel) 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. Dim rest As Chilkat.Rest Set rest = Chilkat.NewRest ' Connect to the www.dropbox.com endpoint. bTls = True port = 443 bAutoReconnect = True success = rest.Connect("api.dropboxapi.com",port,bTls,bAutoReconnect) If (success <> True) Then Debug.Print rest.LastErrorText Exit Sub End If Dim success As Boolean success = rest.AddHeader("Authorization","Bearer DROPBOX-ACCESS-TOKEN") responseStr = rest.FullRequestNoBody("POST","/2/users/get_space_usage") If (rest.LastMethodSuccess <> True) Then Debug.Print rest.LastErrorText Exit Sub End If ' Success is indicated by a 200 response status code. If (rest.ResponseStatusCode <> 200) Then ' Examine the request/response to see what happened. Debug.Print "response status code = "; rest.ResponseStatusCode Debug.Print "response status text = "; rest.ResponseStatusText Debug.Print "response header: "; rest.ResponseHeader Debug.Print "response body (if any): "; responseStr Debug.Print "---" Debug.Print "LastRequestStartLine: "; rest.LastRequestStartLine Debug.Print "LastRequestHeader: "; rest.LastRequestHeader Exit Sub End If Dim jsonResponse As Chilkat.JsonObject Set jsonResponse = Chilkat.NewJsonObject success = jsonResponse.Load(responseStr) jsonResponse.EmitCompact = False Debug.Print jsonResponse.Emit() ' { ' "used": 3032115, ' "allocation": { ' ".tag": "individual", ' "allocated": 2147483648 ' } ' } ' |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.