curl -X GET "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000" \
-H "Accept: application/json"
const getEvent = async (eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
method: 'GET',
headers: {
'Accept': 'application/json'
}
}
);
if (!response.ok) {
throw new Error('Failed to fetch event');
}
return response.json();
};
// Usage
try {
const event = await getEvent('123e4567-e89b-12d3-a456-426614174000');
console.log('Event:', event);
} catch (error) {
console.error('Error:', error);
}
func getEvent(id: UUID) async throws -> Event {
let urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(id)")!)
let (data, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode == 404 {
throw URLError(.resourceNotFound)
}
return try JSONDecoder().decode(Event.self, from: data)
}
// Usage
do {
let event = try await getEvent(id: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!)
print("Event:", event)
} catch {
print("Error:", error)
}
suspend fun getEvent(eventId: String): Event {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId")
.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 event = getEvent("123e4567-e89b-12d3-a456-426614174000")
println("Event: $event")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const getEvent = async (eventId: string): Promise<Event> => {
try {
const response = await axios.get(
`https://api.tktchurch.com/v1/events/${eventId}`
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
if (error.response?.status === 404) {
throw new Error('Event not found');
}
throw new Error(error.response?.data?.message || 'Failed to fetch event');
}
throw error;
}
};
// Usage
try {
const event = await getEvent('123e4567-e89b-12d3-a456-426614174000');
console.log('Event:', event);
} catch (error) {
console.error('Error:', error);
}
{
"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"
}
}
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
Events
Get Event Details
Get detailed information about a specific event
GET
/
events
/
{id}
curl -X GET "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000" \
-H "Accept: application/json"
const getEvent = async (eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
method: 'GET',
headers: {
'Accept': 'application/json'
}
}
);
if (!response.ok) {
throw new Error('Failed to fetch event');
}
return response.json();
};
// Usage
try {
const event = await getEvent('123e4567-e89b-12d3-a456-426614174000');
console.log('Event:', event);
} catch (error) {
console.error('Error:', error);
}
func getEvent(id: UUID) async throws -> Event {
let urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(id)")!)
let (data, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode == 404 {
throw URLError(.resourceNotFound)
}
return try JSONDecoder().decode(Event.self, from: data)
}
// Usage
do {
let event = try await getEvent(id: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!)
print("Event:", event)
} catch {
print("Error:", error)
}
suspend fun getEvent(eventId: String): Event {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId")
.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 event = getEvent("123e4567-e89b-12d3-a456-426614174000")
println("Event: $event")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const getEvent = async (eventId: string): Promise<Event> => {
try {
const response = await axios.get(
`https://api.tktchurch.com/v1/events/${eventId}`
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
if (error.response?.status === 404) {
throw new Error('Event not found');
}
throw new Error(error.response?.data?.message || 'Failed to fetch event');
}
throw error;
}
};
// Usage
try {
const event = await getEvent('123e4567-e89b-12d3-a456-426614174000');
console.log('Event:', event);
} catch (error) {
console.error('Error:', error);
}
{
"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"
}
}
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
Path Parameters
string
required
The unique identifier (UUID) of the event
Response
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)
object
Error Responses
object
Common error cases:
- 404 Not Found: Event with the specified ID does not exist
curl -X GET "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000" \
-H "Accept: application/json"
const getEvent = async (eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
method: 'GET',
headers: {
'Accept': 'application/json'
}
}
);
if (!response.ok) {
throw new Error('Failed to fetch event');
}
return response.json();
};
// Usage
try {
const event = await getEvent('123e4567-e89b-12d3-a456-426614174000');
console.log('Event:', event);
} catch (error) {
console.error('Error:', error);
}
func getEvent(id: UUID) async throws -> Event {
let urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(id)")!)
let (data, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode == 404 {
throw URLError(.resourceNotFound)
}
return try JSONDecoder().decode(Event.self, from: data)
}
// Usage
do {
let event = try await getEvent(id: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!)
print("Event:", event)
} catch {
print("Error:", error)
}
suspend fun getEvent(eventId: String): Event {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId")
.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 event = getEvent("123e4567-e89b-12d3-a456-426614174000")
println("Event: $event")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const getEvent = async (eventId: string): Promise<Event> => {
try {
const response = await axios.get(
`https://api.tktchurch.com/v1/events/${eventId}`
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
if (error.response?.status === 404) {
throw new Error('Event not found');
}
throw new Error(error.response?.data?.message || 'Failed to fetch event');
}
throw error;
}
};
// Usage
try {
const event = await getEvent('123e4567-e89b-12d3-a456-426614174000');
console.log('Event:', event);
} catch (error) {
console.error('Error:', error);
}
{
"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"
}
}
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
