이 문서는 Kookmin Feed Database API Server의 엔드포인트와 사용법을 설명합니다.
모든 API 요청은 Authorization 헤더를 통해 인증해야 합니다. 헤더 값은 Bearer <your_api_key> 형식이어야 합니다. 올바른 API 키가 제공되지 않으면 403 Forbidden 응답이 반환됩니다.
- Direct Message 목록 조회
- 예제:
curl -X GET "http://localhost:8000/discord/direct-messages" \ -H "Authorization: Bearer <your_api_key>"
- Direct Message 생성
- 요청 데이터:
{ "user_id": "12345", "user_name": "JohnDoe", "scrapers": ["scraper1", "scraper2"] } - 예제:
curl -X POST "http://localhost:8000/discord/direct-messages" \ -H "Authorization: Bearer <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"user_id": "12345", "user_name": "JohnDoe", "scrapers": ["scraper1", "scraper2"]}'
- 특정 Direct Message 조회
- 요청 파라미터:
user_id - 예제:
curl -X GET "http://localhost:8000/discord/direct-message?user_id=12345" \ -H "Authorization: Bearer <your_api_key>"
- Direct Message 수정
- 요청 데이터:
{ "user_id": "12345", "scrapers": ["scraper3"] } - 예제:
curl -X PUT "http://localhost:8000/discord/direct-messages" \ -H "Authorization: Bearer <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"user_id": "12345", "scrapers": ["scraper3"]}'
- Direct Message 삭제
- 요청 파라미터:
user_id - 예제:
curl -X DELETE "http://localhost:8000/discord/direct-messages?user_id=12345" \ -H "Authorization: Bearer <your_api_key>"
- Server Channel 목록 조회
- 예제:
curl -X GET "http://localhost:8000/discord/server-channels" \ -H "Authorization: Bearer <your_api_key>"
- Server Channel 생성
- 요청 데이터:
{ "guild_name": "TestServer", "channel_id": "channel123", "channel_name": "General", "scrapers": ["scraper1"] } - 예제:
curl -X POST "http://localhost:8000/discord/server-channels" \ -H "Authorization: Bearer <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"guild_name": "TestServer", "channel_id": "channel123", "channel_name": "General", "scrapers": ["scraper1"]}'
- 특정 Server Channel 조회
- 요청 파라미터:
channel_id - 예제:
curl -X GET "http://localhost:8000/discord/server-channel?channel_id=channel123" \ -H "Authorization: Bearer <your_api_key>"
- Server Channel 수정
- 요청 데이터:
{ "channel_id": "channel123", "scrapers": ["scraper2"] } - 예제:
curl -X PUT "http://localhost:8000/discord/server-channels" \ -H "Authorization: Bearer <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"channel_id": "channel123", "scrapers": ["scraper2"]}'
- Server Channel 삭제
- 요청 파라미터:
channel_id - 예제:
curl -X DELETE "http://localhost:8000/discord/server-channels?channel_id=channel123" \ -H "Authorization: Bearer <your_api_key>"
- 공지사항 목록 조회
- 요청 파라미터:
notice_type: 공지사항 유형list_size: 조회할 공지사항 개수
- 예제:
curl -X GET "http://localhost:8000/notices/all?notice_type=general&list_size=5" \ -H "Authorization: Bearer <your_api_key>"
- 새로운 공지사항 조회
- 요청 파라미터:
notice_type: 공지사항 유형last_notice_link: 마지막으로 확인한 공지사항 링크
- 예제:
curl -X GET "http://localhost:8000/notices/new?notice_type=general&last_notice_link=https://example.com/notice123" \ -H "Authorization: Bearer <your_api_key>"
- 스크래퍼 유형 목록 조회
- 예제:
curl -X GET "http://localhost:8000/scraper/types" \ -H "Authorization: Bearer <your_api_key>"
- 스크래퍼 카테고리 목록 조회
- 예제:
curl -X GET "http://localhost:8000/scraper/categories" \ -H "Authorization: Bearer <your_api_key>"