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

Tcl Web API Examples

Primary Categories

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

MedTunnel
MercadoLibre
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
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
UniPin
VoiceBase
Vonage
Walmart
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yousign
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(Tcl) 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 Tcl Extension Downloads

Chilkat Tcl Extension Downloads

load ./chilkat.dll

# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

set http [new_CkHttp]

# 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.
CkHttp_put_AuthToken $http "NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE="
CkHttp_SetRequestHeader $http "Accept" "application/json"

set sbResponseBody [new_CkStringBuilder]

set success [CkHttp_QuickGetSb $http "https://ws.fatturazioneelettronica.aruba.it/services/invoice/out/getByIdSdi?idSdi=11110&includePdf=true" $sbResponseBody]
if {$success == 0} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    delete_CkStringBuilder $sbResponseBody
    exit
}

set respStatusCode [CkHttp_get_LastStatus $http]
puts "response status code = $respStatusCode"

set json [new_CkJsonObject]

CkJsonObject_LoadSb $json $sbResponseBody
CkJsonObject_put_EmitCompact $json 1

puts "Response JSON:"
puts [CkJsonObject_emit $json]

if {$respStatusCode != 200} then {
    puts "Failed."
    delete_CkHttp $http
    delete_CkStringBuilder $sbResponseBody
    delete_CkJsonObject $json
    exit
}

# 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
# }
# 

set errorCode [CkJsonObject_stringOf $json "errorCode"]
set errorDescription [CkJsonObject_stringOf $json "errorDescription"]
set id [CkJsonObject_stringOf $json "id"]
set senderDescription [CkJsonObject_stringOf $json "sender.description"]
set senderCountryCode [CkJsonObject_stringOf $json "sender.countryCode"]
set senderVatCode [CkJsonObject_stringOf $json "sender.vatCode"]
set senderFiscalCode [CkJsonObject_stringOf $json "sender.fiscalCode"]
set receiverDescription [CkJsonObject_stringOf $json "receiver.description"]
set receiverCountryCode [CkJsonObject_stringOf $json "receiver.countryCode"]
set receiverVatCode [CkJsonObject_stringOf $json "receiver.vatCode"]
set receiverFiscalCode [CkJsonObject_stringOf $json "receiver.fiscalCode"]
set invoiceType [CkJsonObject_stringOf $json "invoiceType"]
set docType [CkJsonObject_stringOf $json "docType"]
set file [CkJsonObject_stringOf $json "file"]
set filename [CkJsonObject_stringOf $json "filename"]
set username [CkJsonObject_stringOf $json "username"]
set lastUpdate [CkJsonObject_stringOf $json "lastUpdate"]
set creationDate [CkJsonObject_stringOf $json "creationDate"]
set idSdi [CkJsonObject_stringOf $json "idSdi"]
set pdfFile [CkJsonObject_stringOf $json "pdfFile"]
set pddAvailable [CkJsonObject_BoolOf $json "pddAvailable"]
set i 0
set count_i [CkJsonObject_SizeOfArray $json "invoices"]
while {$i < $count_i} {
    CkJsonObject_put_I $json $i
    set invoiceDate [CkJsonObject_stringOf $json "invoices[i].invoiceDate"]
    set number [CkJsonObject_stringOf $json "invoices[i].number"]
    set status [CkJsonObject_stringOf $json "invoices[i].status"]
    set statusDescription [CkJsonObject_stringOf $json "invoices[i].statusDescription"]
    set i [expr $i + 1]
}

delete_CkHttp $http
delete_CkStringBuilder $sbResponseBody
delete_CkJsonObject $json

 

© 2000-2022 Chilkat Software, Inc. All Rights Reserved.