You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dev/api/rdc-access-api/integration-guide.md
+12-30Lines changed: 12 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,11 @@ title: RDC Access API Integration Guide
4
4
sidebar_label: Integration Guide
5
5
---
6
6
7
-
# Sauce Labs Real Device Access API
8
7
9
-
Sauce Labs Real Device Access API v2 lets you programmatically interact with real mobile devices in the Sauce Labs cloud for functional testing, debugging, and observability.
10
-
This guide walks you through the essentials—checking device status, creating sessions, managing them, and streaming live logs—so you can get productive quickly.
8
+
The Sauce Labs Real Device Access API v2 allows you to programmatically interact with real mobile devices in the Sauce Labs cloud. Use it for functional testing, debugging, and observability. This guide introduces the core concepts: checking device availability, creating and managing sessions, and streaming live logs. By following these steps, you can start testing in just a few minutes.
11
9
12
10
## Five-Minute Onboarding Checklist
13
-
11
+
Use this checklist to quickly set up your environment and run your first test using the Real Device Access API. These steps cover the minimum required configuration to begin interacting with real devices through the API:
14
12
1.**Choose your data center** (US West, EU Central, or US East) and export `BASE_URL`.
15
13
2.**Grab your credentials** from Sauce Labs User Settings and export `SAUCE_USERNAME`/`SAUCE_ACCESS_KEY`.
16
14
3.**Verify access** by listing devices with `curl -u $AUTH "$BASE_URL/devices/status"`.
@@ -56,9 +54,8 @@ You can retrieve a list of all available real devices and filter them based on v
56
54
57
55
#### List All Devices
58
56
```shell
59
-
curl -X GET \
60
-
-u $AUTH \
61
-
"$BASE_URL/devices/status"
57
+
curl $BASE_URL/devices/status \
58
+
-u $AUTH
62
59
```
63
60
64
61
#### Device Filtering Options
@@ -71,10 +68,10 @@ The `/devices/status` endpoint supports the following query parameters:
71
68
#### Examples:
72
69
```shell
73
70
# Get all devices
74
-
curl -X GET -u $AUTH"$BASE_URL/devices/status"
71
+
curl -u $AUTH"$BASE_URL/devices/status"
75
72
76
73
# Filter by device state
77
-
curl -X GET -u $AUTH"$BASE_URL/devices/status?state=AVAILABLE"
Start a new session with a `POST` request to `/sessions`.
118
-
> ***Note:*** The `deviceName` and `os` parameters are optional. If omitted, Sauce Labs selects an available device automatically. You can also include the optional `configuration` object from the API spec to set `sessionDuration` (ISO-8601) or attach a Sauce Connect `tunnel`.
112
+
> ***Note:*** The `deviceName` and `os` parameters are optional. If omitted, Sauce Labs selects an available device automatically. For full configuration go to ... (link to api contract)
119
113
120
114
#### Example
121
115
```shell
122
-
curl -X POST -u $AUTH \
116
+
curl -u $AUTH \
123
117
-H "Content-Type: application/json" \
124
118
-d '{
125
119
"device": {
126
-
"deviceName": "iPhone_16_real",
120
+
"deviceName": ".*",
127
121
"os": "ios"
128
122
}
129
123
}' \
@@ -136,9 +130,6 @@ curl -X POST -u $AUTH \
136
130
{
137
131
"id": "{session_id}",
138
132
"state": "PENDING",
139
-
"links": null,
140
-
"device": null,
141
-
"error": null
142
133
}
143
134
```
144
135
@@ -166,10 +157,10 @@ Combine both filters to surface, for example, all `ACTIVE` sessions on a private
166
157
##### Examples
167
158
```shell
168
159
# Get all sessions
169
-
curl -X GET -u $AUTH"$BASE_URL/sessions"
160
+
curl -u $AUTH"$BASE_URL/sessions"
170
161
171
162
# Filter by session state
172
-
curl -X GET -u $AUTH"$BASE_URL/sessions?state=ACTIVE"
163
+
curl -u $AUTH"$BASE_URL/sessions?state=ACTIVE"
173
164
174
165
# Filter by device ID
175
166
curl -X GET -u $AUTH"$BASE_URL/sessions?deviceName=iPhone_16_real"
@@ -240,9 +230,8 @@ Terminate a device session and release the device. When you close a session, its
240
230
241
231
##### Session Closure Options
242
232
-**Basic closure** (default): terminate the session, clean the device, return it to the device pool marked as AVAILABLE.
243
-
-**Reboot option** (private devices only): perform the standard cleanup and then reboot to guarantee a pristine state.
233
+
-**Reboot option** (private devices only): perform the standard cleanup and then reboot the device. After rebooting the device it will not be rebooted for another 10 sessions
244
234
245
-
***Note:*** The `rebootDevice` parameter has no effect on public/shared devices.
246
235
247
236
##### Examples
248
237
```shell
@@ -290,13 +279,6 @@ Connect to a WebSocket to receive real-time logs and events from an active sessi
290
279
#### Live Streaming with Websocat (Recommended)
291
280
`websocat` is a versatile command-line WebSocket client.
292
281
293
-
##### Installation:
294
-
```shell
295
-
# macOS (Homebrew)
296
-
brew install websocat
297
-
298
-
# For other systems, see: https://github.com/vi/websocat/releases
0 commit comments