Zum Hauptinhalt springen

Aktivitätsprotokoll-API

Die Activity Log API ermöglicht es Ihnen, Aktivitätsprotokolle für Ihre Geräte und Konten zu verfolgen und zu verwalten. Dies ist nützlich zur Überwachung von Aktionen, die von Ihren Automatisierungsaufgaben ausgeführt werden.

Aktivitätsprotokoll hinzufügen

Fügen Sie einen neuen Aktivitätsprotokolleintrag hinzu.

Endpunkt: POST /api/v1/activity_log

Anfragekörper:

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

Antwort:

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

Aktivitätsprotokolle abrufen

Rufen Sie Aktivitätsprotokolle mit optionalen Filtern ab.

Endpunkt: GET /api/v1/activity_log

Abfrageparameter:

ParameterTypErforderlichBeschreibung
platformstringNeinNach Plattform filtern (z.B. "tiktok", "instagram")
serialstringNeinNach Geräteseriennummer filtern
action_typestringNeinNach Aktionstyp filtern (z.B. "post", "follow", "comment")
limitintegerNeinAnzahl der zurückzugebenden Datensätze (Standard: 100, Max: 1000)
offsetintegerNeinAnzahl der zu überspringenden Datensätze für Paginierung

Beispielanfrage:

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

Antwort:

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

Anzahl der Aktivitätsprotokolle abrufen

Rufen Sie die Gesamtanzahl der Aktivitätsprotokolle ab, die den Filtern entsprechen.

Endpunkt: GET /api/v1/activity_log/count

Abfrageparameter:

ParameterTypErforderlichBeschreibung
platformstringNeinNach Plattform filtern
serialstringNeinNach Geräteseriennummer filtern
action_typestringNeinNach Aktionstyp filtern

Beispielanfrage:

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

Antwort:

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

Aktivitätsprotokoll löschen

Löschen Sie einen bestimmten Aktivitätsprotokolleintrag nach ID.

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

Beispielanfrage:

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

Antwort:

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

Alle Aktivitätsprotokolle löschen

Löschen Sie alle Aktivitätsprotokolleeinträge.

Endpunkt: DELETE /api/v1/activity_log/all

Beispielanfrage:

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

Antwort:

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