================================================== Reports ================================================== .. meta:: :description: Report generation and management in E-BLOC platform :keywords: documentation, ebloc, reports, documents, download .. contents:: Table of Contents :depth: 3 :local: 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: .. toctree:: :maxdepth: 3 :caption: Related Endpoints app-info/documents/documents app-info/generic 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** .. dropdown:: Using curl :color: primary :icon: info .. code-block:: shell :caption: cURL command :linenos: curl 'https://www.e-bloc.ro/ajax/DownloadAvizierDoc.php?id=[REP-ID]' \ -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]' \ -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' .. dropdown:: Using Postman :color: primary :icon: info .. image:: ../resources/forge-postman-downloadavizierdoc.png :width: 400 :alt: Download Avizier Doc in Postman :align: center **Response** .. dropdown:: Success Response :color: success :icon: info .. code-block:: text :caption: Binary PDF/file output :linenos: Binary format for a PDF or file output - the report document **Error Response** .. dropdown:: Error Response :color: danger :icon: info .. code-block:: html :caption: Error response :linenos: Authentication failure or invalid report ID :linenos: Download document workflow ========================================== This aims to provide a workflow to idenfify and download a report. For this the following steps can be used: #. Get the cookie or auth in place #. Choose a date for which you want to take the report #. Force a AjaxGetAvizierLuni request #. Parse the output and identify if the YYYY-MM defined is present in the list: #. If not, then there is no data for that specific month #. If yes, continue #. Force a AjaxGetHomeAp request #. Parse the output and identify the AP-ID #. Force a AjaxGetAvizierDoc request #. Parse the response and identify the document that you are interested in, get the REP-ID #. Force a DownloadAvizierDoc request #. Save the response as a report #. Done :)