Xojo Plugin Fatturazione Elettronica Aruba IT: Find by Username (Received)

Back to Index

Ricerca una lista di fatture. Ritorna le fatture senza il contenuto in base64 (lazy loading)

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

CURL Command

curl -X GET  https://demows.fatturazioneelettronica.aruba.it/services/invoice/in/findByUsername?username=Utente \
-H 'Accept: application/json' \
-H 'Authorization: Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE='

Xojo Plugin Example

Dim rest As New Chilkat.Rest
Dim success As Boolean

//  URL: https://demows.fatturazioneelettronica.aruba.it/services/invoice/in/findByUsername?username=Utente
Dim bTls As Boolean
bTls = True
Dim port As Int32
port = 443
Dim bAutoReconnect As Boolean
bAutoReconnect = True
success = rest.Connect("demows.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect)
If (success <> True) Then
    System.DebugLog("ConnectFailReason: " + Str(rest.ConnectFailReason))
    System.DebugLog(rest.LastErrorText)
    Return
End If

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

Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestNoBodySb("GET","/services/invoice/in/findByUsername?username=Utente",sbResponseBody)
If (success <> True) Then
    System.DebugLog(rest.LastErrorText)
    Return
End If

Dim respStatusCode As Int32
respStatusCode = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
    System.DebugLog("Response Status Code = " + Str(respStatusCode))
    System.DebugLog("Response Header:")
    System.DebugLog(rest.ResponseHeader)
    System.DebugLog("Response Body:")
    System.DebugLog(sbResponseBody.GetAsString())
    Return
End If

Dim jsonResponse As New Chilkat.JsonObject
success = jsonResponse.LoadSb(sbResponseBody)

//  See the Online Tool for Generating JSON Parse Code
Dim last As Boolean
Dim totalElements As Int32
Dim totalPages As Int32
Dim size As Int32
Dim number As Int32
Dim first As Boolean
Dim numberOfElements As Int32
Dim i As Int32
Dim count_i As Int32
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 j As Int32
Dim count_j As Int32
Dim invoiceDate As String
Dim number_str As String
Dim status As String

last = jsonResponse.BoolOf("last")
totalElements = jsonResponse.IntOf("totalElements")
totalPages = jsonResponse.IntOf("totalPages")
size = jsonResponse.IntOf("size")
number = jsonResponse.IntOf("number")
first = jsonResponse.BoolOf("first")
numberOfElements = jsonResponse.IntOf("numberOfElements")
i = 0
count_i = jsonResponse.SizeOfArray("content")
While i < count_i
    jsonResponse.I = i
    id = jsonResponse.StringOf("content[i].id")
    senderDescription = jsonResponse.StringOf("content[i].sender.description")
    senderCountryCode = jsonResponse.StringOf("content[i].sender.countryCode")
    senderVatCode = jsonResponse.StringOf("content[i].sender.vatCode")
    senderFiscalCode = jsonResponse.StringOf("content[i].sender.fiscalCode")
    receiverDescription = jsonResponse.StringOf("content[i].receiver.description")
    receiverCountryCode = jsonResponse.StringOf("content[i].receiver.countryCode")
    receiverVatCode = jsonResponse.StringOf("content[i].receiver.vatCode")
    receiverFiscalCode = jsonResponse.StringOf("content[i].receiver.fiscalCode")
    invoiceType = jsonResponse.StringOf("content[i].invoiceType")
    docType = jsonResponse.StringOf("content[i].docType")
    file = jsonResponse.StringOf("content[i].file")
    filename = jsonResponse.StringOf("content[i].filename")
    username = jsonResponse.StringOf("content[i].username")
    lastUpdate = jsonResponse.StringOf("content[i].lastUpdate")
    idSdi = jsonResponse.StringOf("content[i].idSdi")
    j = 0
    count_j = jsonResponse.SizeOfArray("content[i].invoices")
    While j < count_j
        jsonResponse.J = j
        invoiceDate = jsonResponse.StringOf("content[i].invoices[j].invoiceDate")
        number_str = jsonResponse.StringOf("content[i].invoices[j].number")
        status = jsonResponse.StringOf("content[i].invoices[j].status")
        j = j + 1
    Wend
    i = i + 1
Wend

Sample JSON Response Body

{
  "content": [
    {
      "id": "0",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037880_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.818+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.819+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.824+01:00",
      "idSdi": null
    },
    {
      "id": "1",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037881_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.824+01:00",
      "idSdi": null
    },
    {
      "id": "2",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037882_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.824+01:00",
      "idSdi": null
    },
    {
      "id": "3",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037883_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.824+01:00",
      "idSdi": null
    },
    {
      "id": "4",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037884_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.824+01:00",
      "idSdi": null
    },
    {
      "id": "5",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037885_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.824+01:00",
      "idSdi": null
    },
    {
      "id": "6",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037886_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.824+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.824+01:00",
      "idSdi": null
    },
    {
      "id": "7",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037887_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.825+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.825+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.825+01:00",
      "idSdi": null
    },
    {
      "id": "8",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037888_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.825+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.825+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.825+01:00",
      "idSdi": null
    },
    {
      "id": "9",
      "sender": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "22222222",
        "fiscalCode": "11111111111"
      },
      "receiver": {
        "description": "Aruba SPA",
        "countryCode": "IT",
        "vatCode": "4444444",
        "fiscalCode": "333333333"
      },
      "invoiceType": "FPA12",
      "docType": "in",
      "file": null,
      "filename": "IT07026037889_jtlkl.xml.p7m",
      "invoices": [
        {
          "invoiceDate": "2019-01-21T17:36:10.825+01:00",
          "number": "1",
          "status": "Inviata"
        },
        {
          "invoiceDate": "2019-01-21T17:36:10.825+01:00",
          "number": "2",
          "status": "Consegnata"
        }
      ],
      "username": "Utente",
      "lastUpdate": "2019-01-21T17:36:10.825+01:00",
      "idSdi": null
    }
  ],
  "last": true,
  "totalElements": 10,
  "totalPages": 1,
  "size": 10,
  "number": 0,
  "first": true,
  "numberOfElements": 10
}