본문으로 건너뛰기
HTTP API워크스페이스

종목 탭 열기

요청 만들기

값을 바꾸면 명령이 함께 바뀝니다. 토큰은 여기에 입력하지 않습니다. 명령은 SPECTRE_LOCAL_API_TOKEN 환경 변수에서 토큰을 읽습니다. 자신의 터미널에서 실행하세요.

명령
curl -X POST 'http://127.0.0.1:48180/v1/workspace/tabs' \
  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "items": [
    {
      "instrument": "binance:futures:BTCUSDT",
      "chart": true
    },
    {
      "instrument": "bybit:futures:ETHUSDT",
      "connection_id": 31
    }
  ],
  "name": "Majors",
  "target": "new_tab",
  "window_id": 1,
  "activate": true
}'
POST
/workspace/tabs

items의 요소마다 열 하나씩, 목록 순서대로 배치한 탭을 엽니다. name이 없으면 탭 이름은 첫 종목의 심볼이 되고, 다른 종목이 있으면 그 개수가 붙습니다: BTCUSDT +1. 차트의 위치와 비율은 멀티뷰 설정을 따릅니다.

인증

bearerToken workspace:write
header인증Bearer <token>

Local API 토큰입니다: spt_와 16진수 문자 64개. Settings App → 일반 → Local API에서 복사합니다. Authorization 헤더로만 받습니다. 작업에 나열된 이름은 그 작업에 필요한 권한입니다. 터미널의 토큰에는 모든 권한이 있습니다.

권한: workspace:write

요청 본문

application/json
  1. body
items*array<>
항목1 <= items <= 50
name?string
길이length <= 64
target?WorkspaceTarget

new_tab은 window_id 창에 탭을 열고, 지정하지 않으면 포커스가 있는 창에 엽니다. new_window는 새 창을 엽니다.

기본값"new_tab"
값 범위"new_tab""new_window"
window_id?integer
형식int64
범위0 <= value
activate?boolean
기본값true

응답 본문

탭이 열린 위치입니다. stacks와 charts는 새 탭의 위젯이며 열 순서대로 나열됩니다.

application/json
  1. response

워크스페이스 명령이 열거나 영향을 준 대상입니다. 관련된 번호가 채워집니다. 나머지는 null이거나 비어 있습니다.

window_id*|
형식int64
tab_id*|
형식int64
stacks*array<>
charts*array<>
요청 예제
curl -X POST 'http://127.0.0.1:48180/v1/workspace/tabs' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \  -H 'Content-Type: application/json' \  -d '{  "items": [    {      "instrument": "binance:futures:BTCUSDT",      "chart": true    },    {      "instrument": "bybit:futures:ETHUSDT",      "connection_id": 31    }  ],  "name": "Majors",  "target": "new_tab",  "window_id": 1,  "activate": true}'
응답 예제
{  "window_id": 1,  "tab_id": 2,  "stacks": [    14,    16  ],  "charts": [    15  ]}