Skip to Content
문서빠른 시작 가이드

빠른 시작 가이드

5분 안에 Safient API를 사용해 단축 링크를 만들어 보겠습니다.


1단계: 계정 및 API 키 준비

  1. safient.net 에서 회원가입 및 이메일 인증 완료
  2. 설정(Settings) → 보안(Security) → API 키 에서 새 API 키 생성
  3. 생성된 키를 안전하게 저장

API 키는 생성 시에만 전체 값이 표시됩니다.


2단계: 첫 번째 API 요청

플랫폼 상태 확인 (인증 불필요):

curl https://safient.net/api/public/status/ping

응답:

{ "ok": true, "timestamp": "2026-04-24T12:00:00.000Z" }

3단계: 단축 링크 만들기

curl -X POST https://safient.net/api/public/links \ -H "X-API-Key: sft_live_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com/my-long-url", "title": "첫 번째 링크"}'

응답:

{ "id": "link_xxxxxxxxxxxx", "code": "x7k3m9", "shortUrl": "https://biy.kr/x7k3m9", "url": "https://example.com/my-long-url", "title": "첫 번째 링크", "active": true, "createdAt": "2026-04-24T12:00:00.000Z" }

4단계: 클릭 통계 확인

curl https://safient.net/api/public/links/x7k3m9/stats

다음 단계


JavaScript 예시

const SAFIENT_API_KEY = process.env.SAFIENT_API_KEY; async function createLink(url, title) { const response = await fetch('https://safient.net/api/public/links', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': SAFIENT_API_KEY, }, body: JSON.stringify({ url, title }), }); if (!response.ok) { throw new Error(`API 오류: ${response.status}`); } return response.json(); } // 사용 예 const link = await createLink('https://example.com', '내 링크'); console.log(link.shortUrl); // https://biy.kr/xxxxxx