# Taisly API 문서 - **OpenAPI Version:** `3.1.0` - **API Version:** `1.0.0` # Taisly API 문서 Taisly API를 사용하면 간단한 API 키 인증을 통해 여러 소셜 미디어 플랫폼에 동영상 게시 및 리포스트를 자동화할 수 있습니다. ## 기능 - 여러 플랫폼에 동시에 동영상 업로드 및 게시 - 한 플랫폼에서 다른 플랫폼으로 자동 리포스트 설정 - 나중에 게시할 게시물 예약 - 연결된 소셜 미디어 계정 관리 - 게시 기록 및 상태 추적 ## 요구사항 - **플랜**: STARTER, INFLUENCER 또는 PRO (FREE 플랜에서는 API 키 사용 불가) - **API 키**: 에서 대시보드에서 생성 - **HTTPS**: 모든 API 요청은 HTTPS를 사용해야 합니다 ## 요청 제한 | 플랜 | 시간당 요청 수 | | ---------- | -------- | | STARTER | 50 | | INFLUENCER | 200 | | PRO | 1000 | 요청 제한을 초과하면 몇 초 기다려야 하는지 나타내는 `retryAfter` 필드가 포함된 429 오류를 받게 됩니다. ## 보안 모범 사례 1. API 키를 버전 관리에 커밋하지 마세요 2. 키를 환경 변수에 저장하세요 3. 유출되면 즉시 재생성하세요 4. HTTPS만 사용하세요 ## 동영상 요구사항 - **형식**: MP4, MOV 또는 기타 일반 동영상 형식 - **크기**: 최대 500MB - **길이**: 3-90초 - **방향**: 9:16 ## 빠른 시작 예시 ```bash # 1. 연결된 플랫폼 가져오기 curl -X GET https://app.taisly.com/api/private/platform/platforms \ -H "Authorization: Bearer taisly_your_api_key_here" # 2. 동영상 업로드 curl -X POST https://app.taisly.com/api/private/post \ -H "Authorization: Bearer taisly_your_api_key_here" \ -F "video=@/path/to/video.mp4" \ -F "platforms=[\"platform_id_1\"]" \ -F "description=Check out my new video!" # 3. 게시 기록 확인 curl -X GET https://app.taisly.com/api/private/post/history \ -H "Authorization: Bearer taisly_your_api_key_here" ``` ## Python 예시 ```python import requests API_KEY = 'taisly_your_api_key_here' BASE_URL = 'https://app.taisly.com/api/private' headers = { 'Authorization': f'Bearer {API_KEY}' } # 플랫폼 가져오기 response = requests.get(f'{BASE_URL}/platform/platforms', headers=headers) platforms = response.json()['data'] print(f"연결된 플랫폼: {len(platforms)}") # 동영상 업로드 files = {'video': open('video.mp4', 'rb')} data = { 'platforms': str([platforms[0]['_id']]), 'description': 'My video description' } response = requests.post(f'{BASE_URL}/post', headers=headers, files=files, data=data) print(response.json()) ``` ## Servers - **URL:** `https://app.taisly.com/api/private` - **Description:** 프로덕션 서버 ## Operations ### API 키 정보 조회 - **Method:** `GET` - **Path:** `/user/api-key` - **Tags:** API Key Management 현재 API 키에 대한 정보를 조회합니다. #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 403 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### API 키 생성 - **Method:** `POST` - **Path:** `/user/api-key/generate` - **Tags:** API Key Management 새 API 키를 생성하거나 이미 존재하면 재생성합니다. **중요**: - 전체 API 키는 한 번만 표시됩니다. 안전하게 저장하세요. - 재생성하면 이전 키가 즉시 무효화됩니다. #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### API 키 취소 - **Method:** `POST` - **Path:** `/user/api-key/revoke` - **Tags:** API Key Management 현재 API 키를 즉시 취소합니다. 이 키를 사용하는 모든 요청이 실패합니다. #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 403 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 연결된 플랫폼 조회 - **Method:** `GET` - **Path:** `/platform/platforms` - **Tags:** Platforms 계정에 연결된 모든 소셜 미디어 계정을 조회합니다. #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 403 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 게시물 생성 - **Method:** `POST` - **Path:** `/post` - **Tags:** Posts 동영상을 하나 이상의 연결된 플랫폼에 업로드합니다. **동영상 요구사항:** - 형식: MP4, MOV 또는 기타 일반 동영상 형식 - 크기: 최대 500MB - 길이: 3-90초 - 방향: 세로 (9:16) **예약:** - 예약 게시物的 경우ミリ초 단위의 Unix 타임스탬프를 `scheduled`로 전달하세요 (예약하지 않으려면 이 매개변수를 생략하세요) #### Request Body ##### Content-Type: multipart/form-data - **`platforms` (required)** `array` — ID 목록 **Items:** `string` - **`video` (required)** `string`, format: `binary` — - **`description`** `string` - **`previewTime`** `number` — 썸네일 생성을 위한 초 단위 타임스탬프 (기본값: 0) - **`scheduled`** `string` **Example:** ```json { "video": {}, "platforms": [ "" ], "description": "", "previewTime": 1, "scheduled": "" } ``` #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 403 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### HISTORY /post - **Method:** `HISTORY` - **Path:** `/post` ### 게시 기록 조회 - **Method:** `GET` - **Path:** `/post/history` - **Tags:** Posts 각 플랫폼의 상태 정보와 함께 게시 기록을 조회합니다. **페이지네이션**: - 페이지네이션에는 `page` 매개변수를 사용하세요 (페이지당 10개 항목) - 또는 날짜 범위 필터링에는 `startTime`과 `endTime`을 사용하세요 (일치하는 모든 게시물 반환) **상태 값**: - PENDING: 게시물이 대기 중 - SUCCESS: 성공적으로 게시됨 - FAILED: 게시 실패 (오류 코드는 message 필드 확인) #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 예약 게시 취소 - **Method:** `GET` - **Path:** `/post/cancelSchedule` - **Tags:** Posts 나중에 예약된 게시물을 취소합니다. 게시물이 영구적으로 삭제됩니다. #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 리포스트 설정 조회 - **Method:** `GET` - **Path:** `/reposts` - **Tags:** Reposts 구성된 모든 자동 리포스트 규칙을 조회합니다. 'from' 플랫폼에 게시하면 콘텐츠가 자동으로 모든 'to' 플랫폼에 리포스트됩니다. #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 리포스트 설정 추가 - **Method:** `POST` - **Path:** `/repost/add` - **Tags:** Reposts 한 플랫폼에서 다른 플랫폼으로 자동 리포스트를 구성합니다. **작동 방식**: - 'from' 플랫폼에 콘텐츠를 게시하면 모든 'to' 플랫폼에 자동으로 리포스트됩니다 **참고**: 순환 종속성이 방지됩니다. B→A가 이미 존재하면 A→B를 생성할 수 없습니다. #### Request Body ##### Content-Type: application/json - **`from` (required)** `string` — 플랫폼 ID - **`to` (required)** `array` — 플랫폼 ID 목록 **Items:** `string` **Example:** ```json { "from": "", "to": [ "" ] } ``` #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 400 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 리포스트 설정 삭제 - **Method:** `POST` - **Path:** `/repost/delete` - **Tags:** Reposts 자동 리포스트 규칙을 제거합니다. 소스 플랫폼에 대한 향후 게시물은 더 이상 자동으로 리포스트되지 않습니다. #### Request Body ##### Content-Type: application/json - **`id` (required)** `string` **Example:** ```json { "id": "" } ``` #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 리포스트 일시정지/재개 - **Method:** `POST` - **Path:** `/repost/pause` - **Tags:** Reposts 자동 리포스트를 일시적으로 일시정지하거나 재개합니다. 설정을 삭제하지 않고 일시적으로 리포스트를 중단하고 싶을 때 유용합니다. #### Request Body ##### Content-Type: application/json - **`id` (required)** `string` - **`isPaused` (required)** `boolean` **Example:** ```json { "id": "", "isPaused": true } ``` #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json