curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/google"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/apple"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/outlook"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/yahoo"
const addToCalendar = async (eventId, service) => {
window.location.href = `https://api.tktchurch.com/v1/events/${eventId}/calendar/${service}`;
};
// Usage
try {
// Add to Google Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'google');
// Add to Apple Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'apple');
// Add to Outlook Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'outlook');
// Add to Yahoo Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'yahoo');
} catch (error) {
console.error('Error:', error);
}
enum CalendarService: String {
case google
case apple
case outlook
case yahoo
}
func addToCalendar(eventId: UUID, service: CalendarService) {
if let url = URL(string: "https://api.tktchurch.com/v1/events/\(eventId)/calendar/\(service.rawValue)") {
UIApplication.shared.open(url)
}
}
// Usage
let eventId = UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
// Add to Google Calendar
addToCalendar(eventId: eventId, service: .google)
// Add to Apple Calendar
addToCalendar(eventId: eventId, service: .apple)
// Add to Outlook Calendar
addToCalendar(eventId: eventId, service: .outlook)
// Add to Yahoo Calendar
addToCalendar(eventId: eventId, service: .yahoo)
enum class CalendarService {
GOOGLE, APPLE, OUTLOOK, YAHOO
}
fun addToCalendar(context: Context, eventId: String, service: CalendarService) {
val url = "https://api.tktchurch.com/v1/events/$eventId/calendar/${service.name.lowercase()}"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
context.startActivity(intent)
}
// Usage
val eventId = "123e4567-e89b-12d3-a456-426614174000"
// Add to Google Calendar
addToCalendar(context, eventId, CalendarService.GOOGLE)
// Add to Apple Calendar
addToCalendar(context, eventId, CalendarService.APPLE)
// Add to Outlook Calendar
addToCalendar(context, eventId, CalendarService.OUTLOOK)
// Add to Yahoo Calendar
addToCalendar(context, eventId, CalendarService.YAHOO)
import { Linking } from 'react-native';
type CalendarService = 'google' | 'apple' | 'outlook' | 'yahoo';
const addToCalendar = async (eventId: string, service: CalendarService): Promise<void> => {
const url = `https://api.tktchurch.com/v1/events/${eventId}/calendar/${service}`;
const supported = await Linking.canOpenURL(url);
if (supported) {
await Linking.openURL(url);
} else {
throw new Error(`Cannot open URL: ${url}`);
}
};
// Usage
try {
const eventId = '123e4567-e89b-12d3-a456-426614174000';
// Add to Google Calendar
await addToCalendar(eventId, 'google');
// Add to Apple Calendar
await addToCalendar(eventId, 'apple');
// Add to Outlook Calendar
await addToCalendar(eventId, 'outlook');
// Add to Yahoo Calendar
await addToCalendar(eventId, 'yahoo');
} catch (error) {
console.error('Error:', error);
}
HTTP/1.1 302 Found
Location: https://calendar.google.com/calendar/render?action=TEMPLATE&text=Sunday+Worship+Service&details=Weekly+Sunday+worship+service&location=Main+Sanctuary%2C+123+Church+Street%2C+New+York%2C+NY%2C+USA%2C+10001&dates=20240107T100000Z%2F20240107T120000Z&recur=FREQ%3DWEEKLY%3BINTERVAL%3D1%3BBYDAY%3DSU
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
Events
Calendar Redirects
Redirect to various calendar services to add the event
GET
/
events
/
{id}
/
calendar
/
{type}
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/google"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/apple"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/outlook"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/yahoo"
const addToCalendar = async (eventId, service) => {
window.location.href = `https://api.tktchurch.com/v1/events/${eventId}/calendar/${service}`;
};
// Usage
try {
// Add to Google Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'google');
// Add to Apple Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'apple');
// Add to Outlook Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'outlook');
// Add to Yahoo Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'yahoo');
} catch (error) {
console.error('Error:', error);
}
enum CalendarService: String {
case google
case apple
case outlook
case yahoo
}
func addToCalendar(eventId: UUID, service: CalendarService) {
if let url = URL(string: "https://api.tktchurch.com/v1/events/\(eventId)/calendar/\(service.rawValue)") {
UIApplication.shared.open(url)
}
}
// Usage
let eventId = UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
// Add to Google Calendar
addToCalendar(eventId: eventId, service: .google)
// Add to Apple Calendar
addToCalendar(eventId: eventId, service: .apple)
// Add to Outlook Calendar
addToCalendar(eventId: eventId, service: .outlook)
// Add to Yahoo Calendar
addToCalendar(eventId: eventId, service: .yahoo)
enum class CalendarService {
GOOGLE, APPLE, OUTLOOK, YAHOO
}
fun addToCalendar(context: Context, eventId: String, service: CalendarService) {
val url = "https://api.tktchurch.com/v1/events/$eventId/calendar/${service.name.lowercase()}"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
context.startActivity(intent)
}
// Usage
val eventId = "123e4567-e89b-12d3-a456-426614174000"
// Add to Google Calendar
addToCalendar(context, eventId, CalendarService.GOOGLE)
// Add to Apple Calendar
addToCalendar(context, eventId, CalendarService.APPLE)
// Add to Outlook Calendar
addToCalendar(context, eventId, CalendarService.OUTLOOK)
// Add to Yahoo Calendar
addToCalendar(context, eventId, CalendarService.YAHOO)
import { Linking } from 'react-native';
type CalendarService = 'google' | 'apple' | 'outlook' | 'yahoo';
const addToCalendar = async (eventId: string, service: CalendarService): Promise<void> => {
const url = `https://api.tktchurch.com/v1/events/${eventId}/calendar/${service}`;
const supported = await Linking.canOpenURL(url);
if (supported) {
await Linking.openURL(url);
} else {
throw new Error(`Cannot open URL: ${url}`);
}
};
// Usage
try {
const eventId = '123e4567-e89b-12d3-a456-426614174000';
// Add to Google Calendar
await addToCalendar(eventId, 'google');
// Add to Apple Calendar
await addToCalendar(eventId, 'apple');
// Add to Outlook Calendar
await addToCalendar(eventId, 'outlook');
// Add to Yahoo Calendar
await addToCalendar(eventId, 'yahoo');
} catch (error) {
console.error('Error:', error);
}
HTTP/1.1 302 Found
Location: https://calendar.google.com/calendar/render?action=TEMPLATE&text=Sunday+Worship+Service&details=Weekly+Sunday+worship+service&location=Main+Sanctuary%2C+123+Church+Street%2C+New+York%2C+NY%2C+USA%2C+10001&dates=20240107T100000Z%2F20240107T120000Z&recur=FREQ%3DWEEKLY%3BINTERVAL%3D1%3BBYDAY%3DSU
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
These endpoints redirect users to various calendar services to add the event to their calendar.
Redirects to Google Calendar with the event details pre-filled.
Redirects to Apple Calendar (webcal://) with the event details.
Redirects to Outlook Calendar with the event details pre-filled.
Redirects to Yahoo Calendar with the event details pre-filled.
Google Calendar
string
required
The unique identifier (UUID) of the event
GET /events/{id}/calendar/google
Apple Calendar
string
required
The unique identifier (UUID) of the event
GET /events/{id}/calendar/apple
Outlook Calendar
string
required
The unique identifier (UUID) of the event
GET /events/{id}/calendar/outlook
Yahoo Calendar
string
required
The unique identifier (UUID) of the event
GET /events/{id}/calendar/yahoo
Error Responses
object
Common error cases:
- 404 Not Found: Event not found or calendar link not available
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/google"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/apple"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/outlook"
curl -L "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar/yahoo"
const addToCalendar = async (eventId, service) => {
window.location.href = `https://api.tktchurch.com/v1/events/${eventId}/calendar/${service}`;
};
// Usage
try {
// Add to Google Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'google');
// Add to Apple Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'apple');
// Add to Outlook Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'outlook');
// Add to Yahoo Calendar
await addToCalendar('123e4567-e89b-12d3-a456-426614174000', 'yahoo');
} catch (error) {
console.error('Error:', error);
}
enum CalendarService: String {
case google
case apple
case outlook
case yahoo
}
func addToCalendar(eventId: UUID, service: CalendarService) {
if let url = URL(string: "https://api.tktchurch.com/v1/events/\(eventId)/calendar/\(service.rawValue)") {
UIApplication.shared.open(url)
}
}
// Usage
let eventId = UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
// Add to Google Calendar
addToCalendar(eventId: eventId, service: .google)
// Add to Apple Calendar
addToCalendar(eventId: eventId, service: .apple)
// Add to Outlook Calendar
addToCalendar(eventId: eventId, service: .outlook)
// Add to Yahoo Calendar
addToCalendar(eventId: eventId, service: .yahoo)
enum class CalendarService {
GOOGLE, APPLE, OUTLOOK, YAHOO
}
fun addToCalendar(context: Context, eventId: String, service: CalendarService) {
val url = "https://api.tktchurch.com/v1/events/$eventId/calendar/${service.name.lowercase()}"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
context.startActivity(intent)
}
// Usage
val eventId = "123e4567-e89b-12d3-a456-426614174000"
// Add to Google Calendar
addToCalendar(context, eventId, CalendarService.GOOGLE)
// Add to Apple Calendar
addToCalendar(context, eventId, CalendarService.APPLE)
// Add to Outlook Calendar
addToCalendar(context, eventId, CalendarService.OUTLOOK)
// Add to Yahoo Calendar
addToCalendar(context, eventId, CalendarService.YAHOO)
import { Linking } from 'react-native';
type CalendarService = 'google' | 'apple' | 'outlook' | 'yahoo';
const addToCalendar = async (eventId: string, service: CalendarService): Promise<void> => {
const url = `https://api.tktchurch.com/v1/events/${eventId}/calendar/${service}`;
const supported = await Linking.canOpenURL(url);
if (supported) {
await Linking.openURL(url);
} else {
throw new Error(`Cannot open URL: ${url}`);
}
};
// Usage
try {
const eventId = '123e4567-e89b-12d3-a456-426614174000';
// Add to Google Calendar
await addToCalendar(eventId, 'google');
// Add to Apple Calendar
await addToCalendar(eventId, 'apple');
// Add to Outlook Calendar
await addToCalendar(eventId, 'outlook');
// Add to Yahoo Calendar
await addToCalendar(eventId, 'yahoo');
} catch (error) {
console.error('Error:', error);
}
HTTP/1.1 302 Found
Location: https://calendar.google.com/calendar/render?action=TEMPLATE&text=Sunday+Worship+Service&details=Weekly+Sunday+worship+service&location=Main+Sanctuary%2C+123+Church+Street%2C+New+York%2C+NY%2C+USA%2C+10001&dates=20240107T100000Z%2F20240107T120000Z&recur=FREQ%3DWEEKLY%3BINTERVAL%3D1%3BBYDAY%3DSU
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
