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
(DataFlex) Delete a Task from a Task ListDemonstrates how to delete a Google task from a task list.
Use ChilkatAx-win32.pkg Procedure Test Handle hoFac String sAccessToken Handle hoHttp Boolean iSuccess Variant vResp Handle hoResp String sTemp1 Integer iTemp1 Boolean bTemp1 // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. // Get the previously obtained access token. // See Get Google Tasks Access Token. Get Create (RefClass(cComCkFileAccess)) To hoFac If (Not(IsComObjectCreated(hoFac))) Begin Send CreateComObject of hoFac End Get ComReadEntireTextFile Of hoFac "qa_data/tokens/googleTasks.txt" "utf-8" To sAccessToken Get ComLastMethodSuccess Of hoFac To bTemp1 If (bTemp1 <> True) Begin Get ComLastErrorText Of hoFac To sTemp1 Showln sTemp1 Procedure_Return End Get Create (RefClass(cComChilkatHttp)) To hoHttp If (Not(IsComObjectCreated(hoHttp))) Begin Send CreateComObject of hoHttp End Set ComAuthToken Of hoHttp To sAccessToken Get ComSetUrlVar Of hoHttp "tasklist" "MDM4MzQ4NTA3NDQwMDUxMzQ2OTQ6NzAwOTA4MDA1NzU2ODYwMzow" To iSuccess Get ComSetUrlVar Of hoHttp "task" "MDM4MzQ4NTA3NDQwMDUxMzQ2OTQ6NzAwOTA4MDA1NzU2ODYwMzoxMTg0MzQxMTkzMjM2MDY1" To iSuccess Get ComQuickRequest Of hoHttp "DELETE" "https://www.googleapis.com/tasks/v1/lists/{$tasklist}/tasks/{$task}" To vResp If (IsComObject(vResp)) Begin Get Create (RefClass(cComChilkatHttpResponse)) To hoResp Set pvComObject Of hoResp To vResp End Get ComLastMethodSuccess Of hoHttp To bTemp1 If (bTemp1 = False) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End // Show the response body. (empty for success) Get ComBodyStr Of hoResp To sTemp1 Showln sTemp1 // Examine the response status code. (204 = success) Get ComStatusCode Of hoResp To iTemp1 Showln "response status code: " iTemp1 Send Destroy of hoResp End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.