Skip to main content

Activity Log API

The Activity Log API allows you to track and manage activity logs for your devices and accounts. This is useful for monitoring actions performed by your automation tasks.

Add Activity Log

Add a new activity log entry.

Endpoint: POST /api/v1/activity_log

Request Body:

{
"platform": "tiktok",
"serial": "device_serial_123",
"action_type": "post",
"action_detail": "Published video successfully",
"username": "user123",
"timestamp": 1707725000
}

Response:

{
"code": 0,
"message": "success",
"data": {
"id": 123
}
}

Get Activity Logs

Retrieve activity logs with optional filters.

Endpoint: GET /api/v1/activity_log

Query Parameters:

ParameterTypeRequiredDescription
platformstringNoFilter by platform (e.g., "tiktok", "instagram")
serialstringNoFilter by device serial number
action_typestringNoFilter by action type (e.g., "post", "follow", "comment")
limitintegerNoNumber of records to return (default: 100, max: 1000)
offsetintegerNoNumber of records to skip for pagination

Example Request:

curl "http://localhost:50809/api/v1/activity_log?platform=tiktok&limit=50&offset=0"

Response:

{
"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 Activity Log Count

Get the total count of activity logs matching filters.

Endpoint: GET /api/v1/activity_log/count

Query Parameters:

ParameterTypeRequiredDescription
platformstringNoFilter by platform
serialstringNoFilter by device serial number
action_typestringNoFilter by action type

Example Request:

curl "http://localhost:50809/api/v1/activity_log/count?platform=tiktok"

Response:

{
"code": 0,
"message": "success",
"data": {
"count": 456
}
}

Delete Activity Log

Delete a specific activity log entry by ID.

Endpoint: DELETE /api/v1/activity_log/{id}

Example Request:

curl -X DELETE "http://localhost:50809/api/v1/activity_log/123"

Response:

{
"code": 0,
"message": "success",
"data": {
"deleted": true,
"id": 123
}
}

Delete All Activity Logs

Delete all activity log entries.

Endpoint: DELETE /api/v1/activity_log/all

Example Request:

curl -X DELETE "http://localhost:50809/api/v1/activity_log/all"

Response:

{
"code": 0,
"message": "success",
"data": {
"deleted": true,
"message": "All activity logs deleted"
}
}