대상: 외부 개발자 / SDK 통합 / Excel Import 자동화
// 브라우저 console 또는 SDK
import { getAuth } from 'firebase/auth';
const token = await getAuth().currentUser.getIdToken();
console.log(token); // 복사해서 환경변수로
curl https://secms.tech/api/projects \
-H "Authorization: Bearer $TOKEN"
# 응답
[
{
"id": "a1b2c3...",
"name": "V0001",
"vesselNo": "V0001",
"cables": [...],
"nodes": [...],
"tier": "trial"
}
]
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 }
]
}'
// 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'],
});
sandbox.secms.tech 격리 환경에서 시드 데이터로 자유롭게 테스트하세요.문의: [email protected] · 평균 응답 24시간 이내