활동 로그 API
활동 로그 API를 사용하면 기기 및 계정의 활동 로그를 추적하고 관리할 수 있습니다. 이는 자동화 작업에서 수행한 작업을 모니터링하는 데 유용합니다.
활동 로그 추가
새 활동 로그 항목을 추가합니다.
엔드포인트: POST /api/v1/activity_log
요청 본문:
{
"platform": "tiktok",
"serial": "device_serial_123",
"action_type": "post",
"action_detail": "Published video successfully",
"username": "user123",
"timestamp": 1707725000
}
응답:
{
"code": 0,
"message": "success",
"data": {
"id": 123
}
}
활동 로그 가져오기
선택적 필터를 사용하여 활동 로그를 가져옵니다.
엔드포인트: GET /api/v1/activity_log
쿼리 매개변수:
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
| platform | string | 아니오 | 플랫폼별 필터링(예: "tiktok", "instagram") |
| serial | string | 아니오 | 기기 일련번호별 필터링 |
| action_type | string | 아니오 | 작업 유형별 필터링(예: "post", "follow", "comment") |
| limit | integer | 아니오 | 반환할 레코드 수(기본값: 100, 최대: 1000) |
| offset | integer | 아니오 | 페이지네이션을 위해 건너뛸 레코드 수 |
요청 예시:
curl "http://localhost:50809/api/v1/activity_log?platform=tiktok&limit=50&offset=0"
응답:
{
"code": 0,
"message": "success",
"data": [
{
"id": 123,
"platform": "tiktok",
"serial": "device_serial_123",
"action_type": "post",
"action_detail": "Published video successfully",
"username": "user123",
"timestamp": 1707725000
}
]
}
활동 로그 수 가져오기
필터와 일치하는 활동 로그의 총 수를 가져옵니다.
엔드포인트: GET /api/v1/activity_log/count
쿼리 매개변수:
| 매개변수 | 타입 | 필수 | 설명 |
|---|---|---|---|
| platform | string | 아니오 | 플랫폼별 필터링 |
| serial | string | 아니오 | 기기 일련번호별 필터링 |
| action_type | string | 아니오 | 작업 유형별 필터링 |
요청 예시:
curl "http://localhost:50809/api/v1/activity_log/count?platform=tiktok"
응답:
{
"code": 0,
"message": "success",
"data": {
"count": 456
}
}
활동 로그 삭제
ID로 특정 활동 로그 항목을 삭제합니다.
엔드포인트: DELETE /api/v1/activity_log/{id}
요청 예시:
curl -X DELETE "http://localhost:50809/api/v1/activity_log/123"
응답:
{
"code": 0,
"message": "success",
"data": {
"deleted": true,
"id": 123
}
}
모든 활동 로그 삭제
모든 활동 로그 항목을 삭제합니다.
엔드포인트: DELETE /api/v1/activity_log/all
요청 예시:
curl -X DELETE "http://localhost:50809/api/v1/activity_log/all"
응답:
{
"code": 0,
"message": "success",
"data": {
"deleted": true,
"message": "All activity logs deleted"
}
}