PowerBuilder / EDS API / Transakciju pārskats (no 01.01.2021).
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Datums
string ls_SaistibasDokumentaNr
string ls_Aprekins
string ls_AprekinaPamatojums
string ls_SaistibasVeids
string ls_IenemumuVeids
string ls_BudzetaKlasifikacijasKods
string ls_SummasVeids
string ls_Summa
string ls_MaksajumaUzdevumaNr
string ls_SaistitaDokumentaNr
string ls_Info
string ls_PeriodsNo
string ls_PeriodsLidz
integer i
integer li_Count_i
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_QueryParams = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")
loo_QueryParams.UpdateString("periodsNo","nisi cillum sed")
loo_QueryParams.UpdateString("periodsLidz","nisi cillum sed")
loo_QueryParams.UpdateString("saistibasDokumentaNr","qui sed")
loo_QueryParams.UpdateString("maksajumaUzdevumaNr","qui sed")
loo_QueryParams.UpdateInt("izlaistIerakstus",25210683)
loo_QueryParams.UpdateInt("atgrieztIerakstus",25210683)
loo_Http.SetRequestHeader("Accept","application/json")
loo_Resp = loo_Http.QuickRequestParams("GET","https://eds.vid.gov.lv/api/reports/paymenttransactions",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_QueryParams
return
end if
loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")
loo_Resp.GetBodySb(loo_SbResponseBody)
loo_JResp = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")
loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0
Write-Debug "Response Body:"
Write-Debug loo_JResp.Emit()
li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
Write-Debug "Response Header:"
Write-Debug loo_Resp.Header
Write-Debug "Failed."
destroy loo_Resp
destroy loo_Http
destroy loo_QueryParams
destroy loo_SbResponseBody
destroy loo_JResp
return
end if
destroy loo_Resp
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "Transakcijas": [
// {
// "Datums": "2000-01-31T00:00:00",
// "SaistibasDokumentaNr": "occaec",
// "Aprekins": "deserunt consequat laborum officia",
// "AprekinaPamatojums": "ut et exercitation",
// "SaistibasVeids": "ea enim aliquip do ullamco",
// "IenemumuVeids": "ut eu exercitation",
// "BudzetaKlasifikacijasKods": "exercitation anim",
// "SummasVeids": "sit ullamco irure",
// "Summa": 24341259.51378028,
// "MaksajumaUzdevumaNr": "veniam quis incididun",
// "SaistitaDokumentaNr": "sit cupidatat dolor fugiat",
// "Info": "ea quis",
// "PeriodsNo": "2000-01-31T00:00:00",
// "PeriodsLidz": "2000-01-31T00:00:00"
// },
// {
// "Datums": "2000-01-31T00:00:00",
// "SaistibasDokumentaNr": "dolore proident sed",
// "Aprekins": "minim sint non",
// "AprekinaPamatojums": "Lorem minim id",
// "SaistibasVeids": "commodo velit et",
// "IenemumuVeids": "est sint",
// "BudzetaKlasifikacijasKods": "elit minim proident",
// "SummasVeids": "in qui",
// "Summa": -45694443.17825795,
// "MaksajumaUzdevumaNr": "tempor officia",
// "SaistitaDokumentaNr": "ipsum",
// "Info": "nulla ad",
// "PeriodsNo": "2000-01-31T00:00:00",
// "PeriodsLidz": "2000-01-31T00:00:00"
// }
// ]
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
i = 0
li_Count_i = loo_JResp.SizeOfArray("Transakcijas")
do while i < li_Count_i
loo_JResp.I = i
ls_Datums = loo_JResp.StringOf("Transakcijas[i].Datums")
ls_SaistibasDokumentaNr = loo_JResp.StringOf("Transakcijas[i].SaistibasDokumentaNr")
ls_Aprekins = loo_JResp.StringOf("Transakcijas[i].Aprekins")
ls_AprekinaPamatojums = loo_JResp.StringOf("Transakcijas[i].AprekinaPamatojums")
ls_SaistibasVeids = loo_JResp.StringOf("Transakcijas[i].SaistibasVeids")
ls_IenemumuVeids = loo_JResp.StringOf("Transakcijas[i].IenemumuVeids")
ls_BudzetaKlasifikacijasKods = loo_JResp.StringOf("Transakcijas[i].BudzetaKlasifikacijasKods")
ls_SummasVeids = loo_JResp.StringOf("Transakcijas[i].SummasVeids")
ls_Summa = loo_JResp.StringOf("Transakcijas[i].Summa")
ls_MaksajumaUzdevumaNr = loo_JResp.StringOf("Transakcijas[i].MaksajumaUzdevumaNr")
ls_SaistitaDokumentaNr = loo_JResp.StringOf("Transakcijas[i].SaistitaDokumentaNr")
ls_Info = loo_JResp.StringOf("Transakcijas[i].Info")
ls_PeriodsNo = loo_JResp.StringOf("Transakcijas[i].PeriodsNo")
ls_PeriodsLidz = loo_JResp.StringOf("Transakcijas[i].PeriodsLidz")
i = i + 1
loop
destroy loo_Http
destroy loo_QueryParams
destroy loo_SbResponseBody
destroy loo_JResp
Curl Command
curl -G -d "periodsNo=nisi%20cillum%20sed"
-d "periodsLidz=nisi%20cillum%20sed"
-d "saistibasDokumentaNr=qui%20sed"
-d "maksajumaUzdevumaNr=qui%20sed"
-d "izlaistIerakstus=25210683"
-d "atgrieztIerakstus=25210683"
-H "Accept: application/json"
https://eds.vid.gov.lv/api/reports/paymenttransactions
Postman Collection Item JSON
{
"name": "Transakciju pārskats (no 01.01.2021).",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/reports/paymenttransactions?periodsNo=nisi cillum sed&periodsLidz=nisi cillum sed&saistibasDokumentaNr=qui sed&maksajumaUzdevumaNr=qui sed&izlaistIerakstus=25210683&atgrieztIerakstus=25210683",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"reports",
"paymenttransactions"
],
"query": [
{
"key": "periodsNo",
"value": "nisi cillum sed",
"description": "(Required) Periods no."
},
{
"key": "periodsLidz",
"value": "nisi cillum sed",
"description": "(Required) Periods līdz."
},
{
"key": "saistibasDokumentaNr",
"value": "qui sed",
"description": "Saistības dokumenta Nr."
},
{
"key": "maksajumaUzdevumaNr",
"value": "qui sed",
"description": "Maksājuma uzdevuma Nr."
},
{
"key": "izlaistIerakstus",
"value": "25210683",
"description": "(Required) No rezultāta izlaižamo ierakstu skaits."
},
{
"key": "atgrieztIerakstus",
"value": "25210683",
"description": "(Required) Atgriežamo ierakstu skaits."
}
]
}
},
"response": [
{
"name": "OK",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/reports/paymenttransactions?periodsNo=nisi cillum sed&periodsLidz=nisi cillum sed&saistibasDokumentaNr=qui sed&maksajumaUzdevumaNr=qui sed&izlaistIerakstus=25210683&atgrieztIerakstus=25210683",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"reports",
"paymenttransactions"
],
"query": [
{
"key": "periodsNo",
"value": "nisi cillum sed"
},
{
"key": "periodsLidz",
"value": "nisi cillum sed"
},
{
"key": "saistibasDokumentaNr",
"value": "qui sed"
},
{
"key": "maksajumaUzdevumaNr",
"value": "qui sed"
},
{
"key": "izlaistIerakstus",
"value": "25210683"
},
{
"key": "atgrieztIerakstus",
"value": "25210683"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"Transakcijas\": [\n {\n \"Datums\": \"2000-01-31T00:00:00\",\n \"SaistibasDokumentaNr\": \"occaec\",\n \"Aprekins\": \"deserunt consequat laborum officia\",\n \"AprekinaPamatojums\": \"ut et exercitation\",\n \"SaistibasVeids\": \"ea enim aliquip do ullamco\",\n \"IenemumuVeids\": \"ut eu exercitation\",\n \"BudzetaKlasifikacijasKods\": \"exercitation anim\",\n \"SummasVeids\": \"sit ullamco irure\",\n \"Summa\": 24341259.51378028,\n \"MaksajumaUzdevumaNr\": \"veniam quis incididun\",\n \"SaistitaDokumentaNr\": \"sit cupidatat dolor fugiat\",\n \"Info\": \"ea quis\",\n \"PeriodsNo\": \"2000-01-31T00:00:00\",\n \"PeriodsLidz\": \"2000-01-31T00:00:00\"\n },\n {\n \"Datums\": \"2000-01-31T00:00:00\",\n \"SaistibasDokumentaNr\": \"dolore proident sed\",\n \"Aprekins\": \"minim sint non\",\n \"AprekinaPamatojums\": \"Lorem minim id\",\n \"SaistibasVeids\": \"commodo velit et\",\n \"IenemumuVeids\": \"est sint\",\n \"BudzetaKlasifikacijasKods\": \"elit minim proident\",\n \"SummasVeids\": \"in qui\",\n \"Summa\": -45694443.17825795,\n \"MaksajumaUzdevumaNr\": \"tempor officia\",\n \"SaistitaDokumentaNr\": \"ipsum\",\n \"Info\": \"nulla ad\",\n \"PeriodsNo\": \"2000-01-31T00:00:00\",\n \"PeriodsLidz\": \"2000-01-31T00:00:00\"\n }\n ]\n}"
},
{
"name": "Lietotājs nav autentificēts.",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/reports/paymenttransactions?periodsNo=nisi cillum sed&periodsLidz=nisi cillum sed&saistibasDokumentaNr=qui sed&maksajumaUzdevumaNr=qui sed&izlaistIerakstus=25210683&atgrieztIerakstus=25210683",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"reports",
"paymenttransactions"
],
"query": [
{
"key": "periodsNo",
"value": "nisi cillum sed"
},
{
"key": "periodsLidz",
"value": "nisi cillum sed"
},
{
"key": "saistibasDokumentaNr",
"value": "qui sed"
},
{
"key": "maksajumaUzdevumaNr",
"value": "qui sed"
},
{
"key": "izlaistIerakstus",
"value": "25210683"
},
{
"key": "atgrieztIerakstus",
"value": "25210683"
}
]
}
},
"status": "Unauthorized",
"code": 401,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Lietotājam nav tiesību veikt šo darbību.",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/reports/paymenttransactions?periodsNo=nisi cillum sed&periodsLidz=nisi cillum sed&saistibasDokumentaNr=qui sed&maksajumaUzdevumaNr=qui sed&izlaistIerakstus=25210683&atgrieztIerakstus=25210683",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"reports",
"paymenttransactions"
],
"query": [
{
"key": "periodsNo",
"value": "nisi cillum sed"
},
{
"key": "periodsLidz",
"value": "nisi cillum sed"
},
{
"key": "saistibasDokumentaNr",
"value": "qui sed"
},
{
"key": "maksajumaUzdevumaNr",
"value": "qui sed"
},
{
"key": "izlaistIerakstus",
"value": "25210683"
},
{
"key": "atgrieztIerakstus",
"value": "25210683"
}
]
}
},
"status": "Forbidden",
"code": 403,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
},
{
"name": "Pārsniegts izsaukumu skaita ierobežojums.",
"originalRequest": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/api/reports/paymenttransactions?periodsNo=nisi cillum sed&periodsLidz=nisi cillum sed&saistibasDokumentaNr=qui sed&maksajumaUzdevumaNr=qui sed&izlaistIerakstus=25210683&atgrieztIerakstus=25210683",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"reports",
"paymenttransactions"
],
"query": [
{
"key": "periodsNo",
"value": "nisi cillum sed"
},
{
"key": "periodsLidz",
"value": "nisi cillum sed"
},
{
"key": "saistibasDokumentaNr",
"value": "qui sed"
},
{
"key": "maksajumaUzdevumaNr",
"value": "qui sed"
},
{
"key": "izlaistIerakstus",
"value": "25210683"
},
{
"key": "atgrieztIerakstus",
"value": "25210683"
}
]
}
},
"status": "Too Many Requests",
"code": 429,
"_postman_previewlanguage": "text",
"header": [
{
"key": "Content-Type",
"value": "text/plain"
}
],
"cookie": [
],
"body": ""
}
]
}