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
(DataFlex) 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
Use ChilkatAx-win32.pkg Procedure Test Handle hoHttp Boolean iSuccess Variant vSbResponseBody Handle hoSbResponseBody Integer iRespStatusCode Handle hoJson String sInvoiceDate String sNumber String sStatus String sStatusDescription String sErrorCode String sErrorDescription String sId String sSenderDescription String sSenderCountryCode String sSenderVatCode String sSenderFiscalCode String sReceiverDescription String sReceiverCountryCode String sReceiverVatCode String sReceiverFiscalCode String sInvoiceType String sDocType String sFile String sFilename String sUsername String sLastUpdate String sCreationDate String sIdSdi String sPdfFile Boolean iPddAvailable Integer i Integer iCount_i String sTemp1 // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Get Create (RefClass(cComChilkatHttp)) To hoHttp If (Not(IsComObjectCreated(hoHttp))) Begin Send CreateComObject of hoHttp End // 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. Set ComAuthToken Of hoHttp To "NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=" Send ComSetRequestHeader To hoHttp "Accept" "application/json" Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody If (Not(IsComObjectCreated(hoSbResponseBody))) Begin Send CreateComObject of hoSbResponseBody End Get pvComObject of hoSbResponseBody to vSbResponseBody Get ComQuickGetSb Of hoHttp "https://ws.fatturazioneelettronica.aruba.it/services/invoice/out/getByIdSdi?idSdi=11110&includePdf=true" vSbResponseBody To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End Get ComLastStatus Of hoHttp To iRespStatusCode Showln "response status code = " iRespStatusCode Get Create (RefClass(cComChilkatJsonObject)) To hoJson If (Not(IsComObjectCreated(hoJson))) Begin Send CreateComObject of hoJson End Get pvComObject of hoSbResponseBody to vSbResponseBody Get ComLoadSb Of hoJson vSbResponseBody To iSuccess Set ComEmitCompact Of hoJson To True Showln "Response JSON:" Get ComEmit Of hoJson To sTemp1 Showln sTemp1 If (iRespStatusCode <> 200) Begin Showln "Failed." Procedure_Return End // 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 // } // Get ComStringOf Of hoJson "errorCode" To sErrorCode Get ComStringOf Of hoJson "errorDescription" To sErrorDescription Get ComStringOf Of hoJson "id" To sId Get ComStringOf Of hoJson "sender.description" To sSenderDescription Get ComStringOf Of hoJson "sender.countryCode" To sSenderCountryCode Get ComStringOf Of hoJson "sender.vatCode" To sSenderVatCode Get ComStringOf Of hoJson "sender.fiscalCode" To sSenderFiscalCode Get ComStringOf Of hoJson "receiver.description" To sReceiverDescription Get ComStringOf Of hoJson "receiver.countryCode" To sReceiverCountryCode Get ComStringOf Of hoJson "receiver.vatCode" To sReceiverVatCode Get ComStringOf Of hoJson "receiver.fiscalCode" To sReceiverFiscalCode Get ComStringOf Of hoJson "invoiceType" To sInvoiceType Get ComStringOf Of hoJson "docType" To sDocType Get ComStringOf Of hoJson "file" To sFile Get ComStringOf Of hoJson "filename" To sFilename Get ComStringOf Of hoJson "username" To sUsername Get ComStringOf Of hoJson "lastUpdate" To sLastUpdate Get ComStringOf Of hoJson "creationDate" To sCreationDate Get ComStringOf Of hoJson "idSdi" To sIdSdi Get ComStringOf Of hoJson "pdfFile" To sPdfFile Get ComBoolOf Of hoJson "pddAvailable" To iPddAvailable Move 0 To i Get ComSizeOfArray Of hoJson "invoices" To iCount_i While (i < iCount_i) Set ComI Of hoJson To i Get ComStringOf Of hoJson "invoices[i].invoiceDate" To sInvoiceDate Get ComStringOf Of hoJson "invoices[i].number" To sNumber Get ComStringOf Of hoJson "invoices[i].status" To sStatus Get ComStringOf Of hoJson "invoices[i].statusDescription" To sStatusDescription Move (i + 1) To i Loop End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.