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
(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. For more information, see https://fatturazioneelettronica.aruba.it/apidoc/docs_EN.html#services-clientrequest-pdd
integer li_rc oleobject loo_Http integer li_Success oleobject loo_Json oleobject loo_Resp string ls_ZipFilename // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Http = create oleobject // Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 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 // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 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 = loo_Http.PostJson3("https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/pdd","application/json",loo_Json) if loo_Http.LastMethodSuccess = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_Json 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_Resp destroy loo_Http destroy loo_Json 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) destroy loo_Resp Write-Debug "Success." destroy loo_Http destroy loo_Json |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.