Ga naar hoofdinhoud

Activiteitenlogboek API

De Activity Log API stelt u in staat om activiteitenlogboeken voor uw apparaten en accounts bij te houden en te beheren. Dit is nuttig voor het monitoren van acties die door uw automatiseringstaken worden uitgevoerd.

Activiteitenlogboek toevoegen

Voeg een nieuw activiteitenlogboek toe.

Endpoint: POST /api/v1/activity_log

Aanvraagbody:

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

Antwoord:

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

Activiteitenlogboeken ophalen

Haal activiteitenlogboeken op met optionele filters.

Endpoint: GET /api/v1/activity_log

Queryparameters:

ParameterTypeVerplichtBeschrijving
platformstringNeeFilteren op platform (bijv. "tiktok", "instagram")
serialstringNeeFilteren op serienummer van apparaat
action_typestringNeeFilteren op actietype (bijv. "post", "follow", "comment")
limitintegerNeeAantal te retourneren records (standaard: 100, max: 1000)
offsetintegerNeeAantal over te slaan records voor paginering

Voorbeeldaanvraag:

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

Antwoord:

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

Aantal activiteitenlogboeken ophalen

Haal het totale aantal activiteitenlogboeken op dat overeenkomt met filters.

Endpoint: GET /api/v1/activity_log/count

Queryparameters:

ParameterTypeVerplichtBeschrijving
platformstringNeeFilteren op platform
serialstringNeeFilteren op serienummer van apparaat
action_typestringNeeFilteren op actietype

Voorbeeldaanvraag:

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

Antwoord:

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

Activiteitenlogboek verwijderen

Verwijder een specifiek activiteitenlogboek op basis van ID.

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

Voorbeeldaanvraag:

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

Antwoord:

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

Alle activiteitenlogboeken verwijderen

Verwijder alle activiteitenlogboeken.

Endpoint: DELETE /api/v1/activity_log/all

Voorbeeldaanvraag:

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

Antwoord:

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