Skip to end of metadata
Go to start of metadata

Get Jobs

List recent jobs belonging to a specific user

GET /rest/v1/USERNAME/jobs
Parameters

limit

optional

positive integer, default 100, max 500

 Specifies the number of jobs to return

skip

optional

positive integer, default 0

Skips the specified number of jobs

full

optional

boolean, default false

Get full job information, rather than just IDs.

Example values true or false

from

optional

timestamp

 Get jobs since the specified time

to

optional

timestamp

 Get jobs until the specified time

format

optional 

sting, one of json or csv

default json

 Get job info in the specified format

Example getting the last 100 job IDs, skipping 20 most recent jobs
curl -u USERNAME:ACCESS_KEY 'https://saucelabs.com/rest/v1/USERNAME/jobs?limit=100&skip=20'


 

Update Job

Edit an existing job

PUT /rest/v1/USERNAME/jobs/JOB_ID

Updating Jobs for Windows Users

Because of the complex syntax required for updating job information via cURL, you should update job information using the methods described in Test Configuration and Annotation.. 

Parameters

name

optional

string

 If specified change the job name

tags

optional

string, JSON array

If present set tags for job

public

optional

string or boolean

Set job visibility 

Example values:

  • public
  • public restricted
  • share or true
  • team or false 
  • private

passed

optional

boolean

Set whether the job passed or not on the user end

build

optional

positive integer

The build number for this test

custom-data

optional 

JSON object

Extra key-value pairs with any info that a user would like to add to the job.

Max data allowed is 64KB

curl -X PUT -u USERNAME:ACCESS_KEY \
-H "Content-Type: application/json" \
-d '{
"tags": ["testing-rest-api"],
"name": "REST API Test",
"custom-data": {"source": "Testing REST API"}
}' \ 
https://saucelabs.com/rest/v1/USERNAME/jobs/JOB_ID

 

Delete Job

Removes the job from the system with all the linked assets

DELETE /rest/v1/USERNAME/jobs/JOB_ID
curl -X DELETE -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/USERNAME/jobs/JOB_ID 

 

Stop Job

Terminates a running job

PUT /rest/v1/USERNAME/jobs/JOB_ID/stop
curl -X PUT -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/USERNAME/jobs/JOB_ID/stop 


Get Job Asset Names

Get details about the static assets collected for a specific job

Response Fields

Each of these fields will be set to null if the specific asset isn't captured for a job

  • sauce-log: [string] Name of the Sauce log recorded for a job
  • selenium-log: [string] Name of the selenium Server log file produced by a job
  • video: [string] Name of the video file name recorded for a job
  • screenshots: [array of strings] List of screenshot names captured by a job

 

GET /rest/v1/USERNAME/jobs/JOB_ID/stop
curl -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/USERNAME/jobs/JOB_ID/assets 


Get Job Asset Files

Download job assets. After a job completes, all assets created during the job are available via this API. These include the screencast recording, logs, and screenshots taken on crucial steps.

The job assests will be deleted from the test page after 30 days. Thus, after 30 days all your test commands, logs, screenshots and the screencast recording will be gone. This is the reason why we strongly recommend to download your job assets if this is an information that you must keep in your records.

GET /rest/v1/USERNAME/jobs/JOB_ID/assets/FILE_NAME 

Parameters

file_name

required

Accepted values

  • selenium-server.log
  • video.flv
  • XXXXscreenshot.png (where XXXX is a number between 0000 and 9999)
  • final_screenshot.png

curl -u USERNAME:ACCESS_KEY -O https://saucelabs.com/rest/v1/USERNAME/jobs/JOB_ID/assets/final_screenshot.png 

 

Delete Job Assets

Delete all the assets captured during a test run. This includes the screencast recording, logs, and all screenshots.

DELETE /rest/v1/USERNAME/jobs/JOB_ID/assets
curl -X DELETE -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/USERNAME/jobs/JOB_ID/assets