The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Insights

External Resources

More Info


Page tree

Versions Compared

Key

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

...

Tabs Container
directionhorizontal
Tabs Page
idunified-platform-api
titleUnified Platform API

Unified Platform API

US Data Center

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \ https://api.us-west-1.saucelabs.com/v1/rdc/apps/upload -H \
-w "%{http_code}\n" \
-H "Content-Type: application/octet-stream
" -H \ "App-DisplayName: yourCustomDisplayName" --data-binary @your_app.apk

App-Identifer

A custom identifier for your app.

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY
"
-X POST
 \
https://
api.us-west-1.
app.saucelabs.com/rest/v1/
rdc
storage/
apps/upload -H
$SAUCE_USERNAME/app-debug.apk?overwrite=true \
"Content
-
Type: application/octet-stream" -H \ "App-Identifier: identifier_for_your_app" -
-data-binary 
@your_app
@app-debug.apk
Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://api.us-west-1.saucelabs.com/v1/rdc/apps/upload -H \
"Content-Type: application/octet-stream" --data-binary @your_app.apk
Info
titleUseful Header Parameters

App-DisplayName

A custom display name for your app.

Code Block
Code Block

EU Data Center

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \ https://api.eu-central-1.saucelabs.com/v1/rdc/apps/upload -H \
-w "%{http_code}\n" \
-H "Content-Type: application/octet-stream" 
-H
\
"App-DisplayName: yourCustomDisplayName"

--data-binary @your_app.apk

App-Identifer

A custom identifier for your app.

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://
api
app.eu-central-1.saucelabs.com/rest/v1/
rdc
storage/
apps/upload -H
$SAUCE_USERNAME/app-debug.apk?overwrite=true \
"Content
-
Type: application/octet-stream" -H \ "App
-
Identifier: identifier_for_your_app" --
data-binary 
@your_app
@app-debug.apk
Code Block
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \ https://api.eu-central-1.saucelabs.com/v1/rdc/apps/upload -H \
"Content-Type: application/octet-stream" --data-binary @your_app.apk
Info
titleUseful Header Parameters

App-DisplayName

A custom display name for your app.

Code Block
Code Block
Tabs Page
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
Info
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
Info
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
Tip
titleCheck if App Already Exists

You can use a custom app identifier to to check if an app was already uploaded.

First, get all the apps for a specified MD5:

Code Block
curl -u "your_username:your_api_key" -X GET \
https://app.testobject.com:443/api/storage/app?appIdentifier=MD5_hash_of_your_app

If the call returns an empty JSON array, start uploading the file:

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