Create a default signed browser preview URL
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/ports/{port}/preview-url"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/ports/{port}/preview-url \
--header 'Authorization: Bearer <token>'{
"grant": {
"id": "<string>",
"machine_id": "<string>",
"port": 123,
"status": "active",
"auth_mode": "direct",
"bootstrap_transport": "query",
"token_kinds": [
"http_port"
],
"principal_kind": "user",
"issued_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"use_count": 123,
"http_request_count": 123,
"websocket_connection_count": 123,
"bytes_in_count": 123,
"bytes_out_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"principal_id": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"first_used_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"last_error_code": "<string>",
"last_error_at": "2023-11-07T05:31:56Z",
"disabled_at": "2023-11-07T05:31:56Z"
},
"url": "<string>",
"websocket_url": "<string>",
"access_token_expires_at": "2023-11-07T05:31:56Z",
"access_token_transport": "query"
}
Machines
Create a default signed browser preview URL
Creates a durable direct browser preview grant for the machine port using the deployment default bounded expiry. The returned URLs include short-lived query tokens; raw token values are not stored in inventory.
GET
/
v1
/
machines
/
{id}
/
ports
/
{port}
/
preview-url
Create a default signed browser preview URL
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/ports/{port}/preview-url"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/ports/{port}/preview-url \
--header 'Authorization: Bearer <token>'{
"grant": {
"id": "<string>",
"machine_id": "<string>",
"port": 123,
"status": "active",
"auth_mode": "direct",
"bootstrap_transport": "query",
"token_kinds": [
"http_port"
],
"principal_kind": "user",
"issued_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"use_count": 123,
"http_request_count": 123,
"websocket_connection_count": 123,
"bytes_in_count": 123,
"bytes_out_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"principal_id": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"first_used_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"last_error_code": "<string>",
"last_error_at": "2023-11-07T05:31:56Z",
"disabled_at": "2023-11-07T05:31:56Z"
},
"url": "<string>",
"websocket_url": "<string>",
"access_token_expires_at": "2023-11-07T05:31:56Z",
"access_token_transport": "query"
}
Authorizations
API key passed as Bearer token
Path Parameters
Machine ID (e.g. mch_a1b2c3d4)
Machine guest port to expose through browser preview. Reserved generic-preview ports are rejected:
22 is SSH-specific and 5900-5999 are desktop/VNC-specific.
Required range:
1 <= x <= 65535Response
Signed browser preview URL and durable grant metadata
Show child attributes
Show child attributes
Signed HTTP preview URL containing a short-lived query token.
Signed WebSocket preview URL containing a short-lived query token.
Available options:
query