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='
#import <CkoRest.h>
#import <CkoStringBuilder.h>
#import <CkoJsonObject.h>
#import <NSString.h>
CkoRest *rest = [[CkoRest alloc] init];
BOOL success;
// URL: https://demows.fatturazioneelettronica.aruba.it/services/invoice/in/findByUsername?username=Utente
BOOL bTls = YES;
int port = 443;
BOOL bAutoReconnect = YES;
success = [rest Connect: @"demows.fatturazioneelettronica.aruba.it" port: [NSNumber numberWithInt: port] tls: bTls autoReconnect: bAutoReconnect];
if (success != YES) {
NSLog(@"%@%d",@"ConnectFailReason: ",[rest.ConnectFailReason intValue]);
NSLog(@"%@",rest.LastErrorText);
return;
}
[rest AddHeader: @"Authorization" value: @"Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE="];
[rest AddHeader: @"Accept" value: @"application/json"];
CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
success = [rest FullRequestNoBodySb: @"GET" uriPath: @"/services/invoice/in/findByUsername?username=Utente" sb: sbResponseBody];
if (success != YES) {
NSLog(@"%@",rest.LastErrorText);
return;
}
int respStatusCode = [rest.ResponseStatusCode intValue];
if (respStatusCode >= 400) {
NSLog(@"%@%d",@"Response Status Code = ",respStatusCode);
NSLog(@"%@",@"Response Header:");
NSLog(@"%@",rest.ResponseHeader);
NSLog(@"%@",@"Response Body:");
NSLog(@"%@",[sbResponseBody GetAsString]);
return;
}
CkoJsonObject *jsonResponse = [[CkoJsonObject alloc] init];
[jsonResponse LoadSb: sbResponseBody];
// See the Online Tool for Generating JSON Parse Code
BOOL last;
int totalElements;
int totalPages;
int size;
int number;
BOOL first;
int numberOfElements;
int i;
int count_i;
NSString *id = 0;
NSString *senderDescription = 0;
NSString *senderCountryCode = 0;
NSString *senderVatCode = 0;
NSString *senderFiscalCode = 0;
NSString *receiverDescription = 0;
NSString *receiverCountryCode = 0;
NSString *receiverVatCode = 0;
NSString *receiverFiscalCode = 0;
NSString *invoiceType = 0;
NSString *docType = 0;
NSString *file = 0;
NSString *filename = 0;
NSString *username = 0;
NSString *lastUpdate = 0;
NSString *idSdi = 0;
int j;
int count_j;
NSString *invoiceDate = 0;
NSString *number_str = 0;
NSString *status = 0;
last = [jsonResponse BoolOf: @"last"];
totalElements = [[jsonResponse IntOf: @"totalElements"] intValue];
totalPages = [[jsonResponse IntOf: @"totalPages"] intValue];
size = [[jsonResponse IntOf: @"size"] intValue];
number = [[jsonResponse IntOf: @"number"] intValue];
first = [jsonResponse BoolOf: @"first"];
numberOfElements = [[jsonResponse IntOf: @"numberOfElements"] intValue];
i = 0;
count_i = [[jsonResponse SizeOfArray: @"content"] intValue];
while (i < count_i) {
jsonResponse.I = [NSNumber numberWithInt: 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"] intValue];
while (j < count_j) {
jsonResponse.J = [NSNumber numberWithInt: 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;
}
i = i + 1;
}
{
"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
}