Visual Basic 6.0
Visual Basic 6.0
Empty Trash
See more Google Drive Examples
Permanently deletes all of the user's trashed files.Chilkat Visual Basic 6.0 Downloads
Dim success As Long
success = 0
success = 1
' It requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
' This example uses a previously obtained access token having permission for the
' Google Drive scope.
Dim gAuth As New ChilkatAuthGoogle
gAuth.AccessToken = "GOOGLE-DRIVE-ACCESS-TOKEN"
Dim rest As New ChilkatRest
' Connect using TLS.
Dim bAutoReconnect As Long
bAutoReconnect = 1
success = rest.Connect("www.googleapis.com",443,1,bAutoReconnect)
' Provide the authentication credentials (i.e. the access token)
success = rest.SetAuthGoogle(gAuth)
Dim jsonResponse As String
jsonResponse = rest.FullRequestNoBody("DELETE","/drive/v3/files/trash")
If (rest.LastMethodSuccess <> 1) Then
Debug.Print rest.LastErrorText
Exit Sub
End If
' A successful response will have a status code equal to 204 and the response body is empty.
' (If not successful, then there should be a JSON response body with information..)
If (rest.ResponseStatusCode <> 204) Then
Debug.Print "response status code = " & rest.ResponseStatusCode
Debug.Print "response status text = " & rest.ResponseStatusText
Debug.Print "response header: " & rest.ResponseHeader
Debug.Print "response JSON: " & jsonResponse
Exit Sub
End If
Debug.Print "Trash Emptied!"