Reports
[GET] /report/<report_id>
Retrieves the details of a Report by ID
Example Response:
{
'accepted_by_id': None,
'comments': None,
'date_accepted': None,
'date_emailed': None,
'date_generated': '06/09/2020 06:12 AM',
'date_public': '06/09/2020 03:47 PM',
'date_published': '06/09/2020 03:47 PM',
'emailed': False,
'emailed_by_id': 8,
'generated_by': {'email': 'melvin@qbench.net',
'first_name': 'Melvin',
'id': 8,
'last_name': 'Caraang'},
'generated_by_api_client_id': None,
'generated_by_id': 8,
'id': 4666,
'id_hash': 'f32cb100d659c39',
'is_public': True,
'made_public_by_api_client_id': None,
'made_public_by_id': 8,
'order_id': None,
'published_by_api_client_id': None,
'qb40': '5c09d3eb9e8',
'render_status': 'SUCCESSFUL',
'report_config_id': 184,
'sample_id': 3541,
'state': 'PUBLISHED',
'test_id': None
}
[GET] /report/order/<order_id>/all
[GET] /report/sample/<sample_id>/all
[GET] /report/test/<test_id>/all
Retrieves all reports for the requested Data Type by ID
URL Params:
- emailed
- Flag to only retrieve emailed reports. Expects the string 'true' or 'false'
- public
- Flag to only retrieve public reports. Expects the string 'true' or 'false'
- statuses
- Comma separated list of statuses to retrieve reports by. Valid values are ["PUBLISHED", "WITHDRAWN", "OVERRIDDEN"]
Response to example endpoint /report/sample/3541/all:
{
'data': [{'accepted_by_id': None,
'comments': None,
'date_accepted': None,
'date_emailed': None,
'date_generated': '06/09/2020 06:12 AM',
'date_public': '06/09/2020 03:47 PM',
'date_published': '06/09/2020 03:47 PM',
'emailed': False,
'emailed_by_id': 8,
'generated_by': {'email': 'melvin@qbench.net',
'first_name': 'Melvin',
'id': 8,
'last_name': 'Caraang'},
'generated_by_api_client_id': None,
'generated_by_id': 8,
'id': 4666,
'id_hash': 'f32cb100d659c39',
'is_public': True,
'made_public_by_api_client_id': None,
'made_public_by_id': 8,
'order_id': None,
'published_by_api_client_id': None,
'render_status': 'SUCCESSFUL',
'report_config_id': 184,
'sample_id': 3541,
'state': 'PUBLISHED',
'test_id': None},
{'accepted_by_id': None,
'comments': None,
'date_accepted': None,
'date_emailed': None,
'date_generated': '05/22/2020 01:07 AM',
'date_public': '05/22/2020 01:07 AM',
'date_published': None,
'emailed': False,
'emailed_by_id': None,
'generated_by': {'email': 'wellson@qbench.net',
'first_name': 'Wellson',
'id': 68,
'last_name': 'Wu'},
'generated_by_api_client_id': None,
'generated_by_id': 68,
'id': 4657,
'id_hash': 'fc247a429ba9db8',
'is_public': True,
'made_public_by_api_client_id': None,
'made_public_by_id': 68,
'order_id': None,
'published_by_api_client_id': None,
'render_status': 'SUCCESSFUL',
'report_config_id': 1,
'sample_id': 3541,
'state': None,
'test_id': None}],
'qb45': '9bdc',
'total_count': 2,
'total_pages': 1}
[GET] /report/order/<order_id>/info
[GET] /report/sample/<sample_id>/info
[GET] /report/test/<test_id>/info
Retrieves information about the latest Order/Sample/Test Level Report by ID
URL Params:
- emailed
- Flag to only retrieve the latest emailed report. Expects the string 'true' or 'false'
- public
- Flag to only retrieve the latest public report. Expects the string 'true' or 'false'
- status
- Report status to filter by. Valid values are ["PUBLISHED", "WITHDRAWN", "OVERRIDDEN"]
Response to example endpoint /report/test/8222/info?status=PUBLISHED
{
'accepted_by_id': None,
'comments': None,
'date_accepted': None,
'date_emailed': None,
'date_generated': '06/09/2020 03:59 PM',
'date_public': None,
'date_published': '06/09/2020 04:02 PM',
'emailed': False,
'emailed_by_id': 8,
'generated_by': {'email': 'melvin@qbench.net',
'first_name': 'Melvin',
'id': 8,
'last_name': 'Caraang'},
'generated_by_api_client_id': None,
'generated_by_id': 8,
'id': 4668,
'id_hash': None,
'is_public': None,
'made_public_by_api_client_id': None,
'made_public_by_id': None,
'order_id': None,
'published_by_api_client_id': None,
'qb0d0': 'd7',
'render_status': 'SUCCESSFUL',
'report_config_id': 5,
'sample_id': None,
'state': 'PUBLISHED',
'test_id': 8222}
[POST] <qbench-url>/qbench/api/v1/report
Will generate a new report with the provided config ID and entity IDs. Can be used to create a report for order, sample, or test. Returns the ID of the newly created report.
Example request:
POST /qbench/api/v1/report?report_config_id=10&test_ids=100&test_ids=101 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
“id”: 101
}
Params:
- report_config_id: The ID of the report config template to use
- test_id: The test ID to generate the report for
- test_ids: List of test IDs to generate the report for
- signature_id: The signature ID to use in the report
- batch: Boolean (true/false) whether or not this request should create multiple reports
- timezone: Specific timezone to display dates/times (e.g. “America/Los_Angeles”)
[GET] <qbench-url>/qbench/api/v1/report/sample/{sampleId}
Will retrieve a url to download the most recent report for a sample. These URLs are valid for 1 hour. These URLs should not be stored for future use as they are NOT a link for the permanent location of a report file.
Example request:
GET /qbench/api/v1/report/sample/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"url": "https://qbench-example.s3.amazonaws.com/example/1/1/1.pdf
?AWSAccessKeyId=AKIAIWFDFGVC7FRBVA
&Expires=1499818984
&Signature=ySJa%2FhLDKmGjSbo5xC9Rah%2Bh1cc%3D"
}
[GET] <qbench-url>/qbench/api/v1/report/test/{testId}
Will retrieve a url to download the most recent report for a test. These URLs are valid for 1 hour. These URLs should not be stored for future use as they are NOT a link for the permanent location of a report file.
Example request:
GET /qbench/api/v1/report/test/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"url": "https://qbench-example.s3.amazonaws.com/example/2/1/1.pdf
?AWSAccessKeyId=AKIAIWFDFGVC7FRBVA
&Expires=1499818984
&Signature=ySJa%2FhLDKmGjSbo5xC9Rah%2Bh1cc%3D"
}
[POST] <qbench-url>/qbench/api/v1/report/order/upload
Upload a report to all the Orders associated to the `test_ids` passed as URL Params.
Example request:
POST /qbench/api/v1/report/order/upload?&test_ids=100&test_ids=101&cover_page_template_id=3&signature_id=4 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"message": "OK"
}
Params:
- test_ids: List of Test IDs that will determine which Orders the report will be uploaded to.
- signature_id: The signature ID to use in the report.
- cover_page_template_id: Report template ID to be prepended to the uploaded report.
Other Request Data:
- file: Report file data to upload.
[POST] <qbench-url>/qbench/api/v1/report/sample/upload
Upload a report to all the Samples associated to the `test_ids` passed as URL Params.
Example request:
POST /qbench/api/v1/report/sample/upload?&test_ids=100&test_ids=101&cover_page_template_id=3&signature_id=4 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"message": "OK"
}
Params:
- test_ids: List of Test IDs that will determine which Orders the report will be uploaded to.
- signature_id: The signature ID to use in the report.
- cover_page_template_id: Report template ID to be prepended to the uploaded report.
Other Request Data:
- file: Report file data to upload.
[POST] <qbench-url>/qbench/api/v1/report/test/upload
Upload a report to all the Tests provided by the `test_ids` passed as URL Params.
Example request:
POST /qbench/api/v1/report/test/upload?&test_ids=100&test_ids=101&cover_page_template_id=3&signature_id=4 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"message": "OK"
}
Params:
- test_ids: List of Test IDs that will determine which Orders the report will be uploaded to.
- signature_id: The signature ID to use in the report.
- cover_page_template_id: Report template ID to be prepended to the uploaded report.
Other Request Data:
- file: Report file data to upload.
[POST] <qbench-url>/qbench/api/v1/report/order/publish/<order_id>
Publish a generated order report to the customer portal.
Example request:
POST /qbench/api/v1/report/order/publish/123?&test_ids=100&test_ids=101 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"message": "OK"
}
Params:
- test_ids <list> (required): List of Test IDs on the Order that will be included in the context of the publish report email and determines the Order to publish.
- additional_emails <list>: List of emails that will be sent along with the default emails for the "Report Published" email.
- attachment_ids <list>: List of attachment IDs on the Order to include in the "Report Published" email.
- printdoc_attachment_ids <list>: List of printdoc attachment IDs on the Order that will be included in the "Report Published" email.
- send_emails <bool>: Flag to determine if the "Publish Report" email should be sent out. Default is "false".
- attach_report <bool>: Flag that determines if the Report should be included in the "Publish Report" email. Default is "false".
- message <string>: Custom message to be included in the "Publish Report" email.
[POST] <qbench-url>/qbench/api/v1/report/sample/publish/<sample_id>
Publish a generated sample report to the customer portal.
Example request:
POST /qbench/api/v1/report/sample/publish/123?&test_ids=100&test_ids=101 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"message": "OK"
}
Params:
- test_ids <list> (required): List of Test IDs on the Sample that will be included in the context of the publish report email and determines the Sample to publish.
- additional_emails <list>: List of emails that will be sent along with the default emails for the "Report Published" email.
- attachment_ids <list>: List of attachment IDs on the Sample to include in the "Report Published" email.
- printdoc_attachment_ids <list>: List of printdoc attachment IDs on the Sample that will be included in the "Report Published" email.
- send_emails <bool>: Flag to determine if the "Publish Report" email should be sent out. Default is "false".
- attach_report <bool>: Flag that determines if the Report should be included in the "Publish Report" email. Default is "false".
- message <string>: Custom message to be included in the "Publish Report" email.
[POST] <qbench-url>/qbench/api/v1/report/test/publish/<test_id>
Publish a generated test report to the customer portal.
Example request:
POST /qbench/api/v1/report/test/publish/100?&test_ids=100 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"message": "OK"
}
Params:
- test_ids <list> (required): The Test ID that has the report that is going to be published.
- additional_emails <list>: List of emails that will be sent along with the default emails for the "Report Published" email.
- attachment_ids <list>: List of attachment IDs on the Test to include in the "Report Published" email.
- printdoc_attachment_ids <list>: List of printdoc attachment IDs on the Test that will be included in the "Report Published" email.
- send_emails <bool>: Flag to determine if the "Publish Report" email should be sent out. Default is "false".
- attach_report <bool>: Flag that determines if the Report should be included in the "Publish Report" email. Default is "false".
- message <string>: Custom message to be included in the "Publish Report" email.
Comments
0 comments
Please sign in to leave a comment.