Reports

Introduction

This section documents how E-BLOC handles report generation, retrieval, and management. It covers obtaining report information and downloading reports using available endpoints.

Retrieving Report Information

To obtain report IDs for downloading, use the following backend methods:

Downloading Reports

Reports can be downloaded using the DownloadAvizierDoc method with a report ID (REP-ID).

DownloadAvizierDoc

Download a report by its report ID (REP-ID).

Request

Using curl
cURL command
1curl 'https://www.e-bloc.ro/ajax/DownloadAvizierDoc.php?id=[REP-ID]' \
2   -b 'username=[EMAIL]; facturi-luna-cur=-; index-luna-cur=-; asoc-cur=[AS-ID]; home-ap-cur=[AS-ID]-[AP-ID]; home-stat-cur=[MM]; PHPSESSID=[COOKY]; avizier-luna-cur=[YYYY]-[MM]' \
3   -H 'User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Mobile Safari/537.36'
Using Postman

Response

Success Response
Binary PDF/file output
1Binary format for a PDF or file output - the report document

Error Response

Error Response
Error response
1Authentication failure or invalid report ID
2:linenos:
3
4<script type="text/javascript">
5   window.location.replace( "../index.php?page=" + 4 );
6</script>

Download document workflow

This aims to provide a workflow to idenfify and download a report.

For this the following steps can be used:

  1. Get the cookie or auth in place

  2. Choose a date for which you want to take the report

  3. Force a AjaxGetAvizierLuni request

  4. Parse the output and identify if the YYYY-MM defined is present in the list:
    1. If not, then there is no data for that specific month

    2. If yes, continue

  5. Force a AjaxGetHomeAp request

  6. Parse the output and identify the AP-ID

  7. Force a AjaxGetAvizierDoc request

  8. Parse the response and identify the document that you are interested in, get the REP-ID

  9. Force a DownloadAvizierDoc request

  10. Save the response as a report

  11. Done :)