Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

DataFlex Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(DataFlex) Aruba Fatturazione Elettronica getByIdSdi

See more Aruba Fatturazione Examples

This 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

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-9.5.0-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.