connectDisplayAgent
GET
/api/v1/display/sessions/{display_session_id}/agent
const url = 'https://dev.api.endueos.com/api/v1/display/sessions/dsp_01J9ZK3Q8M4XW7D2N5R6T0V1BC/agent';const options = { method: 'GET', headers: {'Sec-WebSocket-Protocol': 'example', upgrade: 'websocket'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://dev.api.endueos.com/api/v1/display/sessions/dsp_01J9ZK3Q8M4XW7D2N5R6T0V1BC/agent \ --header 'Sec-WebSocket-Protocol: example' \ --header 'upgrade: websocket'에이전트 쪽 화면 소켓 — 에이전트 전용 (protocol/platform-tools.md §화면 세션). 사람·앱이 부르는 경로가 아니다.
연결 토큰(osdc_, 1회용)을 Sec-WebSocket-Protocol: endue-os.display.v1, endue-os.token.{토큰} 으로 보낸다. 101 은 endue-os.display.v1 을 고른다.
토큰이 틀리면 401, 이미 에이전트가 붙은 세션이면 409.
- None
파라미터
섹션 제목: “파라미터”경로 파라미터
섹션 제목: “경로 파라미터”display_session_id
필수
화면 세션 — dsp_ + ULID. DB 에 남지 않는다 (relay-service 의 Durable Object 이름, 만든 뒤 60분).
string
예시
dsp_01J9ZK3Q8M4XW7D2N5R6T0V1BC헤더 파라미터
섹션 제목: “헤더 파라미터”Sec-WebSocket-Protocol
필수
string
endue-os.display.v1, endue-os.token.{연결 토큰}
upgrade
필수
string
101
섹션 제목: “101”WebSocket 으로 바뀐다.
응답 헤더
섹션 제목: “응답 헤더”Sec-WebSocket-Protocol
필수
string
401
섹션 제목: “401”인증이 없거나 무효다 — UNAUTHORIZED. 본문은 오류 봉투.
409
섹션 제목: “409”지금 상태와 충돌한다 — 코드는 위 설명을 본다. 본문은 오류 봉투.
426
섹션 제목: “426”Upgrade: websocket 이 없다. 본문은 오류 봉투.
429
섹션 제목: “429”한도를 넘었다 — Retry-After 초 뒤에 다시. 본문은 오류 봉투.
503
섹션 제목: “503”의존 서비스에 닿지 못했다 — 잠시 뒤 다시. 본문은 오류 봉투.