The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Analytics

External Resources

More Info


Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourRed
titlePage Deprecated
: Updated content located here.

Choosing a REST API Endpoint

If you run Appium tests with your:

...

Please use the Unified Platform Storage REST API (app.saucelabs.com

Tip

To retrieve your Sauce Labs credentials:

...

Please use the Legacy Real Device Cloud REST API (app.testobject.com)

Tip

To retrieve your Test Object credentials:

Below are some examples of how to use the Sauce Labs REST API to upload your mobile application to Sauce Storage. Please select your Sauce Labs Testing Platform whether you're using Test Object (Legacy) or the Sauce Labs Unified Platform.

...

directionhorizontal

...

idunified-platform-api
titleUnified Platform API

Unified Platform API

...

US Data Center

...

Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -w "%{http_code}\n" \
-H "Content-Type: application/octet-stream" \
https://app.saucelabs.com/rest/v1/storage/$SAUCE_USERNAME/app-debug.apk?overwrite=true \
--data-binary @app-debug.apk

...

EU Data Center

...

Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -w "%{http_code}\n" \
-H "Content-Type: application/octet-stream" \
https://app.eu-central-1.saucelabs.com/rest/v1/storage/$SAUCE_USERNAME/app-debug.apk?overwrite=true \
--data-binary @app-debug.apk

...

idlegacy-api
titleLegacy Real Device API

Legacy Real Device API

...

US Data Center

Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" --data-binary @your_app.apk

...

titleUseful Header Parameters

App-DisplayName

A custom display name for your app.

Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-DisplayName: yourCustomDisplayName" --data-binary @your_app.apk

App-Identifer

A custom identifier for your app.

Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-Identifier: identifier_for_your_app" --data-binary @your_app.apk

...

EU Data Center

Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" --data-binary @your_app.apk

...

titleUseful Header Parameters

App-DisplayName

A custom display name for your app.

Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-DisplayName: yourCustomDisplayName" --data-binary @your_app.apk

App-Identifer

A custom identifier for your app.

Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-Identifier: identifier_for_your_app" --data-binary @your_app.apk