---
title: Get Screen Stream Ticket
slug: devicepark/sdk-documentation/sessions/stream-ticket
description: Get a one-time WebSocket URL for watching the device screen of an active Java, Node.js or .NET SDK session.
createdAt: 2026-11-06T00:00:00.000Z
---

Use this SDK method to watch the device screen of an active session. The method returns a `wss` URL that carries a single-use ticket instead of an access token.

The SDK does not open the socket or render the screen. Pass the returned URL to a WebSocket client that can display the device stream.

Prefer this method over [Get Screen Stream URL](https://docs.testinium.com/devicepark/sdk-documentation/sessions/stream-url) in new .NET integrations. A ticket is scoped to one connection, so a leaked URL cannot be replayed the way a URL holding a live access token can.

## Before You Begin

- Start a session and keep its `sessionId`.
- Use a session that belongs to the authenticated client and is active.
- Treat the returned URL as a secret and request a new one for every connection.

## SDK Method

| Java                                           | Node.js                                              | .NET                                                    |
| ---------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------- |
| `client.sessions().streamTicketUrl(sessionId)` | `await client.sessions().streamTicketUrl(sessionId)` | `await client.Sessions.StreamTicketUrlAsync(sessionId)` |

Java `streamTicketUrl` returns a `String`. Node.js `streamTicketUrl` returns `Promise<string>`. .NET `StreamTicketUrlAsync` returns `Task<string>` and accepts an optional trailing `CancellationToken`.

## Parameter

| Parameter   | Required | Description                          |
| ----------- | -------- | ------------------------------------ |
| `sessionId` | Yes      | Identifier returned by Start Session |

A blank `sessionId` throws `IllegalArgumentException` in Java, `DeviceParkConfigError` in Node.js and `DeviceParkConfigException` in .NET before the request is sent.

## Request Mapping

The SDKs call:

```text
POST /session/api/v2/public/sessions/{sessionId}/stream-ticket
```

There is no request body. OAuth authorization is managed by the SDK client.

Device Park returns the stream address with the ticket already in place:

```json
{
  "url": "wss://stream.example/ws/v2/devicepark/sessions/session-123/stream?ticket=<one-time-ticket>"
}
```

The SDK returns that URL unchanged. It does not append an access token. When the response carries no `url`, the SDK throws `IllegalStateException` in Java, an `Error` in Node.js and `DeviceParkException` in .NET.

## Ticket Lifetime

Every call mints a new ticket. Do not reuse a returned URL, including after a failed connection attempt — call the method again instead. Do not log the URL and do not persist it.

## Example

```java
String streamUrl = client.sessions().streamTicketUrl("session-123");
```

```typescript
const streamUrl = await client.sessions().streamTicketUrl("session-123");
```

```csharp
var streamUrl = await client.Sessions.StreamTicketUrlAsync("session-123");
```

Open `streamUrl` with a WebSocket client. To reconnect, call the method again for a fresh ticket.

## What Happens Next?

- Continue the Appium test while the screen is visible.
- [Stop the session](https://docs.testinium.com/devicepark/sdk-documentation/sessions/stop-session) when the interaction is finished.

This URL is the live device screen. It is separate from `Session.videoRecordUrl`, which is the HLS playlist for a completed recording.
