AMAGE REST API interface - report generation
Examples of downloading report content in JSON format
To receive the content of the report from the AMAGE system, perform an HTTP GET request to the appropriate URL address. In the query, you must provide the UUID of the tab of the report you want to download. In response, we will receive JSON data that can be processed in any way. In this case (for reports), we can send the device-uuid, api-key and directly api-secret parameters in the query. This makes it easier to generate queries and use API reports using Business Intelligence (BI) systems. It should be emphasized that the api-sign method always works.
Method: GET Path: rest/amage/v1/reports/generate/raw-json/by-bookmark-uuid/{uuid}
Example call via HTTP Client:
GET http://localhost:8000/assetweb/rest/amage/v1/reports/generate/raw-json/by-report-uuid/4a54383a-e44c-414f-93b9-3007d07a5213?lang=pl&amage-device-uuid=c5148dc4-2cf9-47ec-9884-c836b514c3b2&amage-api-key=e5edee274984f58efc02b086aa1e9e45&amage-api-secret=5e3097952485b02c83046690253001e1&object-uuid=1d3b6c7a-d522-4062-9f23-3376694a6ac5 Content-Type: text/html Accept: application/json User-Agent: IntelliJ HTTP Client/IntelliJ IDEA 2024.1.1 Accept-Encoding: br, deflate, gzip, x-gzip Cookie: locale=pl Content-length: 0
Sample answer:
{
"item": {
"GROUP_UUID": "",
"INVENTORY_NUMBER": "X/23/333/2023",
"TESTING_LABORATORY_UUID": "",
"MANUFACTURER_NAME": "AMAGE",
"TYPE_MANUFACTURER_UUID": "b133c9d3-a018-405e-b632-d124ea5c342e",
"SERIAL_NUMBER": "XX15/1/1[A]",
"MANUFACTURER_UUID": "b133c9d3-a018-405e-b632-d124ea5c342e",
"TYPE_MANUFACTURER_NAME": "AMAGE",
"MAP_SHAPE_MAP_NAME": "",
"NOTE": "Test device",
"PARENT_NAME": "100DE15 SPOOL-1",
"IS_EQUIPMENT": "false",
"UUID": "1d3b6c7a-d522-4062-9f23-3376694a6ac5",
"TESTING_LABORATORY_NAME": "",
"PARENT_UUID": "da6243db-abef-44ee-b535-3b1556de6407",
"IDENTIFIERS": " ",
"TYPE_CATALOG_NUMBER": "",
"LOCATION_UUID": "",
"NAME": "100DE15 SPOOL-1 PT-NO-1[A] IC 26_LL PIPE SL, CS, CE, TC2, 114.3X6.3",
"TYPE_UUID": "b4b0c37e-7c39-4946-ab81-7c373c17e37c",
"GROUP_NAME": "",
"TYPE_ORDER_NUMBER": "",
"EQUIPMENT_VALID_TILL_DATE": "-",
"MAP_SHAPE_LONGITUDE": "",
"MAP_SHAPE_LATITUDE": "",
"COUNT": "0,00",
"TYPE_NAME": "Type of the Asset",
"LOCATION_NAME": ""
}
}
Download the report in XLSX format
GET http://localhost:8000/assetweb/rest/amage/v1/reports/generate/xlsx/by-bookmark-uuid/c7fb7b54-5996-44bb-b4a9-134d764103d3 ?lang=en&amage-device-uuid=c5148dc4-2cf9-47ec-9884-c836b514c3b2&amage-api-key=e5edee274984f58efc02b086aa1e9e45 &amage-api-secret=5e3097952485b02c83046690253001e1 Content-Type: text/plain Accept: application/octet-stream
Download the report in PDF format
GET http://localhost:8000/assetweb/rest/amage/v1/reports/generate/pdf/by-bookmark-uuid/c7fb7b54-5996-44bb-b4a9-134d764103d3 ?lang=pl&amage-device-uuid=c5148dc4-2cf9-47ec-9884-c836b514c3b2&amage-api-key=e5edee274984f58efc02b086aa1e9e45 &amage-api-secret=5e3097952485b02c83046690253001e1&object-uuid=1d3b6c7a-d522-4062-9f23-3376694a6ac5 Content-Type: text/plain Accept: application/octet-stream
Downloading the report in JSON format
This method generates the JSON format using the JasperReports library interface. Poorer quality of generated code was noticed. Use the above. methods for integration with the AMAGE system, |
GET http://localhost:8000/assetweb/rest/amage/v1/reports/generate/json/by-bookmark-uuid/c7fb7b54-5996-44bb-b4a9-134d764103d3 ?lang=en&amage-device-uuid=c5148dc4-2cf9-47ec-9884-c836b514c3b2&amage-api-key=e5edee274984f58efc02b086aa1e9e45 &amage-api-secret=5e3097952485b02c83046690253001e1&object-uuid=1d3b6c7a-d522-4062-9f23-3376694a6ac5 Content-Type: text/plain Accept: application/json