Questo metodo restituisce l’elenco delle fatture elettroniche inviate dall’utente e prese in carico dal sistema. La lista di Fatture ritorna senza il contenuto in base64 (lazy loading)
curl -X GET https://demows.fatturazioneelettronica.aruba.it/services/invoice/out/findByUsername?username=Utente \
-H 'Accept: application/json' \
-H 'Authorization: Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE='
#include <C_CkRest.h>
#include <C_CkStringBuilder.h>
#include <C_CkJsonObject.h>
void ChilkatSample(void)
{
HCkRest rest;
BOOL success;
BOOL bTls;
int port;
BOOL bAutoReconnect;
HCkStringBuilder sbResponseBody;
int respStatusCode;
HCkJsonObject jsonResponse;
BOOL last;
int totalElements;
int totalPages;
int size;
int number;
BOOL first;
int numberOfElements;
int i;
int count_i;
const char *id;
const char *senderDescription;
const char *senderCountryCode;
const char *senderVatCode;
const char *senderFiscalCode;
const char *receiverDescription;
const char *receiverCountryCode;
const char *receiverVatCode;
const char *receiverFiscalCode;
const char *invoiceType;
const char *docType;
const char *file;
const char *filename;
const char *username;
const char *lastUpdate;
int idSdi;
int j;
int count_j;
const char *invoiceDate;
const char *number_str;
const char *status;
rest = CkRest_Create();
// URL: https://demows.fatturazioneelettronica.aruba.it/services/invoice/out/findByUsername?username=Utente
bTls = TRUE;
port = 443;
bAutoReconnect = TRUE;
success = CkRest_Connect(rest,"demows.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect);
if (success != TRUE) {
printf("ConnectFailReason: %d\n",CkRest_getConnectFailReason(rest));
printf("%s\n",CkRest_lastErrorText(rest));
CkRest_Dispose(rest);
return;
}
CkRest_AddHeader(rest,"Authorization","Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=");
CkRest_AddHeader(rest,"Accept","application/json");
sbResponseBody = CkStringBuilder_Create();
success = CkRest_FullRequestNoBodySb(rest,"GET","/services/invoice/out/findByUsername?username=Utente",sbResponseBody);
if (success != TRUE) {
printf("%s\n",CkRest_lastErrorText(rest));
CkRest_Dispose(rest);
CkStringBuilder_Dispose(sbResponseBody);
return;
}
respStatusCode = CkRest_getResponseStatusCode(rest);
if (respStatusCode >= 400) {
printf("Response Status Code = %d\n",respStatusCode);
printf("Response Header:\n");
printf("%s\n",CkRest_responseHeader(rest));
printf("Response Body:\n");
printf("%s\n",CkStringBuilder_getAsString(sbResponseBody));
CkRest_Dispose(rest);
CkStringBuilder_Dispose(sbResponseBody);
return;
}
jsonResponse = CkJsonObject_Create();
CkJsonObject_LoadSb(jsonResponse,sbResponseBody);
// See the Online Tool for Generating JSON Parse Code
last = CkJsonObject_BoolOf(jsonResponse,"last");
totalElements = CkJsonObject_IntOf(jsonResponse,"totalElements");
totalPages = CkJsonObject_IntOf(jsonResponse,"totalPages");
size = CkJsonObject_IntOf(jsonResponse,"size");
number = CkJsonObject_IntOf(jsonResponse,"number");
first = CkJsonObject_BoolOf(jsonResponse,"first");
numberOfElements = CkJsonObject_IntOf(jsonResponse,"numberOfElements");
i = 0;
count_i = CkJsonObject_SizeOfArray(jsonResponse,"content");
while (i < count_i) {
CkJsonObject_putI(jsonResponse,i);
id = CkJsonObject_stringOf(jsonResponse,"content[i].id");
senderDescription = CkJsonObject_stringOf(jsonResponse,"content[i].sender.description");
senderCountryCode = CkJsonObject_stringOf(jsonResponse,"content[i].sender.countryCode");
senderVatCode = CkJsonObject_stringOf(jsonResponse,"content[i].sender.vatCode");
senderFiscalCode = CkJsonObject_stringOf(jsonResponse,"content[i].sender.fiscalCode");
receiverDescription = CkJsonObject_stringOf(jsonResponse,"content[i].receiver.description");
receiverCountryCode = CkJsonObject_stringOf(jsonResponse,"content[i].receiver.countryCode");
receiverVatCode = CkJsonObject_stringOf(jsonResponse,"content[i].receiver.vatCode");
receiverFiscalCode = CkJsonObject_stringOf(jsonResponse,"content[i].receiver.fiscalCode");
invoiceType = CkJsonObject_stringOf(jsonResponse,"content[i].invoiceType");
docType = CkJsonObject_stringOf(jsonResponse,"content[i].docType");
file = CkJsonObject_stringOf(jsonResponse,"content[i].file");
filename = CkJsonObject_stringOf(jsonResponse,"content[i].filename");
username = CkJsonObject_stringOf(jsonResponse,"content[i].username");
lastUpdate = CkJsonObject_stringOf(jsonResponse,"content[i].lastUpdate");
idSdi = CkJsonObject_IntOf(jsonResponse,"content[i].idSdi");
j = 0;
count_j = CkJsonObject_SizeOfArray(jsonResponse,"content[i].invoices");
while (j < count_j) {
CkJsonObject_putJ(jsonResponse,j);
invoiceDate = CkJsonObject_stringOf(jsonResponse,"content[i].invoices[j].invoiceDate");
number_str = CkJsonObject_stringOf(jsonResponse,"content[i].invoices[j].number");
status = CkJsonObject_stringOf(jsonResponse,"content[i].invoices[j].status");
j = j + 1;
}
i = i + 1;
}
CkRest_Dispose(rest);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jsonResponse);
}
{
"content": [
{
"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": null,
"filename": "IT07026037883_jtlkl.xml.p7m",
"invoices": [
{
"invoiceDate": "2019-01-21T17:36:20.835+01:00",
"number": "1",
"status": "Inviata"
}
],
"username": "Utente",
"lastUpdate": "2019-01-21T17:36:20.835+01:00",
"idSdi": 7895
},
{
"id": "2",
"sender": {
"description": "Aruba SPA",
"countryCode": "fKo",
"vatCode": "0845927294",
"fiscalCode": "1dzZUPwfhO"
},
"receiver": {
"description": "Rossi SRL",
"countryCode": "WGf",
"vatCode": "7188186772",
"fiscalCode": "p46bxpoQgx"
},
"invoiceType": "FPA12",
"docType": "in",
"file": null,
"filename": "IT00499202641_kwefc.xml.p7m",
"invoices": [
{
"invoiceDate": "2019-01-21T17:36:20.835+01:00",
"number": "1",
"status": "Inviata"
}
],
"username": "Utente",
"lastUpdate": "2019-01-21T17:36:20.835+01:00",
"idSdi": 7895
},
{
"id": "3",
"sender": {
"description": "Aruba SPA",
"countryCode": "IT",
"vatCode": "56215678997",
"fiscalCode": "94170917594"
},
"receiver": {
"description": "Rossi SRL",
"countryCode": "IT",
"vatCode": "27446044667",
"fiscalCode": "13591589640"
},
"invoiceType": "FPA12",
"docType": "in",
"file": null,
"filename": "IT01787589930_bkemy.xml.p7m",
"invoices": [
{
"invoiceDate": "2019-01-21T17:36:20.835+01:00",
"number": "1",
"status": "Inviata"
}
],
"username": "Utente",
"lastUpdate": "2019-01-21T17:36:20.835+01:00",
"idSdi": 7895
},
{
"id": "4",
"sender": {
"description": "Aruba SPA",
"countryCode": "IT",
"vatCode": "51878525587",
"fiscalCode": "37556497667"
},
"receiver": {
"description": "Rossi SRL",
"countryCode": "IT",
"vatCode": "95708696901",
"fiscalCode": "69989572913"
},
"invoiceType": "FPA12",
"docType": "in",
"file": null,
"filename": "IT06620176401_pdrjw.xml.p7m",
"invoices": [
{
"invoiceDate": "2019-01-21T17:36:20.835+01:00",
"number": "1",
"status": "Inviata"
}
],
"username": "Utente",
"lastUpdate": "2019-01-21T17:36:20.835+01:00",
"idSdi": 7895
}
],
"last": true,
"totalElements": 4,
"totalPages": 1,
"size": 10,
"number": 0,
"first": true,
"numberOfElements": 4
}