![]() |
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
(AutoIt) Activix CRM Upload a RecordingUpload a recording for an existing communication. Note: This example requires Chilkat v11.0.0 or greater. For more information, see https://docs.crm.activix.ca/api/resources/communication
Local $bSuccess = False ; This example requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oReq = ObjCreate("Chilkat.HttpRequest") $oReq.HttpVerb = "POST" $oReq.Path = "/api/v2/communications/COMMUNICATION_ID/recording" $oReq.ContentType = "multipart/form-data" $oReq.AddHeader "Accept","application/json" Local $sPathToFileOnDisk = "qa_data/CantinaBand3.wav" $bSuccess = $oReq.AddFileForUpload("recording",$sPathToFileOnDisk) If ($bSuccess = False) Then ConsoleWrite($oReq.LastErrorText & @CRLF) Exit EndIf $oHttp = ObjCreate("Chilkat.Http") $oHttp.AuthToken = "ACCESS_TOKEN" $oResp = ObjCreate("Chilkat.HttpResponse") $bSuccess = $oHttp.HttpSReq("crm.activix.ca",443,True,$oReq,$oResp) If ($bSuccess = False) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf ConsoleWrite("Response Status Code: " & $oResp.StatusCode & @CRLF) $oJsonResponse = ObjCreate("Chilkat.JsonObject") $oJsonResponse.Load($oResp.BodyStr) $oJsonResponse.EmitCompact = False ConsoleWrite($oJsonResponse.Emit() & @CRLF) If ($oResp.StatusCode >= 300) Then ConsoleWrite("Failed." & @CRLF) Exit EndIf ; Sample output... ; { ; "message": "Recording uploaded successfully." ; } ; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.