Getting Started
Before using the Content API, ensure your SDK is properly initialized. The API methods are only available after initialization.
For SDK platforms (Swift, Kotlin, Flutter): Initialize the SDK with your credentials
For REST platforms (React Native, React TypeScript, HTML/JS): Set up your request headers
Initialize SDK / Setup Headers
1import KinesteXAIKit
2
3// Initialize KinesteXAIKit with your credentials
4let kinestex = KinesteXAIKit(
5 apiKey: "YOUR_API_KEY",
6 companyName: "YOUR_COMPANY",
7 userId: "user_123"
8)
9
10// Now you can use the Content API methods:
11// - kinestex.fetchWorkouts()
12// - kinestex.fetchPlans()
13// - kinestex.fetchExercises()
14// - kinestex.fetchWorkout(id:)
15// - kinestex.fetchPlan(id:)
16// - kinestex.fetchExercise(id:)
17// - kinestex.fetchContent(contentType:, ...)Available SDK Methods
KinesteXAIKit provides convenient methods that handle all the complexity of API calls for you.
Convenience Methods (Recommended)
1// Fetch lists with optional filters
2func fetchWorkouts(category: String? = nil, bodyParts: [BodyPart]? = nil, limit: Int? = 10, lastDocId: String? = nil, lang: String = "en") async -> Result<WorkoutsResponse, Error>
3
4func fetchExercises(bodyParts: [BodyPart]? = nil, limit: Int? = 10, lastDocId: String? = nil, lang: String = "en") async -> Result<ExercisesResponse, Error>
5
6func fetchPlans(category: String? = nil, limit: Int? = 10, lastDocId: String? = nil, lang: String = "en") async -> Result<PlansResponse, Error>
7
8// Fetch single items by ID
9func fetchWorkout(id: String, lang: String = "en") async -> Result<WorkoutModel, Error>
10func fetchExercise(id: String, lang: String = "en") async -> Result<ExerciseModel, Error>
11func fetchPlan(id: String, lang: String = "en") async -> Result<PlanModel, Error>Advanced Method (Full Control)
1// Use fetchContent for advanced filtering or when you need the raw result type
2func fetchContent(
3 contentType: ContentType, // .workout, .plan, .exercise
4 id: String? = nil,
5 title: String? = nil,
6 lang: String = "en",
7 category: String? = nil,
8 bodyParts: [BodyPart]? = nil,
9 lastDocId: String? = nil,
10 limit: Int? = nil
11) async -> APIContentResult