Visual Basic 6.0 Fatturazione Elettronica Aruba IT: Get by Filename (Sent)

Back to Index

Questo metodo restituisce il dettaglio completo dello stato di una fattura elettronica.

Documentation: https://fatturazioneelettronica.aruba.it/apidoc/docs.html#_getbyfilename

CURL Command

curl -X GET  https://demows.fatturazioneelettronica.aruba.it/services/invoice/out/getByFilename?filename=IT07026037883_jtlkl.xml.p7m \
-H 'Accept: application/json' \
-H 'Authorization: Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE='

Visual Basic 6.0 Example

Dim rest As New ChilkatRest
Dim success As Long

'  URL: https://demows.fatturazioneelettronica.aruba.it/services/invoice/out/getByFilename?filename=IT07026037883_jtlkl.xml.p7m
Dim bTls As Long
bTls = 1
Dim port As Long
port = 443
Dim bAutoReconnect As Long
bAutoReconnect = 1
success = rest.Connect("demows.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect)
If (success <> 1) Then
    Debug.Print "ConnectFailReason: " & rest.ConnectFailReason
    Debug.Print rest.LastErrorText
    Exit Sub
End If

success = rest.AddHeader("Authorization","Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=")
success = rest.AddHeader("Accept","application/json")

Dim sbResponseBody As New ChilkatStringBuilder
success = rest.FullRequestNoBodySb("GET","/services/invoice/out/getByFilename?filename=IT07026037883_jtlkl.xml.p7m",sbResponseBody)
If (success <> 1) Then
    Debug.Print rest.LastErrorText
    Exit Sub
End If

Dim respStatusCode As Long
respStatusCode = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
    Debug.Print "Response Status Code = " & respStatusCode
    Debug.Print "Response Header:"
    Debug.Print rest.ResponseHeader
    Debug.Print "Response Body:"
    Debug.Print sbResponseBody.GetAsString()
    Exit Sub
End If

Dim jsonResponse As New ChilkatJsonObject
success = jsonResponse.LoadSb(sbResponseBody)

'  See the Online Tool for Generating JSON Parse Code
Dim id As String
Dim senderDescription As String
Dim senderCountryCode As String
Dim senderVatCode As String
Dim senderFiscalCode As String
Dim receiverDescription As String
Dim receiverCountryCode As String
Dim receiverVatCode As String
Dim receiverFiscalCode As String
Dim invoiceType As String
Dim docType As String
Dim file As String
Dim filename As String
Dim username As String
Dim lastUpdate As String
Dim idSdi As String
Dim i As Long
Dim count_i As Long
Dim invoiceDate As String
Dim number As String
Dim status As String

id = jsonResponse.StringOf("id")
senderDescription = jsonResponse.StringOf("sender.description")
senderCountryCode = jsonResponse.StringOf("sender.countryCode")
senderVatCode = jsonResponse.StringOf("sender.vatCode")
senderFiscalCode = jsonResponse.StringOf("sender.fiscalCode")
receiverDescription = jsonResponse.StringOf("receiver.description")
receiverCountryCode = jsonResponse.StringOf("receiver.countryCode")
receiverVatCode = jsonResponse.StringOf("receiver.vatCode")
receiverFiscalCode = jsonResponse.StringOf("receiver.fiscalCode")
invoiceType = jsonResponse.StringOf("invoiceType")
docType = jsonResponse.StringOf("docType")
file = jsonResponse.StringOf("file")
filename = jsonResponse.StringOf("filename")
username = jsonResponse.StringOf("username")
lastUpdate = jsonResponse.StringOf("lastUpdate")
idSdi = jsonResponse.StringOf("idSdi")
i = 0
count_i = jsonResponse.SizeOfArray("invoices")
Do While i < count_i
    jsonResponse.I = i
    invoiceDate = jsonResponse.StringOf("invoices[i].invoiceDate")
    number = jsonResponse.StringOf("invoices[i].number")
    status = jsonResponse.StringOf("invoices[i].status")
    i = i + 1
Loop

Sample JSON Response Body

{
  "id": "1",
  "sender": {
    "description": "Aruba SPA",
    "countryCode": "ITA",
    "vatCode": "6372762541",
    "fiscalCode": "N5Hnt9vvMZ"
  },
  "receiver": {
    "description": "Rossi SRL",
    "countryCode": "ITA",
    "vatCode": "8767263441",
    "fiscalCode": "LVZTeOJ8BN"
  },
  "invoiceType": "FPA12",
  "docType": "in",
  "file": "ZEdWemRBPT0=",
  "filename": "IT07026037883_jtlkl.xml.p7m",
  "invoices": [
    {
      "invoiceDate": "2019-01-21T17:36:21.179+01:00",
      "number": "1",
      "status": "Inviata"
    },
    {
      "invoiceDate": "2019-01-21T17:36:21.179+01:00",
      "number": "2",
      "status": "Consegnata"
    }
  ],
  "username": "Utente",
  "lastUpdate": "2019-01-21T17:36:21.179+01:00",
  "idSdi": null
}