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_CkRestW.h>
#include <C_CkStringBuilderW.h>
#include <C_CkJsonObjectW.h>
void ChilkatSample(void)
{
HCkRestW rest;
BOOL success;
BOOL bTls;
int port;
BOOL bAutoReconnect;
HCkStringBuilderW sbResponseBody;
int respStatusCode;
HCkJsonObjectW jsonResponse;
BOOL last;
int totalElements;
int totalPages;
int size;
int number;
BOOL first;
int numberOfElements;
int i;
int count_i;
const wchar_t *id;
const wchar_t *senderDescription;
const wchar_t *senderCountryCode;
const wchar_t *senderVatCode;
const wchar_t *senderFiscalCode;
const wchar_t *receiverDescription;
const wchar_t *receiverCountryCode;
const wchar_t *receiverVatCode;
const wchar_t *receiverFiscalCode;
const wchar_t *invoiceType;
const wchar_t *docType;
const wchar_t *file;
const wchar_t *filename;
const wchar_t *username;
const wchar_t *lastUpdate;
int idSdi;
int j;
int count_j;
const wchar_t *invoiceDate;
const wchar_t *number_str;
const wchar_t *status;
rest = CkRestW_Create();
// URL: https://demows.fatturazioneelettronica.aruba.it/services/invoice/out/findByUsername?username=Utente
bTls = TRUE;
port = 443;
bAutoReconnect = TRUE;
success = CkRestW_Connect(rest,L"demows.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect);
if (success != TRUE) {
wprintf(L"ConnectFailReason: %d\n",CkRestW_getConnectFailReason(rest));
wprintf(L"%s\n",CkRestW_lastErrorText(rest));
CkRestW_Dispose(rest);
return;
}
CkRestW_AddHeader(rest,L"Authorization",L"Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=");
CkRestW_AddHeader(rest,L"Accept",L"application/json");
sbResponseBody = CkStringBuilderW_Create();
success = CkRestW_FullRequestNoBodySb(rest,L"GET",L"/services/invoice/out/findByUsername?username=Utente",sbResponseBody);
if (success != TRUE) {
wprintf(L"%s\n",CkRestW_lastErrorText(rest));
CkRestW_Dispose(rest);
CkStringBuilderW_Dispose(sbResponseBody);
return;
}
respStatusCode = CkRestW_getResponseStatusCode(rest);
if (respStatusCode >= 400) {
wprintf(L"Response Status Code = %d\n",respStatusCode);
wprintf(L"Response Header:\n");
wprintf(L"%s\n",CkRestW_responseHeader(rest));
wprintf(L"Response Body:\n");
wprintf(L"%s\n",CkStringBuilderW_getAsString(sbResponseBody));
CkRestW_Dispose(rest);
CkStringBuilderW_Dispose(sbResponseBody);
return;
}
jsonResponse = CkJsonObjectW_Create();
CkJsonObjectW_LoadSb(jsonResponse,sbResponseBody);
// See the Online Tool for Generating JSON Parse Code
last = CkJsonObjectW_BoolOf(jsonResponse,L"last");
totalElements = CkJsonObjectW_IntOf(jsonResponse,L"totalElements");
totalPages = CkJsonObjectW_IntOf(jsonResponse,L"totalPages");
size = CkJsonObjectW_IntOf(jsonResponse,L"size");
number = CkJsonObjectW_IntOf(jsonResponse,L"number");
first = CkJsonObjectW_BoolOf(jsonResponse,L"first");
numberOfElements = CkJsonObjectW_IntOf(jsonResponse,L"numberOfElements");
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jsonResponse,L"content");
while (i < count_i) {
CkJsonObjectW_putI(jsonResponse,i);
id = CkJsonObjectW_stringOf(jsonResponse,L"content[i].id");
senderDescription = CkJsonObjectW_stringOf(jsonResponse,L"content[i].sender.description");
senderCountryCode = CkJsonObjectW_stringOf(jsonResponse,L"content[i].sender.countryCode");
senderVatCode = CkJsonObjectW_stringOf(jsonResponse,L"content[i].sender.vatCode");
senderFiscalCode = CkJsonObjectW_stringOf(jsonResponse,L"content[i].sender.fiscalCode");
receiverDescription = CkJsonObjectW_stringOf(jsonResponse,L"content[i].receiver.description");
receiverCountryCode = CkJsonObjectW_stringOf(jsonResponse,L"content[i].receiver.countryCode");
receiverVatCode = CkJsonObjectW_stringOf(jsonResponse,L"content[i].receiver.vatCode");
receiverFiscalCode = CkJsonObjectW_stringOf(jsonResponse,L"content[i].receiver.fiscalCode");
invoiceType = CkJsonObjectW_stringOf(jsonResponse,L"content[i].invoiceType");
docType = CkJsonObjectW_stringOf(jsonResponse,L"content[i].docType");
file = CkJsonObjectW_stringOf(jsonResponse,L"content[i].file");
filename = CkJsonObjectW_stringOf(jsonResponse,L"content[i].filename");
username = CkJsonObjectW_stringOf(jsonResponse,L"content[i].username");
lastUpdate = CkJsonObjectW_stringOf(jsonResponse,L"content[i].lastUpdate");
idSdi = CkJsonObjectW_IntOf(jsonResponse,L"content[i].idSdi");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jsonResponse,L"content[i].invoices");
while (j < count_j) {
CkJsonObjectW_putJ(jsonResponse,j);
invoiceDate = CkJsonObjectW_stringOf(jsonResponse,L"content[i].invoices[j].invoiceDate");
number_str = CkJsonObjectW_stringOf(jsonResponse,L"content[i].invoices[j].number");
status = CkJsonObjectW_stringOf(jsonResponse,L"content[i].invoices[j].status");
j = j + 1;
}
i = i + 1;
}
CkRestW_Dispose(rest);
CkStringBuilderW_Dispose(sbResponseBody);
CkJsonObjectW_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
}