Ricerca una singola fattura per Id
curl -X GET https://demows.fatturazioneelettronica.aruba.it/services/invoice/out/{invoiceId} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE='
integer li_rc
oleobject loo_Rest
integer li_Success
integer li_BTls
integer li_Port
integer li_BAutoReconnect
oleobject loo_SbResponseBody
integer li_RespStatusCode
oleobject loo_JsonResponse
string ls_Id
string ls_SenderDescription
string ls_SenderCountryCode
string ls_SenderVatCode
string ls_SenderFiscalCode
string ls_ReceiverDescription
string ls_ReceiverCountryCode
string ls_ReceiverVatCode
string ls_ReceiverFiscalCode
string ls_InvoiceType
string ls_DocType
string ls_File
string ls_Filename
string ls_Username
string ls_LastUpdate
string ls_IdSdi
integer i
integer li_Count_i
string ls_InvoiceDate
string ls_Number
string ls_Status
loo_Rest = create oleobject
li_rc = loo_Rest.ConnectToNewObject("Chilkat_9_5_0.Rest")
if li_rc < 0 then
destroy loo_Rest
MessageBox("Error","Connecting to COM object failed")
return
end if
// URL: https://demows.fatturazioneelettronica.aruba.it/services/invoice/out/{invoiceId}
li_BTls = 1
li_Port = 443
li_BAutoReconnect = 1
li_Success = loo_Rest.Connect("demows.fatturazioneelettronica.aruba.it",li_Port,li_BTls,li_BAutoReconnect)
if li_Success <> 1 then
Write-Debug "ConnectFailReason: " + string(loo_Rest.ConnectFailReason)
Write-Debug loo_Rest.LastErrorText
destroy loo_Rest
return
end if
loo_Rest.AddHeader("Authorization","Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=")
loo_Rest.AddHeader("Accept","application/json")
loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")
li_Success = loo_Rest.FullRequestNoBodySb("GET","/services/invoice/out/{invoiceId}",loo_SbResponseBody)
if li_Success <> 1 then
Write-Debug loo_Rest.LastErrorText
destroy loo_Rest
destroy loo_SbResponseBody
return
end if
li_RespStatusCode = loo_Rest.ResponseStatusCode
if li_RespStatusCode >= 400 then
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
Write-Debug "Response Header:"
Write-Debug loo_Rest.ResponseHeader
Write-Debug "Response Body:"
Write-Debug loo_SbResponseBody.GetAsString()
destroy loo_Rest
destroy loo_SbResponseBody
return
end if
loo_JsonResponse = create oleobject
li_rc = loo_JsonResponse.ConnectToNewObject("Chilkat_9_5_0.JsonObject")
loo_JsonResponse.LoadSb(loo_SbResponseBody)
// See the Online Tool for Generating JSON Parse Code
ls_Id = loo_JsonResponse.StringOf("id")
ls_SenderDescription = loo_JsonResponse.StringOf("sender.description")
ls_SenderCountryCode = loo_JsonResponse.StringOf("sender.countryCode")
ls_SenderVatCode = loo_JsonResponse.StringOf("sender.vatCode")
ls_SenderFiscalCode = loo_JsonResponse.StringOf("sender.fiscalCode")
ls_ReceiverDescription = loo_JsonResponse.StringOf("receiver.description")
ls_ReceiverCountryCode = loo_JsonResponse.StringOf("receiver.countryCode")
ls_ReceiverVatCode = loo_JsonResponse.StringOf("receiver.vatCode")
ls_ReceiverFiscalCode = loo_JsonResponse.StringOf("receiver.fiscalCode")
ls_InvoiceType = loo_JsonResponse.StringOf("invoiceType")
ls_DocType = loo_JsonResponse.StringOf("docType")
ls_File = loo_JsonResponse.StringOf("file")
ls_Filename = loo_JsonResponse.StringOf("filename")
ls_Username = loo_JsonResponse.StringOf("username")
ls_LastUpdate = loo_JsonResponse.StringOf("lastUpdate")
ls_IdSdi = loo_JsonResponse.StringOf("idSdi")
i = 0
li_Count_i = loo_JsonResponse.SizeOfArray("invoices")
do while i < li_Count_i
loo_JsonResponse.I = i
ls_InvoiceDate = loo_JsonResponse.StringOf("invoices[i].invoiceDate")
ls_Number = loo_JsonResponse.StringOf("invoices[i].number")
ls_Status = loo_JsonResponse.StringOf("invoices[i].status")
i = i + 1
loop
destroy loo_Rest
destroy loo_SbResponseBody
destroy loo_JsonResponse
{
"id": "1",
"sender": {
"description": "Aruba SPA",
"countryCode": "ITA",
"vatCode": "6372762541",
"fiscalCode": "N5Hnt9vvMZ"
},
"receiver": {
"description": "Aruba SPA",
"countryCode": "ITA",
"vatCode": "8767263441",
"fiscalCode": "LVZTeOJ8BN"
},
"invoiceType": "FPA12",
"docType": "in",
"file": "ZEdWemRBPT0=",
"filename": "IT07026037883_jtlkl.xml.p7m",
"invoices": [
{
"invoiceDate": "2019-01-21T17:36:21.289+01:00",
"number": "1",
"status": "Inviata"
},
{
"invoiceDate": "2019-01-21T17:36:21.289+01:00",
"number": "2",
"status": "Consegnata"
}
],
"username": "Utente",
"lastUpdate": "2019-01-21T17:36:21.289+01:00",
"idSdi": null
}