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 getByIdSdiSee more Aruba Fatturazione ExamplesThis method returns the complete status detail of an electronic invoice. Search for a single invoice by SdI identifier. For more information, see https://fatturazioneelettronica.aruba.it/apidoc/docs.html#services-invoice-out-getByIdSdi
integer li_rc oleobject loo_Http integer li_Success oleobject loo_SbResponseBody integer li_RespStatusCode oleobject loo_Json string ls_InvoiceDate string ls_Number string ls_Status string ls_StatusDescription string ls_ErrorCode string ls_ErrorDescription string ls_Id string ls_SenderDescription string ls_SenderCountryCode string ls_SenderVatCode string ls_SenderFiscalCode string ls_ReceiverDescription string ls_ReceiverCountryCode string ls_ReceiverVatCode string ls_ReceiverFiscalCode string ls_InvoiceType string ls_DocType string ls_File string ls_Filename string ls_Username string ls_LastUpdate string ls_CreationDate string ls_IdSdi string ls_PdfFile integer li_PddAvailable integer i integer li_Count_i // 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 GET https://ws.fatturazioneelettronica.aruba.it/services/invoice/out/getByIdSdi?idSdi=11110&includePdf=true \ // -H "Accept: application/json" \ // -H "Authorization: Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=" // 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 NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=" header. loo_Http.AuthToken = "NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=" loo_Http.SetRequestHeader("Accept","application/json") loo_SbResponseBody = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder") li_Success = loo_Http.QuickGetSb("https://ws.fatturazioneelettronica.aruba.it/services/invoice/out/getByIdSdi?idSdi=11110&includePdf=true",loo_SbResponseBody) if li_Success = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_SbResponseBody return end if li_RespStatusCode = loo_Http.LastStatus Write-Debug "response status code = " + string(li_RespStatusCode) 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.LoadSb(loo_SbResponseBody) loo_Json.EmitCompact = 1 Write-Debug "Response JSON:" Write-Debug loo_Json.Emit() if li_RespStatusCode <> 200 then Write-Debug "Failed." destroy loo_Http destroy loo_SbResponseBody destroy loo_Json return end if // Sample response: // Use this online tool to generate parsing code from sample JSON: // Generate Parsing Code from JSON // { // "errorCode" : "0000", // "errorDescription" : null, // "id" : "1", // "sender" : { // "description" : "Aruba SPA", // "countryCode" : "IT", // "vatCode" : "22222222", // "fiscalCode" : "11111111111" // }, // "receiver" : { // "description" : "Aruba SPA", // "countryCode" : "IT", // "vatCode" : "4444444", // "fiscalCode" : "333333333" // }, // "invoiceType" : "FPR12", // "docType" : "in", // "file" : "dGVzdA==", // "filename" : "IT01879020517_jtlk0.xml.p7m", // "invoices" : [ { // "invoiceDate" : "2021-08-24T12:35:45.363+02:00", // "number" : "2021/0001", // "status" : "Inviata", // "statusDescription" : "" // } ], // "username" : "Utente", // "lastUpdate" : "2021-08-24T10:35:45.363+0000", // "creationDate" : "2021-08-24T10:35:45.363+0000", // "idSdi" : "11110", // "pdfFile" : "ZEdWemRGQmtaZz09", // "pddAvailable" : true // } // ls_ErrorCode = loo_Json.StringOf("errorCode") ls_ErrorDescription = loo_Json.StringOf("errorDescription") ls_Id = loo_Json.StringOf("id") ls_SenderDescription = loo_Json.StringOf("sender.description") ls_SenderCountryCode = loo_Json.StringOf("sender.countryCode") ls_SenderVatCode = loo_Json.StringOf("sender.vatCode") ls_SenderFiscalCode = loo_Json.StringOf("sender.fiscalCode") ls_ReceiverDescription = loo_Json.StringOf("receiver.description") ls_ReceiverCountryCode = loo_Json.StringOf("receiver.countryCode") ls_ReceiverVatCode = loo_Json.StringOf("receiver.vatCode") ls_ReceiverFiscalCode = loo_Json.StringOf("receiver.fiscalCode") ls_InvoiceType = loo_Json.StringOf("invoiceType") ls_DocType = loo_Json.StringOf("docType") ls_File = loo_Json.StringOf("file") ls_Filename = loo_Json.StringOf("filename") ls_Username = loo_Json.StringOf("username") ls_LastUpdate = loo_Json.StringOf("lastUpdate") ls_CreationDate = loo_Json.StringOf("creationDate") ls_IdSdi = loo_Json.StringOf("idSdi") ls_PdfFile = loo_Json.StringOf("pdfFile") li_PddAvailable = loo_Json.BoolOf("pddAvailable") i = 0 li_Count_i = loo_Json.SizeOfArray("invoices") do while i < li_Count_i loo_Json.I = i ls_InvoiceDate = loo_Json.StringOf("invoices[i].invoiceDate") ls_Number = loo_Json.StringOf("invoices[i].number") ls_Status = loo_Json.StringOf("invoices[i].status") ls_StatusDescription = loo_Json.StringOf("invoices[i].statusDescription") i = i + 1 loop destroy loo_Http destroy loo_SbResponseBody destroy loo_Json |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.