curl -X GET "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar.ics" \
-H "Accept: text/calendar"
const downloadICSFile = async (eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}/calendar.ics`,
{
method: 'GET',
headers: {
'Accept': 'text/calendar'
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error.reason);
}
return response.text();
};
// Usage
try {
const icsContent = await downloadICSFile('123e4567-e89b-12d3-a456-426614174000');
console.log('ICS file content:', icsContent);
} catch (error) {
console.error('Error:', error);
}
func downloadICSFile(eventId: UUID) async throws -> String {
let urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(eventId)/calendar.ics")!)
let (data, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode != 200 {
throw URLError(.badServerResponse)
}
return String(data: data, encoding: .utf8) ?? ""
}
// Usage
do {
let icsContent = try await downloadICSFile(
eventId: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("ICS file content:", icsContent)
} catch {
print("Error:", error)
}
suspend fun downloadICSFile(eventId: String): String {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId/calendar.ics")
.get()
.header("Accept", "text/calendar")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
val error = response.body?.string()?.fromJson<ErrorResponse>()
throw Exception(error?.reason ?: "Failed to download ICS file")
}
return response.body?.string() ?: throw Exception("Empty response")
}
}
// Usage
try {
val icsContent = downloadICSFile("123e4567-e89b-12d3-a456-426614174000")
println("ICS file content: $icsContent")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const downloadICSFile = async (eventId: string): Promise<string> => {
try {
const response = await axios.get(
`https://api.tktchurch.com/v1/events/${eventId}/calendar.ics`,
{
headers: {
'Accept': 'text/calendar'
},
responseType: 'text'
}
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.error?.reason || 'Failed to download ICS file');
}
throw error;
}
};
// Usage
try {
const icsContent = await downloadICSFile('123e4567-e89b-12d3-a456-426614174000');
console.log('ICS file content:', icsContent);
} catch (error) {
console.error('Error:', error);
}
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//TKT Church//Event Calendar//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
UID:123e4567-e89b-12d3-a456-426614174000
DTSTAMP:20240101T000000Z
DTSTART:20240107T100000Z
DTEND:20240107T120000Z
SUMMARY:Sunday Worship Service
DESCRIPTION:Weekly Sunday worship service
LOCATION:Main Sanctuary, 123 Church Street, New York, NY, USA, 10001
STATUS:CONFIRMED
ORGANIZER;CN=TKT Church:mailto:[email protected]
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Reminder
TRIGGER:-PT1440M
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Reminder
TRIGGER:-PT60M
END:VALARM
END:VEVENT
END:VCALENDAR
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
Events
Get ICS File
Download an ICS file for the event
GET
/
events
/
{id}
/
calendar.ics
curl -X GET "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar.ics" \
-H "Accept: text/calendar"
const downloadICSFile = async (eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}/calendar.ics`,
{
method: 'GET',
headers: {
'Accept': 'text/calendar'
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error.reason);
}
return response.text();
};
// Usage
try {
const icsContent = await downloadICSFile('123e4567-e89b-12d3-a456-426614174000');
console.log('ICS file content:', icsContent);
} catch (error) {
console.error('Error:', error);
}
func downloadICSFile(eventId: UUID) async throws -> String {
let urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(eventId)/calendar.ics")!)
let (data, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode != 200 {
throw URLError(.badServerResponse)
}
return String(data: data, encoding: .utf8) ?? ""
}
// Usage
do {
let icsContent = try await downloadICSFile(
eventId: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("ICS file content:", icsContent)
} catch {
print("Error:", error)
}
suspend fun downloadICSFile(eventId: String): String {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId/calendar.ics")
.get()
.header("Accept", "text/calendar")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
val error = response.body?.string()?.fromJson<ErrorResponse>()
throw Exception(error?.reason ?: "Failed to download ICS file")
}
return response.body?.string() ?: throw Exception("Empty response")
}
}
// Usage
try {
val icsContent = downloadICSFile("123e4567-e89b-12d3-a456-426614174000")
println("ICS file content: $icsContent")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const downloadICSFile = async (eventId: string): Promise<string> => {
try {
const response = await axios.get(
`https://api.tktchurch.com/v1/events/${eventId}/calendar.ics`,
{
headers: {
'Accept': 'text/calendar'
},
responseType: 'text'
}
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.error?.reason || 'Failed to download ICS file');
}
throw error;
}
};
// Usage
try {
const icsContent = await downloadICSFile('123e4567-e89b-12d3-a456-426614174000');
console.log('ICS file content:', icsContent);
} catch (error) {
console.error('Error:', error);
}
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//TKT Church//Event Calendar//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
UID:123e4567-e89b-12d3-a456-426614174000
DTSTAMP:20240101T000000Z
DTSTART:20240107T100000Z
DTEND:20240107T120000Z
SUMMARY:Sunday Worship Service
DESCRIPTION:Weekly Sunday worship service
LOCATION:Main Sanctuary, 123 Church Street, New York, NY, USA, 10001
STATUS:CONFIRMED
ORGANIZER;CN=TKT Church:mailto:[email protected]
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Reminder
TRIGGER:-PT1440M
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Reminder
TRIGGER:-PT60M
END:VALARM
END:VEVENT
END:VCALENDAR
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
Path Parameters
string
required
The unique identifier (UUID) of the event
Response
Returns an ICS file containing the event details in iCalendar format. The response will have:- Content-Type:
text/calendar; charset=utf-8 - Content-Disposition:
attachment; filename="event.ics"
- Event title and description
- Start and end dates
- Location details
- Recurrence rules (if applicable)
- Reminders
- Organizer information
Error Responses
object
Common error cases:
- 404 Not Found: Event not found
curl -X GET "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000/calendar.ics" \
-H "Accept: text/calendar"
const downloadICSFile = async (eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}/calendar.ics`,
{
method: 'GET',
headers: {
'Accept': 'text/calendar'
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error.reason);
}
return response.text();
};
// Usage
try {
const icsContent = await downloadICSFile('123e4567-e89b-12d3-a456-426614174000');
console.log('ICS file content:', icsContent);
} catch (error) {
console.error('Error:', error);
}
func downloadICSFile(eventId: UUID) async throws -> String {
let urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(eventId)/calendar.ics")!)
let (data, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode != 200 {
throw URLError(.badServerResponse)
}
return String(data: data, encoding: .utf8) ?? ""
}
// Usage
do {
let icsContent = try await downloadICSFile(
eventId: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("ICS file content:", icsContent)
} catch {
print("Error:", error)
}
suspend fun downloadICSFile(eventId: String): String {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId/calendar.ics")
.get()
.header("Accept", "text/calendar")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
val error = response.body?.string()?.fromJson<ErrorResponse>()
throw Exception(error?.reason ?: "Failed to download ICS file")
}
return response.body?.string() ?: throw Exception("Empty response")
}
}
// Usage
try {
val icsContent = downloadICSFile("123e4567-e89b-12d3-a456-426614174000")
println("ICS file content: $icsContent")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const downloadICSFile = async (eventId: string): Promise<string> => {
try {
const response = await axios.get(
`https://api.tktchurch.com/v1/events/${eventId}/calendar.ics`,
{
headers: {
'Accept': 'text/calendar'
},
responseType: 'text'
}
);
return response.data;
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.error?.reason || 'Failed to download ICS file');
}
throw error;
}
};
// Usage
try {
const icsContent = await downloadICSFile('123e4567-e89b-12d3-a456-426614174000');
console.log('ICS file content:', icsContent);
} catch (error) {
console.error('Error:', error);
}
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//TKT Church//Event Calendar//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
UID:123e4567-e89b-12d3-a456-426614174000
DTSTAMP:20240101T000000Z
DTSTART:20240107T100000Z
DTEND:20240107T120000Z
SUMMARY:Sunday Worship Service
DESCRIPTION:Weekly Sunday worship service
LOCATION:Main Sanctuary, 123 Church Street, New York, NY, USA, 10001
STATUS:CONFIRMED
ORGANIZER;CN=TKT Church:mailto:[email protected]
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Reminder
TRIGGER:-PT1440M
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Reminder
TRIGGER:-PT60M
END:VALARM
END:VEVENT
END:VCALENDAR
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
