curl --request POST \
--url https://api.1club.ai/v1/platform/schedule-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entries": [
{
"className": "Yoga Flow",
"classTypeName": "<string>",
"daysOfWeek": [],
"intervalWeeks": 2,
"startTime": "18:30",
"durationMinutes": 302,
"instructorName": "<string>",
"areaName": "<string>",
"capacity": 500
}
],
"clubId": 123,
"startsOn": "2023-12-25"
}
'import requests
url = "https://api.1club.ai/v1/platform/schedule-imports"
payload = {
"entries": [
{
"className": "Yoga Flow",
"classTypeName": "<string>",
"daysOfWeek": [],
"intervalWeeks": 2,
"startTime": "18:30",
"durationMinutes": 302,
"instructorName": "<string>",
"areaName": "<string>",
"capacity": 500
}
],
"clubId": 123,
"startsOn": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entries: [
{
className: 'Yoga Flow',
classTypeName: '<string>',
daysOfWeek: [],
intervalWeeks: 2,
startTime: '18:30',
durationMinutes: 302,
instructorName: '<string>',
areaName: '<string>',
capacity: 500
}
],
clubId: 123,
startsOn: '2023-12-25'
})
};
fetch('https://api.1club.ai/v1/platform/schedule-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/schedule-imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entries' => [
[
'className' => 'Yoga Flow',
'classTypeName' => '<string>',
'daysOfWeek' => [
],
'intervalWeeks' => 2,
'startTime' => '18:30',
'durationMinutes' => 302,
'instructorName' => '<string>',
'areaName' => '<string>',
'capacity' => 500
]
],
'clubId' => 123,
'startsOn' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/schedule-imports"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"className\": \"Yoga Flow\",\n \"classTypeName\": \"<string>\",\n \"daysOfWeek\": [],\n \"intervalWeeks\": 2,\n \"startTime\": \"18:30\",\n \"durationMinutes\": 302,\n \"instructorName\": \"<string>\",\n \"areaName\": \"<string>\",\n \"capacity\": 500\n }\n ],\n \"clubId\": 123,\n \"startsOn\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/schedule-imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entries\": [\n {\n \"className\": \"Yoga Flow\",\n \"classTypeName\": \"<string>\",\n \"daysOfWeek\": [],\n \"intervalWeeks\": 2,\n \"startTime\": \"18:30\",\n \"durationMinutes\": 302,\n \"instructorName\": \"<string>\",\n \"areaName\": \"<string>\",\n \"capacity\": 500\n }\n ],\n \"clubId\": 123,\n \"startsOn\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/schedule-imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entries\": [\n {\n \"className\": \"Yoga Flow\",\n \"classTypeName\": \"<string>\",\n \"daysOfWeek\": [],\n \"intervalWeeks\": 2,\n \"startTime\": \"18:30\",\n \"durationMinutes\": 302,\n \"instructorName\": \"<string>\",\n \"areaName\": \"<string>\",\n \"capacity\": 500\n }\n ],\n \"clubId\": 123,\n \"startsOn\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"clubId": 123,
"created": 123,
"updated": 123,
"skipped": 123,
"classTypes": 123,
"instructors": 123,
"failed": [
{
"className": "<string>",
"day": "<string>",
"startTime": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Import a timetable
Writes a club’s weekly timetable as repeating classes: one public series per class and weekday that never ends, starting on the next of that weekday on the club’s clock, or on startsOn when that is later. Class types and coaches are matched by name and created once.
Sending the same timetable again adds nothing twice. A series an earlier import made is found by its class, weekday and time; one whose length, capacity, class type or coach changed is updated from its next occurrence on, and a class at a new time on the same weekday is moved rather than added. A class that now repeats every other week has its coming weeks replaced, unless members are booked on them: it is then listed in failed and left as it is. Imports for one club run one at a time.
Requires classes:write.
curl --request POST \
--url https://api.1club.ai/v1/platform/schedule-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entries": [
{
"className": "Yoga Flow",
"classTypeName": "<string>",
"daysOfWeek": [],
"intervalWeeks": 2,
"startTime": "18:30",
"durationMinutes": 302,
"instructorName": "<string>",
"areaName": "<string>",
"capacity": 500
}
],
"clubId": 123,
"startsOn": "2023-12-25"
}
'import requests
url = "https://api.1club.ai/v1/platform/schedule-imports"
payload = {
"entries": [
{
"className": "Yoga Flow",
"classTypeName": "<string>",
"daysOfWeek": [],
"intervalWeeks": 2,
"startTime": "18:30",
"durationMinutes": 302,
"instructorName": "<string>",
"areaName": "<string>",
"capacity": 500
}
],
"clubId": 123,
"startsOn": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entries: [
{
className: 'Yoga Flow',
classTypeName: '<string>',
daysOfWeek: [],
intervalWeeks: 2,
startTime: '18:30',
durationMinutes: 302,
instructorName: '<string>',
areaName: '<string>',
capacity: 500
}
],
clubId: 123,
startsOn: '2023-12-25'
})
};
fetch('https://api.1club.ai/v1/platform/schedule-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/schedule-imports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entries' => [
[
'className' => 'Yoga Flow',
'classTypeName' => '<string>',
'daysOfWeek' => [
],
'intervalWeeks' => 2,
'startTime' => '18:30',
'durationMinutes' => 302,
'instructorName' => '<string>',
'areaName' => '<string>',
'capacity' => 500
]
],
'clubId' => 123,
'startsOn' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/schedule-imports"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"className\": \"Yoga Flow\",\n \"classTypeName\": \"<string>\",\n \"daysOfWeek\": [],\n \"intervalWeeks\": 2,\n \"startTime\": \"18:30\",\n \"durationMinutes\": 302,\n \"instructorName\": \"<string>\",\n \"areaName\": \"<string>\",\n \"capacity\": 500\n }\n ],\n \"clubId\": 123,\n \"startsOn\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/schedule-imports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entries\": [\n {\n \"className\": \"Yoga Flow\",\n \"classTypeName\": \"<string>\",\n \"daysOfWeek\": [],\n \"intervalWeeks\": 2,\n \"startTime\": \"18:30\",\n \"durationMinutes\": 302,\n \"instructorName\": \"<string>\",\n \"areaName\": \"<string>\",\n \"capacity\": 500\n }\n ],\n \"clubId\": 123,\n \"startsOn\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/schedule-imports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entries\": [\n {\n \"className\": \"Yoga Flow\",\n \"classTypeName\": \"<string>\",\n \"daysOfWeek\": [],\n \"intervalWeeks\": 2,\n \"startTime\": \"18:30\",\n \"durationMinutes\": 302,\n \"instructorName\": \"<string>\",\n \"areaName\": \"<string>\",\n \"capacity\": 500\n }\n ],\n \"clubId\": 123,\n \"startsOn\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"clubId": 123,
"created": 123,
"updated": 123,
"skipped": 123,
"classTypes": 123,
"instructors": 123,
"failed": [
{
"className": "<string>",
"day": "<string>",
"startTime": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Body
Response
What the import wrote, counted per weekly series
Was this page helpful?