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:
| Parameter | Type | Verplicht | Beschrijving |
|---|---|---|---|
| platform | string | Nee | Filteren op platform (bijv. "tiktok", "instagram") |
| serial | string | Nee | Filteren op serienummer van apparaat |
| action_type | string | Nee | Filteren op actietype (bijv. "post", "follow", "comment") |
| limit | integer | Nee | Aantal te retourneren records (standaard: 100, max: 1000) |
| offset | integer | Nee | Aantal 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:
| Parameter | Type | Verplicht | Beschrijving |
|---|---|---|---|
| platform | string | Nee | Filteren op platform |
| serial | string | Nee | Filteren op serienummer van apparaat |
| action_type | string | Nee | Filteren 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"
}
}