Automation Sources
The automation/sources
namespace provides API methods to retrieve all or specific automation sources for a project. This page covers the following API methods:
GET /projects/{project_id}/automation/sources
/projects/{project_id}/automation/sources
Returns all automation sources for a project.
This method uses pagination so you might need to request additional pages to retrieve all automation sources.
project_id
id
required
ID of the project.
Request
page
integer
Number of page to return (default: first page)
per_page
integer
Maximum number of automation sources to return (supported: 15
, 25
, 50
, 100
; default: 100
)
sort
string
Sort field for the list of automation sources (supported: automation_sources:created_at
, automation_sources:ran_at
, automation_sources:retired_at
; default: automation_sources:created_at
)
order
string
Sort order (ascending or descending) (supported: asc
, desc
; default: desc
)
is_retired
boolean
Limit result to active or retired automation sources only.
expands
string
Comma-separated list of expands to return.
This method supports the following expands so you can automatically include additional information for referenced objects:
users
Response
GET /api/v1/projects/1/automation/sources
200 OK
{
"page": 1,
"prev_page": null,
"next_page": 2,
"last_page": 2,
"per_page": 100,
"total": 150,
"result": [
{
"id": 1,
"project_id": 1,
"name": "backend",
"status": 2,
..
"is_retired": false,
"run_count": 100,
"test_count_average": 2000,
"elapsed_average": 1000000,
"ran_at": "..",
"created_at": "..",
"created_by": 2,
"updated_at": null,
"updated_by": null,
"retired_at": null,
"retired_by": null
},
{
"id": 2,
"project_id": 1,
"name": "frontend",
"status": 3,
..
"is_retired": true,
"run_count": 200,
"test_count_average": 3000,
"elapsed_average": 1500000,
"ran_at": "..",
"created_at": "..",
"created_by": 2,
"updated_at": null,
"updated_by": null,
"retired_at": "..",
"retired_by": 1
},
..
],
"expands": {
..
}
}
Examples
// Get latest 100 automation sources for project with ID 5
GET /api/v1/projects/5/automation/sources
// Get second result page (pagination)
GET /api/v1/projects/5/automation/sources?page=2
// Get latest 100 active automation sources
GET /api/v1/projects/5/automation/sources?is_retired=0
// Get latest 100 retired automation sources, ordered by retire date
GET /api/v1/projects/5/automation/sources?is_retired=1&sort=automation_sources:retired_at
// Get automation sources and include user details
GET /api/v1/projects/5/automation/sources?expands=users
Status codes
200
400
401
403
422
(details)
GET /automation/sources/{automation_source_id}
/automation/sources/{automation_source_id}
Returns a single automation source.
automation_source_id
id
required
ID of the automation source to return.
Request
expands
string
Comma-separated list of expands to return.
This method supports the following expands so you can automatically include additional information for referenced objects:
users
Response
GET /api/v1/automation/sources/1
200 OK
{
"result": {
"id": 1,
"project_id": 1,
"name": "backend",
"status": 2,
..
"is_retired": false,
"run_count": 100,
"test_count_average": 2000,
"elapsed_average": 1000000,
"ran_at": "..",
"created_at": "..",
"created_by": 2,
"updated_at": null,
"updated_by": null,
"retired_at": null,
"retired_by": null
},
"expands": {
..
}
}
Examples
// Get the automation source with ID 5
GET /api/v1/automation/sources/5
// Get a automation source and include user details
GET /api/v1/automation/sources/1?expands=users
Status codes
200
400
401
403
404
422
(details)
Last updated
Was this helpful?