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:
| Parameter | Type | Required | Description |
|---|---|---|---|
| platform | string | No | Filter by platform (e.g., "tiktok", "instagram") |
| serial | string | No | Filter by device serial number |
| action_type | string | No | Filter by action type (e.g., "post", "follow", "comment") |
| limit | integer | No | Number of records to return (default: 100, max: 1000) |
| offset | integer | No | Number 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
| platform | string | No | Filter by platform |
| serial | string | No | Filter by device serial number |
| action_type | string | No | Filter 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"
}
}