Endpoint
/filterActivity
Description
This endpoint allows you to retrieve a filtered list of activity logs. It supports pagination and time range filtering to customize the results.
Request
Headers
Content-Type: application/json
Authorization: Bearer {access_token}
Body
The request body should be a JSON object with the following structure:
{
"nextToken": "string",
"start": number,
"limit": number,
"end": number
}
Fields
nextToken
(string, optional): Token for retrieving the next page of results.start
(number, optional): Start timestamp for the activity log search range (in milliseconds since epoch).limit
(number, optional): Maximum number of results to return.end
(number, optional): End timestamp for the activity log search range (in milliseconds since epoch).
Response
Success Response
Status Code: 200 OK
Content-Type: application/json
{
"data": {
"activities": [
{
"id": "string",
"timestamp": number,
"activityType": "string",
"details": {},
// ... other activity-specific fields ...
}
],
"nextToken": "string"
},
"message": "string"
}
Fields
data
(object): Contains the response data.activities
(array): List of activity log objects.id
(string): Unique identifier for the activity log entry.timestamp
(number): Timestamp of when the activity occurred.activityType
(string): Type of activity logged.details
(object): Additional details about the activity.
nextToken
(string): Token for retrieving the next page of results.
message
(string): A message indicating the result of the operation.
Example
Request
POST /filterActivity
Content-Type: application/json
Authorization: Bearer {access_token}
{
"start": 1662364800000,
"end": 1662451200000,
"limit": 50
}
Success Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"activities": [
{
"id": "act-123",
"timestamp": 1662388800000,
"activityType": "LOGIN",
"details": {
"userId": "user-456",
"userName": "John Doe",
"ipAddress": "192.168.1.100"
}
},
{
"id": "act-124",
"timestamp": 1662392400000,
"activityType": "ACCESS_GRANTED",
"details": {
"userId": "user-789",
"userName": "Jane Smith",
"endpointId": "endpoint-001",
"endpointName": "Main Entrance"
}
}
// ... more activities ...
],
"nextToken": "next-page-token-xyz"
},
"message": "Activity logs retrieved successfully"
}
Notes
This API requires authentication. Make sure to include the necessary authentication headers when making the request.
The
nextToken
in the response can be used to retrieve the next page of results by including it in thenextToken
field of the next request.Timestamps should be provided in milliseconds since the Unix epoch.
If
start
andend
are not provided, the API may return the most recent activity logs up to the specifiedlimit
.The
limit
parameter can be used to control the number of results returned per request. If not specified, a default limit may be applied.The specific fields in the
details
object may vary depending on theactivityType
.The actual response structure may vary.