アクティビティログ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"
}
}