Tests
GET <qbench-url>/qbench/api/v1/test/{testId}
Will retrieve a test by its ID.
Example request:
GET /qbench/api/v1/test/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"assay_id": 1,
"comments": "Example comment.",
"complete_date": "02/02/2017",
"date_created": "02/02/2017",
"estimated_complete_date": "05/31/2017",
"estimated_start_date": "05/09/2017",
"id": 1,
"results": "Pass",
"sample_id": 1,
"start_date": "02/02/2017",
"state": "COMPLETED",
"tags": [],
"tech_id": null
}
GET <qbench-url>/qbench/api/v1/test?page_num={pageNum}&page_size={pageSize}
Will retrieve a paginated list of test. Maximum page size is 50.
Optional query string params:
- customer_ids (repeatable):
- Will retrieve tests only where its associated order has one of the specified customer IDs.
- assay_ids (repeatable):
- Will retrieve tests only for the specified assay IDs.
- panel_ids (repeatable):
- Will retrieve tests only for the specified panel IDs
- tech_ids (repeatable):
- Will retrieve tests only where its assigned user's ID matches one of the specified tech IDs.
- test_tags (repeatable):
- Will retrieve tests where any of its tags match one of the specified tags.
- sample_tags (repeatable):
- Will retrieve tests where any of its associated sample's tags match one of the specified tags.
- order_tags (repeatable):
- Will retrieve tests where any of its associated order's tags match one of the specified tags.
- order_ids (repeatable):
- Will retrieve tests only where its associated order's ID matches one of the specified order IDs.
- sample_ids (repeatable):
- Will retrieve tests only where its associated sample's ID matches one of the specified sample IDs.
- source_ids (repeatable):
- Will retrieve tests only where its associated source's ID matches one of the specified source IDs.
- location_ids (repeatable):
- Will retrieve tests only where its associated location's ID matches one of the specified location IDs.
- statuses (repeatable):
- Will retrieve tests only where its status matches one of the specified statuses.
- sample_complete:
- Value must be true. Will retrieve only tests where all tests assigned to its associated sample are in the COMPLETED or CANCELLED status.
- results:
- Will retrieve tests where its results match or are similar to the specified value.
- sample_description:
- Will retrieve tests where its associated sample' s description matches or is similar to the specified value.
- date_received_start/date_received_end:
- Will retrieve tests where its associated order's date received is within the date range specified (Both start and end required. Date values must be in mm/dd/yyyy format).
- date_required_start/date_required_end:
- Will retrieve tests where its associated order's due date is within the date range specified (Both start and end required. Date values must be in mm/dd/yyyy format).
- estimated_start_date_start/estimated_start_date_end:
- Will retrieve tests where its estimated start date is within the date range specified (Both start and end required. Date values must be in mm/dd/yyyy format).
- estimated_complete_date_start/estimated_complete_date_end:
- Will retrieve tests where its estimated complete date is within the date range specified (Both start and end required. Date values must be in mm/dd/yyyy format).
- start_date_start/start_date_end:
- Will retrieve tests where its start date is within the date range specified (Both start and end required. Date values must be in mm/dd/yyyy format).
- complete_date_start/complete_date_end:
- Will retrieve tests where its complete date is within the date range specified (Both start and end required. Date values must be in mm/dd/yyyy format).
- emailed:
- Value must be true or false. A value of true will retrieve only tests that have been emailed. A value of false will retrieve only tests that have NOT been emailed.
- overdue:
- Value must be true. Will retrieve only tests its estimated complete date is earlier than today's date.
- order_overdue:
- Value must be true. Will retrieve only tests where its associated order's due date is earlier than today's date.
- sort_by:
- Specify a field to sort by. Sorting can only be done by QBench defined fields. Custom fields are not supported. The following fields are supported:
- id
- date_created
- estimated_start_date
- estimated_complete_date
- start_date
- complete_date
- results
- comments
- sample_id
- assay_id
- tech_id
- state
- sort_order
- Sort ascending or descending. Value must be asc or desc.
Example request:
GET /qbench/api/v1/test?page_num=1&page_size=50 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"total_count": 75,
"total_pages": 2,
"data": [
{
"tags": [],
"sample_id": 49,
"results": null,
"comments": null,
"start_date": null,
"state": "NOT STARTED",
"tech_id": 1,
"estimated_complete_date": "05/17/2017",
"estimated_start_date": "05/15/2017",
"complete_date": null,
"date_created": "05/12/2017",
"assay_id": 1,
"id": 37
},
{
"tags": [],
"sample_id": 32,
"results": "Pass",
"comments": "Comments.",
"start_date": "03/31/2017",
"state": "COMPLETED",
"tech_id": 1,
"estimated_complete_date": "03/31/2017",
"estimated_start_date": "03/31/2017",
"complete_date": "03/31/2017",
"date_created": "03/31/2017",
"assay_id": 1,
"id": 32
},
...
]
}
POST <qbench-url>/qbench/api/v1/test
Will create a new test. Sample ID and assay ID are required.
Example request:
POST /qbench/api/v1/test HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
"assay_id": 1,
"sample_id": 1,
}
Example response:
{"id":8}
POST <qbench-url>/qbench/api/v1/test/{testId}
Will update an existing test. Sample ID and assay ID cannot be null.
Example request:
POST /qbench/api/v1/test/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
"results":"Pass"
}
Example response:
{"message":"OK"}
DELETE <qbench-url>/qbench/api/v1/test/{testId}
Will delete a test.
Example request:
DELETE /qbench/api/v1/test/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{"message":"OK"}
Patch Worksheet Data
PATCH <qbench-url>/qbench/api/v1/test/{test_id}/worksheet
Will patch the worksheet data on the Test referenced by the test_id in the URL.
Example request:
PATCH /qbench/api/v1/test/1/worksheet HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
"data": {
"input_1": "Updated Value",
"input_2": "Another Updated Value"
}
}
Example response:
{"message":"OK"}
If your worksheet requires a reason for updating, the reason can be included in the payload like so:
{
"data": {
"input_1": "Updated Value",
"input_2": "Another Updated Value"
},
"qbench_update_reason": "These values need to be updated!"
}
Notes
- If you are updating a Spreadsheet Worksheet type, you can use the named cell value instead of the Cell name if a named cell has been defined.
Comments
0 comments
Please sign in to leave a comment.