Skip to content

Commit 742054a

Browse files
bahrimootazAgaOSaucesi-net
authored
Apply suggestions from code review
Co-authored-by: AgaOSauce <[email protected]> Co-authored-by: Simon Schaefer <[email protected]>
1 parent 6eb14da commit 742054a

File tree

1 file changed

+12
-30
lines changed

1 file changed

+12
-30
lines changed

docs/dev/api/rdc-access-api/integration-guide.md

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ title: RDC Access API Integration Guide
44
sidebar_label: Integration Guide
55
---
66

7-
# Sauce Labs Real Device Access API
87

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.
119

1210
## 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:
1412
1. **Choose your data center** (US West, EU Central, or US East) and export `BASE_URL`.
1513
2. **Grab your credentials** from Sauce Labs User Settings and export `SAUCE_USERNAME`/`SAUCE_ACCESS_KEY`.
1614
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
5654

5755
#### List All Devices
5856
```shell
59-
curl -X GET \
60-
-u $AUTH \
61-
"$BASE_URL/devices/status"
57+
curl $BASE_URL/devices/status \
58+
-u $AUTH
6259
```
6360

6461
#### Device Filtering Options
@@ -71,10 +68,10 @@ The `/devices/status` endpoint supports the following query parameters:
7168
#### Examples:
7269
```shell
7370
# Get all devices
74-
curl -X GET -u $AUTH "$BASE_URL/devices/status"
71+
curl -u $AUTH "$BASE_URL/devices/status"
7572

7673
# Filter by device state
77-
curl -X GET -u $AUTH "$BASE_URL/devices/status?state=AVAILABLE"
74+
curl -u $AUTH "$BASE_URL/devices/status?state=AVAILABLE"
7875

7976
# Show only private devices
8077
curl -X GET -u $AUTH \
@@ -84,9 +81,6 @@ curl -X GET -u $AUTH \
8481
curl -X GET -u $AUTH \
8582
"$BASE_URL/devices/status?deviceName=iPhone.*"
8683

87-
# Combine multiple filters
88-
curl -X GET -u $AUTH \
89-
"$BASE_URL/devices/status?state=AVAILABLE&privateOnly=true&deviceName=iPhone.*"
9084
```
9185

9286
#### Example Response
@@ -115,15 +109,15 @@ curl -X GET -u $AUTH \
115109

116110
### Create a Device Session
117111
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)
119113
120114
#### Example
121115
```shell
122-
curl -X POST -u $AUTH \
116+
curl -u $AUTH \
123117
-H "Content-Type: application/json" \
124118
-d '{
125119
"device": {
126-
"deviceName": "iPhone_16_real",
120+
"deviceName": ".*",
127121
"os": "ios"
128122
}
129123
}' \
@@ -136,9 +130,6 @@ curl -X POST -u $AUTH \
136130
{
137131
"id": "{session_id}",
138132
"state": "PENDING",
139-
"links": null,
140-
"device": null,
141-
"error": null
142133
}
143134
```
144135

@@ -166,10 +157,10 @@ Combine both filters to surface, for example, all `ACTIVE` sessions on a private
166157
##### Examples
167158
```shell
168159
# Get all sessions
169-
curl -X GET -u $AUTH "$BASE_URL/sessions"
160+
curl -u $AUTH "$BASE_URL/sessions"
170161

171162
# Filter by session state
172-
curl -X GET -u $AUTH "$BASE_URL/sessions?state=ACTIVE"
163+
curl -u $AUTH "$BASE_URL/sessions?state=ACTIVE"
173164

174165
# Filter by device ID
175166
curl -X GET -u $AUTH "$BASE_URL/sessions?deviceName=iPhone_16_real"
@@ -200,7 +191,6 @@ curl -X GET -u $AUTH \
200191
"eventsWebsocketUrl": "wss://api.saucelabs.com/rdc/v2/sessions/123e4567-e89b-12d3-a456-426614174000/wss/events",
201192
"self": "https://api.saucelabs.com/rdc/v2/sessions/123e4567-e89b-12d3-a456-426614174000"
202193
},
203-
"error": null
204194
}
205195
]
206196
}
@@ -240,9 +230,8 @@ Terminate a device session and release the device. When you close a session, its
240230

241231
##### Session Closure Options
242232
- **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
244234

245-
***Note:*** The `rebootDevice` parameter has no effect on public/shared devices.
246235

247236
##### Examples
248237
```shell
@@ -290,13 +279,6 @@ Connect to a WebSocket to receive real-time logs and events from an active sessi
290279
#### Live Streaming with Websocat (Recommended)
291280
`websocat` is a versatile command-line WebSocket client.
292281

293-
##### Installation:
294-
```shell
295-
# macOS (Homebrew)
296-
brew install websocat
297-
298-
# For other systems, see: https://github.com/vi/websocat/releases
299-
```
300282

301283
##### Usage:
302284

0 commit comments

Comments
 (0)