Skip to main content

get_events

This endpoint is used to retrieve events from your application.

Endpoint

GET https://api.sedl.dev/public/get_events

Authentication

This endpoint requires a Resource Token for authentication. Resource Tokens are used to read existing data from specific apps.

Request Headers

Authorization: Bearer <your-resource-token>

Query Parameters

ParameterTypeRequiredDescription
appIdstringYesThe ID of the app to retrieve events from
typeIdstringNoFilter events by specific event type ID
limitintegerNoMaximum number of events to return (default: 100, max: 1000)
offsetintegerNoNumber of events to skip for pagination (default: 0)
startDatestringNoFilter events from this date (ISO 8601 format)
endDatestringNoFilter events until this date (ISO 8601 format)

Example Request

cURL Example
curl -X GET "https://api.sedl.dev/public/get_events?appId=app_123&limit=50&offset=0" \
-H "Authorization: Bearer your-resource-token-here" \
-H "Content-Type: application/json"

Response

Success Response

Status Code: 200 OK

Success Response
{
"success": true,
"data": {
"events": [
{
"id": "evt_abc123def456",
"typeId": "038c6337-d021-4767-89f9-1e59e49fe475",
"payload": {
"userId": "12345",
"action": "button_click",
"buttonId": "checkout"
},
"createdAt": "2023-10-24T10:30:00Z"
},
{
"id": "evt_def789ghi012",
"typeId": "038c6337-d021-4767-89f9-1e59e49fe475",
"payload": {
"userId": "67890",
"action": "page_view",
"page": "homepage"
},
"createdAt": "2023-10-24T10:25:00Z"
}
],
"pagination": {
"total": 1247,
"limit": 50,
"offset": 0,
"hasMore": true
}
}
}

Error Responses

Status Code: 401 Unauthorized

Invalid Token
{
"success": false,
"error": "Invalid resource token",
"details": "The provided resource token is not valid or has expired"
}

Status Code: 403 Forbidden

Access Denied
{
"success": false,
"error": "Access denied",
"details": "You don't have permission to access this app's data"
}

Status Code: `404 Not Found**

App Not Found
{
"success": false,
"error": "App not found",
"details": "The specified appId does not exist"
}

Pagination

This endpoint supports pagination through the limit and offset parameters:

  • Use limit to control how many events are returned per request
  • Use offset to skip events for subsequent pages
  • Check the hasMore field in the response to know if there are more events available

Date Filtering

You can filter events by date range using the startDate and endDate parameters:

Date Range Example
curl -X GET "https://api.sedl.dev/public/get_events?appId=app_123&startDate=2023-10-01T00:00:00Z&endDate=2023-10-31T23:59:59Z" \
-H "Authorization: Bearer your-resource-token-here"
Resource Token

Remember that Resource Tokens are currently read-only and can only be used to retrieve existing data, not to create or modify events.