VB.NET UWP/WinRT 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='

VB.NET UWP/WinRT Example

Dim rest As New Chilkat.Rest
Dim success As Boolean

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


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

Dim sbResponseBody As New Chilkat.StringBuilder
success = Await rest.FullRequestNoBodySbAsync("GET","/services/invoice/out/getByFilename?filename=IT07026037883_jtlkl.xml.p7m",sbResponseBody)
If (success <> True) Then
    Debug.WriteLine(rest.LastErrorText)
    Exit Sub
End If

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


Dim jsonResponse As New Chilkat.JsonObject
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 Integer
Dim count_i As Integer
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")
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
End While

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
}