Skip to end of metadata
Go to start of metadata

Sauce Labs provides temporary storage inside our network for mobile applications that you want to test, and prerun executables to use during your tests. Check out Uploading Mobile Applications for Testing for more information. 

Standard URL: https://saucelabs.com/rest/v1/


Finding Your Username and Access Key

You can find your Sauce Labs username and access key in the User Profile > User Settings section of your Sauce Labs dashboard.

MethodDescriptionURLMethod TypeRequest FieldsExample Request

Upload File

Uploads a file to the temporary sauce storage. The storage will only retain the files for seven days.storage/:username/:your_file_namePOST
 Examples

macOS/Linux:

curl -u YOUR_USERNAME:YOUR_ACCESS_KEY \
-X POST \
-H 'Content-Type: application/octet-stream' \
https://saucelabs.com/rest/v1/storage/YOUR_USERNAME/test_file_name?overwrite=true \
--data-binary @PATH_TO_TEST_FILE 

Windows:

curl -u YOUR_USERNAME:YOUR_ACCESS_KEY -X POST -H 'Content-Type: application/octet-stream' https://saucelabs.com/rest/v1/storage/YOUR_USERNAME/test_file_name?overwrite=true --data-binary @/path/to/your_file_name

 

Note: The '@' character before the path to the file to upload in the examples above is important. This tells curl to stream the contents of the specified file. Without the '@' character, only the actual filename (as a string) will be uploaded, and your test will not run.



Overwriting Files

By default, the REST API prevents overwriting files already stored in the temporary sauce storage. The overwrite=true query parameter (shown in the example) can be added to allow overwriting. 


Get Stored Files

Check which files are in your temporary storagestorage/:usernameGET


 OS X/Linux Example
curl -u YOUR_USERNAME:YOUR_ACCESS_KEY \
https://saucelabs.com/rest/v1/storage/YOUR_USERNAME
 Windows Example

curl -u YOUR_USERNAME:YOUR_ACCESS_KEY https://saucelabs.com/rest/v1/storage/YOUR_USERNAME