본문으로 건너뛰기

활동 로그 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

쿼리 매개변수:

매개변수타입필수설명
platformstring아니오플랫폼별 필터링(예: "tiktok", "instagram")
serialstring아니오기기 일련번호별 필터링
action_typestring아니오작업 유형별 필터링(예: "post", "follow", "comment")
limitinteger아니오반환할 레코드 수(기본값: 100, 최대: 1000)
offsetinteger아니오페이지네이션을 위해 건너뛸 레코드 수

요청 예시:

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

쿼리 매개변수:

매개변수타입필수설명
platformstring아니오플랫폼별 필터링
serialstring아니오기기 일련번호별 필터링
action_typestring아니오작업 유형별 필터링

요청 예시:

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"
}
}