DrillPlan's Reporting API provides access to reports created in DrillPlan.
A project ID needs to be provided to enumerate reports. A project ID can be obtained by listing user-joined projects using the /drillplan/plan/v1/projects/joined end-point exposed as part of Project Plan API. After obtaining a project ID, the reports created in that project can be retrieved by executing a GET request using /drillplan/reporting/v2/projects/{projectId}/reports end-point.
Such tasks as report creation, report update, and report export implemented as asynchronous processes and requires several HTTP calls to the Reporting API to be completed.
An asynchronous task for creating a report can be created via executing a POST using
/drillplan/reporting/v2/projects/{projectId}/reports/createend-point and providing the following payload:{ "name": "New report name", "template": "Template name", "callback": { "uri": "https://example.com/callback", "headers": { "Authorization": "Bearer your_token_here", "Custom-Header": "custom_header_value" } } }Available report templates could be obtained via executing a GET request using
/drillplan/reporting/v2/templatesend-point.Once the report creation is complete, the DrillPlan Reporting subsystem will send a POST request to the specified callback endpoint with the following payload:
{ "id": "395849cf9bbf440d91", // ID of the task the callback is related to. "status": "Succeeded", // The task execution status. "artifacts": { "report_id": "ac5ed2e4e05976" // The created report ID. } }You can also retrieve the tasks created in step 1 by sending a GET request to
/drillplan/reporting/v2/projects/{projectId}/tasks/{taskId}.After obtaining the
report_id, you can get the result of the report creation by sending a GET request to/drillplan/reporting/v2/projects/{projectId}/reports/{reportId}.
An asynchronous task for updating a report can be created via executing a POST using
/drillplan/reporting/v2/projects/{projectId}/reports/{reportId/content/updateend-point and providing the following payload:{ // Optional // "chapters": [ // { // "id": 123412 // } //] "callback": { "uri": "https://example.com/callback", "headers": { "Authorization": "Bearer your_token_here", "Custom-Header": "custom_header_value" } } }Where the
chaptersfield contains a list of chapters that needed to be updated. Thechaptersfield is optional and if not provided, all report chapters are updated.Once the report update is complete, the DrillPlan Reporting subsystem will send a POST request to the specified callback endpoint with the following payload:
{ "id": "395849cf9bbf440d91", // ID of the task the callback is related to. "status": "Succeeded", // The task execution status. }You can also retrieve the tasks created in step 1 by sending a GET request to
/drillplan/reporting/v2/projects/{projectId}/tasks/{taskId}.
An asynchronous task for exporting a report should be created by executing a POST request using
/drillplan/reporting/v2/projects/{projectId}/reports/{reportId}/content/exportend-point.The payload provided in the request should contain the required content type of the exported report, e.g.:
{ "content_type": "application/pdf", "callback": { "uri": "https://example.com/callback", "headers": { "Authorization": "Bearer your_token_here", "Custom-Header": "custom_header_value" } } }Successful responses to such task creation requests contain a task ID that can be used to monitor the task state.
Once the report export is complete, the DrillPlan Reporting subsystem will send a POST request to the specified callback endpoint with the following payload:
{ "id": "395849cf9bbf440d91", // ID of the task the callback is related to. "status": "Succeeded", // The task execution status. "artifacts": { "export_id": "ac5ed2e4e05976" } }You can also retrieve the tasks created in step 1 by sending a GET request to
/drillplan/reporting/v2/projects/{projectId}/tasks/{taskId}.After obtaining the
export_id, the result of the export operation can be received by issuing a GET request to/drillplan/reporting/v2/projects/{projectId}/exports/{exportId}. Successful responses to such requests should contain binary data of the requested media type.
🚩Important: In cases where a report update is in progress, attempts to create an export task should fail with HTTP status code 423 (Locked). After some time has passed, the request can be re-issued.