Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Unicode C) WhatsApp - Delete MediaDemonstrates how to delete media previously uploaded to the WhatsApp Business API client For more information, see https://developers.facebook.com/docs/whatsapp/api/media#delete
#include <C_CkHttpW.h> #include <C_CkHttpResponseW.h> void ChilkatSample(void) { HCkHttpW http; BOOL success; HCkHttpResponseW resp; int respStatusCode; // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. http = CkHttpW_Create(); // Implements the following CURL command: // curl -X DELETE \ // https://your-webapp-hostname:your-webapp-port/v1/media/media-id \ // -H 'Authorization: Bearer your-auth-token' // Use the following online tool to generate HTTP code from a CURL command // Convert a cURL Command to HTTP Source Code // Adds the "Authorization: Bearer your-auth-token" header. CkHttpW_putAuthToken(http,L"your-auth-token"); resp = CkHttpW_QuickRequest(http,L"DELETE",L"https://your-webapp-hostname:your-webapp-port/v1/media/media-id"); if (CkHttpW_getLastMethodSuccess(http) == FALSE) { wprintf(L"%s\n",CkHttpW_lastErrorText(http)); CkHttpW_Dispose(http); return; } respStatusCode = CkHttpResponseW_getStatusCode(resp); wprintf(L"Response Status Code = %d\n",respStatusCode); if (respStatusCode != 200) { wprintf(L"Response Header:\n"); wprintf(L"%s\n",CkHttpResponseW_header(resp)); wprintf(L"Response Body:\n"); wprintf(L"%s\n",CkHttpResponseW_bodyStr(resp)); wprintf(L"Failed.\n"); CkHttpResponseW_Dispose(resp); CkHttpW_Dispose(http); return; } CkHttpResponseW_Dispose(resp); wprintf(L"Success.\n"); CkHttpW_Dispose(http); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.