Ricerca una lista di fatture. Ritorna le fatture senza il contenuto in base64 (lazy loading)
curl -X GET https://demows.fatturazioneelettronica.aruba.it/services/invoice/in/findByUsername?username=Utente \
-H 'Accept: application/json' \
-H 'Authorization: Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE='
IncludeFile "CkJsonObject.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkRest.pb"
Procedure ChilkatExample()
rest.i = CkRest::ckCreate()
If rest.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success.i
; URL: https://demows.fatturazioneelettronica.aruba.it/services/invoice/in/findByUsername?username=Utente
bTls.i = 1
port.i = 443
bAutoReconnect.i = 1
success = CkRest::ckConnect(rest,"demows.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect)
If success <> 1
Debug "ConnectFailReason: " + Str(CkRest::ckConnectFailReason(rest))
Debug CkRest::ckLastErrorText(rest)
CkRest::ckDispose(rest)
ProcedureReturn
EndIf
CkRest::ckAddHeader(rest,"Authorization","Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=")
CkRest::ckAddHeader(rest,"Accept","application/json")
sbResponseBody.i = CkStringBuilder::ckCreate()
If sbResponseBody.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success = CkRest::ckFullRequestNoBodySb(rest,"GET","/services/invoice/in/findByUsername?username=Utente",sbResponseBody)
If success <> 1
Debug CkRest::ckLastErrorText(rest)
CkRest::ckDispose(rest)
CkStringBuilder::ckDispose(sbResponseBody)
ProcedureReturn
EndIf
respStatusCode.i = CkRest::ckResponseStatusCode(rest)
If respStatusCode >= 400
Debug "Response Status Code = " + Str(respStatusCode)
Debug "Response Header:"
Debug CkRest::ckResponseHeader(rest)
Debug "Response Body:"
Debug CkStringBuilder::ckGetAsString(sbResponseBody)
CkRest::ckDispose(rest)
CkStringBuilder::ckDispose(sbResponseBody)
ProcedureReturn
EndIf
jsonResponse.i = CkJsonObject::ckCreate()
If jsonResponse.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckLoadSb(jsonResponse,sbResponseBody)
; See the Online Tool for Generating JSON Parse Code
last.i
totalElements.i
totalPages.i
size.i
number.i
first.i
numberOfElements.i
i.i
count_i.i
id.s
senderDescription.s
senderCountryCode.s
senderVatCode.s
senderFiscalCode.s
receiverDescription.s
receiverCountryCode.s
receiverVatCode.s
receiverFiscalCode.s
invoiceType.s
docType.s
file.s
filename.s
username.s
lastUpdate.s
idSdi.s
j.i
count_j.i
invoiceDate.s
number_str.s
status.s
last = CkJsonObject::ckBoolOf(jsonResponse,"last")
totalElements = CkJsonObject::ckIntOf(jsonResponse,"totalElements")
totalPages = CkJsonObject::ckIntOf(jsonResponse,"totalPages")
size = CkJsonObject::ckIntOf(jsonResponse,"size")
number = CkJsonObject::ckIntOf(jsonResponse,"number")
first = CkJsonObject::ckBoolOf(jsonResponse,"first")
numberOfElements = CkJsonObject::ckIntOf(jsonResponse,"numberOfElements")
i = 0
count_i = CkJsonObject::ckSizeOfArray(jsonResponse,"content")
While i < count_i
CkJsonObject::setCkI(jsonResponse, i)
id = CkJsonObject::ckStringOf(jsonResponse,"content[i].id")
senderDescription = CkJsonObject::ckStringOf(jsonResponse,"content[i].sender.description")
senderCountryCode = CkJsonObject::ckStringOf(jsonResponse,"content[i].sender.countryCode")
senderVatCode = CkJsonObject::ckStringOf(jsonResponse,"content[i].sender.vatCode")
senderFiscalCode = CkJsonObject::ckStringOf(jsonResponse,"content[i].sender.fiscalCode")
receiverDescription = CkJsonObject::ckStringOf(jsonResponse,"content[i].receiver.description")
receiverCountryCode = CkJsonObject::ckStringOf(jsonResponse,"content[i].receiver.countryCode")
receiverVatCode = CkJsonObject::ckStringOf(jsonResponse,"content[i].receiver.vatCode")
receiverFiscalCode = CkJsonObject::ckStringOf(jsonResponse,"content[i].receiver.fiscalCode")
invoiceType = CkJsonObject::ckStringOf(jsonResponse,"content[i].invoiceType")
docType = CkJsonObject::ckStringOf(jsonResponse,"content[i].docType")
file = CkJsonObject::ckStringOf(jsonResponse,"content[i].file")
filename = CkJsonObject::ckStringOf(jsonResponse,"content[i].filename")
username = CkJsonObject::ckStringOf(jsonResponse,"content[i].username")
lastUpdate = CkJsonObject::ckStringOf(jsonResponse,"content[i].lastUpdate")
idSdi = CkJsonObject::ckStringOf(jsonResponse,"content[i].idSdi")
j = 0
count_j = CkJsonObject::ckSizeOfArray(jsonResponse,"content[i].invoices")
While j < count_j
CkJsonObject::setCkJ(jsonResponse, j)
invoiceDate = CkJsonObject::ckStringOf(jsonResponse,"content[i].invoices[j].invoiceDate")
number_str = CkJsonObject::ckStringOf(jsonResponse,"content[i].invoices[j].number")
status = CkJsonObject::ckStringOf(jsonResponse,"content[i].invoices[j].status")
j = j + 1
Wend
i = i + 1
Wend
CkRest::ckDispose(rest)
CkStringBuilder::ckDispose(sbResponseBody)
CkJsonObject::ckDispose(jsonResponse)
ProcedureReturn
EndProcedure
{
"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
}