![]() |
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
(PowerBuilder) Aruba Fatturazione Elettronica ppdIf pddAvailable is true then this method retrieves the Preservation package as a Zip file of financial messages, specifying its request ID (requestID). If however pddAvailable is false, in other words, the Preservation package is not available, the HTTP status code 404 is returned. Note: This example requires Chilkat v11.0.0 or greater. For more information, see https://fatturazioneelettronica.aruba.it/apidoc/docs_EN.html#services-clientrequest-pdd
integer li_rc integer li_Success oleobject loo_Http oleobject loo_Json oleobject loo_Resp string ls_ZipFilename li_Success = 0 // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Http = create oleobject li_rc = loo_Http.ConnectToNewObject("Chilkat.Http") if li_rc < 0 then destroy loo_Http MessageBox("Error","Connecting to COM object failed") return end if // Implements the following CURL command: // curl -X POST https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/pdd \ // -H "Accept: application/json" \ // -H "Content-Type: application/json;charset=UTF-8" \ // -d '{ // "userName" : "ARUBA0000", // "password" : "ArubaPwd", // "requestID" : "XZLA9SZ9ZW" // }' // Use the following online tool to generate HTTP code from a CURL command // Convert a cURL Command to HTTP Source Code // Use this online tool to generate code from sample JSON: // Generate Code to Create JSON // The following JSON is sent in the request body. // { // "userName": "ARUBA0000", // "password": "ArubaPwd", // "requestID": "XZLA9SZ9ZW" // } loo_Json = create oleobject li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject") loo_Json.UpdateString("userName","ARUBA0000") loo_Json.UpdateString("password","ArubaPwd") loo_Json.UpdateString("requestID","XZLA9SZ9ZW") loo_Http.SetRequestHeader("Content-Type","application/json;charset=UTF-8") loo_Http.SetRequestHeader("Accept","application/json") loo_Resp = create oleobject li_rc = loo_Resp.ConnectToNewObject("Chilkat.HttpResponse") li_Success = loo_Http.HttpJson("POST","https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/pdd",loo_Json,"application/json",loo_Resp) if li_Success = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_Json destroy loo_Resp return end if // Returns a response that looks like this: // HTTP/1.1 200 OK // Content-Disposition: attachment; filename="IT01879020517_LI_0001.conservazione.zip" // Content-Type: application/zip // Accept-Ranges: bytes // Content-Length: 8 // // <binary> if loo_Resp.StatusCode <> 200 then Write-Debug "response status code = " + string(loo_Resp.StatusCode) Write-Debug loo_Resp.BodyStr destroy loo_Http destroy loo_Json destroy loo_Resp return end if // If we get here, the response contains a .zip. // Save to the filename specified in the Content-Disposition. ls_ZipFilename = loo_Resp.GetHeaderFieldAttr("Content-Disposition","filename") li_Success = loo_Resp.SaveBodyBinary(ls_ZipFilename) Write-Debug "Success." destroy loo_Http destroy loo_Json destroy loo_Resp |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.