curl -X GET "https://api.tktchurch.com/v1/events?type=service&status=scheduled&start=2024-01-01T00:00:00Z" \
-H "Accept: application/json"
const listEvents = async (params = {}) => {
const queryString = new URLSearchParams(params).toString();
const response = await fetch(
`https://api.tktchurch.com/v1/events?${queryString}`,
{
method: 'GET',
headers: {
'Accept': 'application/json'
}
}
);
if (!response.ok) {
throw new Error('Failed to fetch events');
}
return response.json();
};
// Usage
try {
const events = await listEvents({
type: 'service',
status: 'scheduled',
start: '2024-01-01T00:00:00Z'
});
console.log(events);
} catch (error) {
console.error('Error:', error);
}
struct EventsResponse: Codable {
let data: [Event]
let metadata: Metadata
}
func listEvents(
type: String? = nil,
status: String? = nil,
start: Date? = nil
) async throws -> EventsResponse {
var components = URLComponents(string: "https://api.tktchurch.com/v1/events")!
var queryItems: [URLQueryItem] = []
if let type = type {
queryItems.append(URLQueryItem(name: "type", value: type))
}
if let status = status {
queryItems.append(URLQueryItem(name: "status", value: status))
}
if let start = start {
let formatter = ISO8601DateFormatter()
queryItems.append(URLQueryItem(name: "start", value: formatter.string(from: start)))
}
components.queryItems = queryItems
let request = URLRequest(url: components.url!)
let (data, _) = try await URLSession.shared.data(for: request)
return try JSONDecoder().decode(EventsResponse.self, from: data)
}
// Usage
do {
let events = try await listEvents(
type: "service",
status: "scheduled",
start: Date()
)
print("Events:", events)
} catch {
print("Error:", error)
}
suspend fun listEvents(
type: String? = null,
status: String? = null,
start: String? = null
): EventsResponse {
val client = OkHttpClient()
val urlBuilder = HttpUrl.Builder()
.scheme("https")
.host("api.tktchurch.com")
.addPathSegment("v1")
.addPathSegment("events")
type?.let { urlBuilder.addQueryParameter("type", it) }
status?.let { urlBuilder.addQueryParameter("status", it) }
start?.let { urlBuilder.addQueryParameter("start", it) }
val request = Request.Builder()
.url(urlBuilder.build())
.get()
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
throw IOException("Unexpected response ${response.code}")
}
return Json.decodeFromString(response.body?.string() ?: "")
}
}
// Usage
try {
val events = listEvents(
type = "service",
status = "scheduled",
start = "2024-01-01T00:00:00Z"
)
println("Events: $events")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
interface EventsResponse {
data: Event[];
metadata: {
page: number;
per: number;
total: number;
};
}
const listEvents = async (params: {
type?: string;
status?: string;
start?: string;
}): Promise<EventsResponse> => {
try {
const response = await axios.get(
'https://api.tktchurch.com/v1/events',
{ params }
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.message || 'Failed to fetch events');
}
throw error;
}
};
// Usage
try {
const events = await listEvents({
type: 'service',
status: 'scheduled',
start: '2024-01-01T00:00:00Z'
});
console.log('Events:', events);
} catch (error) {
console.error('Error:', error);
}
{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "Sunday Worship Service",
"description": "Weekly Sunday worship service",
"startDate": "2024-01-07T10:00:00Z",
"endDate": "2024-01-07T12:00:00Z",
"timezone": "America/New_York",
"location": {
"name": "Main Sanctuary",
"address": "123 Church Street",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "10001",
"coordinates": {
"latitude": 40.7128,
"longitude": -74.0060
}
},
"type": "service",
"status": "scheduled",
"recurrence": {
"frequency": "weekly",
"interval": 1,
"byDay": ["SU"]
},
"reminders": [
{
"type": "email",
"minutes": 1440
},
{
"type": "notification",
"minutes": 60
}
],
"calendarLinks": {
"google": "https://calendar.google.com/...",
"apple": "webcal://...",
"outlook": "https://outlook.office.com/...",
"yahoo": "https://calendar.yahoo.com/...",
"ics": "https://api.tktchurch.com/v1/events/123/calendar.ics"
},
"tags": ["worship", "sunday-service"],
"maxCapacity": 500,
"requiresGeolocation": true,
"geofenceRadius": 100,
"createdByUserId": "456e7890-f12g-34h5-i678-912345678901",
"updatedByUserId": "456e7890-f12g-34h5-i678-912345678901",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"thumbnail": {
"id": "789e0123-j45k-67l8-m901-234567890123",
"url": "https://storage.tktchurch.com/thumbnails/event-123.jpg",
"provider": "s3",
"key": "thumbnails/event-123.jpg"
}
}
],
"metadata": {
"page": 1,
"per": 10,
"total": 50
}
}
Events
List Events
Returns a paginated list of church events with filtering options
GET
/
events
curl -X GET "https://api.tktchurch.com/v1/events?type=service&status=scheduled&start=2024-01-01T00:00:00Z" \
-H "Accept: application/json"
const listEvents = async (params = {}) => {
const queryString = new URLSearchParams(params).toString();
const response = await fetch(
`https://api.tktchurch.com/v1/events?${queryString}`,
{
method: 'GET',
headers: {
'Accept': 'application/json'
}
}
);
if (!response.ok) {
throw new Error('Failed to fetch events');
}
return response.json();
};
// Usage
try {
const events = await listEvents({
type: 'service',
status: 'scheduled',
start: '2024-01-01T00:00:00Z'
});
console.log(events);
} catch (error) {
console.error('Error:', error);
}
struct EventsResponse: Codable {
let data: [Event]
let metadata: Metadata
}
func listEvents(
type: String? = nil,
status: String? = nil,
start: Date? = nil
) async throws -> EventsResponse {
var components = URLComponents(string: "https://api.tktchurch.com/v1/events")!
var queryItems: [URLQueryItem] = []
if let type = type {
queryItems.append(URLQueryItem(name: "type", value: type))
}
if let status = status {
queryItems.append(URLQueryItem(name: "status", value: status))
}
if let start = start {
let formatter = ISO8601DateFormatter()
queryItems.append(URLQueryItem(name: "start", value: formatter.string(from: start)))
}
components.queryItems = queryItems
let request = URLRequest(url: components.url!)
let (data, _) = try await URLSession.shared.data(for: request)
return try JSONDecoder().decode(EventsResponse.self, from: data)
}
// Usage
do {
let events = try await listEvents(
type: "service",
status: "scheduled",
start: Date()
)
print("Events:", events)
} catch {
print("Error:", error)
}
suspend fun listEvents(
type: String? = null,
status: String? = null,
start: String? = null
): EventsResponse {
val client = OkHttpClient()
val urlBuilder = HttpUrl.Builder()
.scheme("https")
.host("api.tktchurch.com")
.addPathSegment("v1")
.addPathSegment("events")
type?.let { urlBuilder.addQueryParameter("type", it) }
status?.let { urlBuilder.addQueryParameter("status", it) }
start?.let { urlBuilder.addQueryParameter("start", it) }
val request = Request.Builder()
.url(urlBuilder.build())
.get()
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
throw IOException("Unexpected response ${response.code}")
}
return Json.decodeFromString(response.body?.string() ?: "")
}
}
// Usage
try {
val events = listEvents(
type = "service",
status = "scheduled",
start = "2024-01-01T00:00:00Z"
)
println("Events: $events")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
interface EventsResponse {
data: Event[];
metadata: {
page: number;
per: number;
total: number;
};
}
const listEvents = async (params: {
type?: string;
status?: string;
start?: string;
}): Promise<EventsResponse> => {
try {
const response = await axios.get(
'https://api.tktchurch.com/v1/events',
{ params }
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.message || 'Failed to fetch events');
}
throw error;
}
};
// Usage
try {
const events = await listEvents({
type: 'service',
status: 'scheduled',
start: '2024-01-01T00:00:00Z'
});
console.log('Events:', events);
} catch (error) {
console.error('Error:', error);
}
{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "Sunday Worship Service",
"description": "Weekly Sunday worship service",
"startDate": "2024-01-07T10:00:00Z",
"endDate": "2024-01-07T12:00:00Z",
"timezone": "America/New_York",
"location": {
"name": "Main Sanctuary",
"address": "123 Church Street",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "10001",
"coordinates": {
"latitude": 40.7128,
"longitude": -74.0060
}
},
"type": "service",
"status": "scheduled",
"recurrence": {
"frequency": "weekly",
"interval": 1,
"byDay": ["SU"]
},
"reminders": [
{
"type": "email",
"minutes": 1440
},
{
"type": "notification",
"minutes": 60
}
],
"calendarLinks": {
"google": "https://calendar.google.com/...",
"apple": "webcal://...",
"outlook": "https://outlook.office.com/...",
"yahoo": "https://calendar.yahoo.com/...",
"ics": "https://api.tktchurch.com/v1/events/123/calendar.ics"
},
"tags": ["worship", "sunday-service"],
"maxCapacity": 500,
"requiresGeolocation": true,
"geofenceRadius": 100,
"createdByUserId": "456e7890-f12g-34h5-i678-912345678901",
"updatedByUserId": "456e7890-f12g-34h5-i678-912345678901",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"thumbnail": {
"id": "789e0123-j45k-67l8-m901-234567890123",
"url": "https://storage.tktchurch.com/thumbnails/event-123.jpg",
"provider": "s3",
"key": "thumbnails/event-123.jpg"
}
}
],
"metadata": {
"page": 1,
"per": 10,
"total": 50
}
}
Query Parameters
string
Filter events by type. Options:
service: Church servicemeeting: Meetingconcert: Concertworkshop: Workshopconference: Conferencesocial: Social eventother: Other event type
string
Filter events by status. Options:
scheduled: Default status for upcoming eventscancelled: Cancelled eventspostponed: Postponed eventsrescheduled: Rescheduled events
string
Filter events by tag
string
Filter events starting from this date (ISO 8601 format)
string
Filter events ending before this date (ISO 8601 format)
Response
array
Array of event objects
Show Event Object
Show Event Object
string
Unique identifier for the event (UUID)
string
Event title
string
Event description
string
Event start date and time (ISO 8601)
string
Event end date and time (ISO 8601)
string
Event timezone
object
string
Event type (service, meeting, concert, workshop, conference, social, other)
string
Event status (scheduled, cancelled, postponed, rescheduled)
object
Event recurrence details (if recurring)
Show Recurrence Object
Show Recurrence Object
array
array
object
array
Event tags
integer
Maximum number of attendees (if applicable)
boolean
Whether geolocation is required for attendance
number
Geofence radius in meters (if applicable)
string
ID of user who created the event
string
ID of user who last updated the event
string
Creation timestamp (ISO 8601)
string
Last update timestamp (ISO 8601)
curl -X GET "https://api.tktchurch.com/v1/events?type=service&status=scheduled&start=2024-01-01T00:00:00Z" \
-H "Accept: application/json"
const listEvents = async (params = {}) => {
const queryString = new URLSearchParams(params).toString();
const response = await fetch(
`https://api.tktchurch.com/v1/events?${queryString}`,
{
method: 'GET',
headers: {
'Accept': 'application/json'
}
}
);
if (!response.ok) {
throw new Error('Failed to fetch events');
}
return response.json();
};
// Usage
try {
const events = await listEvents({
type: 'service',
status: 'scheduled',
start: '2024-01-01T00:00:00Z'
});
console.log(events);
} catch (error) {
console.error('Error:', error);
}
struct EventsResponse: Codable {
let data: [Event]
let metadata: Metadata
}
func listEvents(
type: String? = nil,
status: String? = nil,
start: Date? = nil
) async throws -> EventsResponse {
var components = URLComponents(string: "https://api.tktchurch.com/v1/events")!
var queryItems: [URLQueryItem] = []
if let type = type {
queryItems.append(URLQueryItem(name: "type", value: type))
}
if let status = status {
queryItems.append(URLQueryItem(name: "status", value: status))
}
if let start = start {
let formatter = ISO8601DateFormatter()
queryItems.append(URLQueryItem(name: "start", value: formatter.string(from: start)))
}
components.queryItems = queryItems
let request = URLRequest(url: components.url!)
let (data, _) = try await URLSession.shared.data(for: request)
return try JSONDecoder().decode(EventsResponse.self, from: data)
}
// Usage
do {
let events = try await listEvents(
type: "service",
status: "scheduled",
start: Date()
)
print("Events:", events)
} catch {
print("Error:", error)
}
suspend fun listEvents(
type: String? = null,
status: String? = null,
start: String? = null
): EventsResponse {
val client = OkHttpClient()
val urlBuilder = HttpUrl.Builder()
.scheme("https")
.host("api.tktchurch.com")
.addPathSegment("v1")
.addPathSegment("events")
type?.let { urlBuilder.addQueryParameter("type", it) }
status?.let { urlBuilder.addQueryParameter("status", it) }
start?.let { urlBuilder.addQueryParameter("start", it) }
val request = Request.Builder()
.url(urlBuilder.build())
.get()
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
throw IOException("Unexpected response ${response.code}")
}
return Json.decodeFromString(response.body?.string() ?: "")
}
}
// Usage
try {
val events = listEvents(
type = "service",
status = "scheduled",
start = "2024-01-01T00:00:00Z"
)
println("Events: $events")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
interface EventsResponse {
data: Event[];
metadata: {
page: number;
per: number;
total: number;
};
}
const listEvents = async (params: {
type?: string;
status?: string;
start?: string;
}): Promise<EventsResponse> => {
try {
const response = await axios.get(
'https://api.tktchurch.com/v1/events',
{ params }
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.message || 'Failed to fetch events');
}
throw error;
}
};
// Usage
try {
const events = await listEvents({
type: 'service',
status: 'scheduled',
start: '2024-01-01T00:00:00Z'
});
console.log('Events:', events);
} catch (error) {
console.error('Error:', error);
}
{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "Sunday Worship Service",
"description": "Weekly Sunday worship service",
"startDate": "2024-01-07T10:00:00Z",
"endDate": "2024-01-07T12:00:00Z",
"timezone": "America/New_York",
"location": {
"name": "Main Sanctuary",
"address": "123 Church Street",
"city": "New York",
"state": "NY",
"country": "USA",
"postalCode": "10001",
"coordinates": {
"latitude": 40.7128,
"longitude": -74.0060
}
},
"type": "service",
"status": "scheduled",
"recurrence": {
"frequency": "weekly",
"interval": 1,
"byDay": ["SU"]
},
"reminders": [
{
"type": "email",
"minutes": 1440
},
{
"type": "notification",
"minutes": 60
}
],
"calendarLinks": {
"google": "https://calendar.google.com/...",
"apple": "webcal://...",
"outlook": "https://outlook.office.com/...",
"yahoo": "https://calendar.yahoo.com/...",
"ics": "https://api.tktchurch.com/v1/events/123/calendar.ics"
},
"tags": ["worship", "sunday-service"],
"maxCapacity": 500,
"requiresGeolocation": true,
"geofenceRadius": 100,
"createdByUserId": "456e7890-f12g-34h5-i678-912345678901",
"updatedByUserId": "456e7890-f12g-34h5-i678-912345678901",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"thumbnail": {
"id": "789e0123-j45k-67l8-m901-234567890123",
"url": "https://storage.tktchurch.com/thumbnails/event-123.jpg",
"provider": "s3",
"key": "thumbnails/event-123.jpg"
}
}
],
"metadata": {
"page": 1,
"per": 10,
"total": 50
}
}
