SEcMS Quickstart — 5분 안에 First API Call

대상: 외부 개발자 / SDK 통합 / Excel Import 자동화

Step 1 — Firebase 인증 토큰 획득 (1분)

1관리자에 초대코드 요청 또는 secms.tech 에서 Google OAuth 로그인
// 브라우저 console 또는 SDK
import { getAuth } from 'firebase/auth';
const token = await getAuth().currentUser.getIdToken();
console.log(token); // 복사해서 환경변수로

Step 2 — 첫 API 호출 (1분)

2프로젝트 목록 조회 (사용자 호선 모두)
curl https://secms.tech/api/projects \
  -H "Authorization: Bearer $TOKEN"

# 응답
[
  {
    "id": "a1b2c3...",
    "name": "V0001",
    "vesselNo": "V0001",
    "cables": [...],
    "nodes": [...],
    "tier": "trial"
  }
]

Step 3 — 신규 호선 등록 (1분)

curl -X POST https://secms.tech/api/projects \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "MyVessel",
    "vesselNo": "MV-001",
    "cables": [
      {
        "id": "c-1",
        "name": "P-MAIN-01",
        "type": "TFR-CV-3.5SQ-3C",
        "od": 22.5,
        "fromNode": "SWBD-01",
        "toNode": "MCC-101"
      }
    ],
    "nodes": [
      { "name": "SWBD-01", "x": 10, "y": 0, "z": 5 },
      { "name": "MCC-101", "x": 50, "y": 0, "z": 5 }
    ]
  }'

Step 4 — TypeScript SDK (2분, 선택)

// 1. 설치
npm i @secms/sdk  // (베타 곧 출시)

// 2. 사용
import { SEcMS } from '@secms/sdk';
const client = new SEcMS({ token: process.env.SECMS_TOKEN });

const projects = await client.projects.list();
const project = await client.projects.create({
  name: 'HK2502',
  vesselNo: 'H2502',
});

// Webhooks 구독
await client.webhooks.create({
  url: 'https://your.app/webhook',
  events: ['cable.created', 'route.calculated'],
});
Tip: sandbox.secms.tech 격리 환경에서 시드 데이터로 자유롭게 테스트하세요.

다음 단계

문의: [email protected] · 평균 응답 24시간 이내