### Magicline API - Getting Started Source: https://context7_llms A step-by-step guide for new users to begin integrating with the Magicline API. Covers initial setup and basic usage patterns. ```APIDOC Getting Started Guide: URL: https://developer.sportalliance.com/apis/magicline/openapi/how-to-get-started Content: Instructions for API authentication, making initial requests, and understanding the API structure. ``` -------------------------------- ### Magicline Open API Documentation Overview Source: https://developer.sportalliance.com/apis/magicline/openapi/how-to-get-started References to key sections of the Magicline Open API documentation, including general information, getting started guides, managing activations, changelog, and API reference. ```APIDOC API Documentation Sections: - General Information: /apis/magicline/openapi/general-information - How to get started: /apis/magicline/openapi/how-to-get-started - Managing Activations: /apis/magicline/openapi/managing-activations - Changelog: /apis/magicline/openapi/changelog - API Reference: (Implied, not explicitly linked as a single URL) - Magicline Device API: (Implied) - Webhooks: (Implied) - Connect API: (Implied) ``` -------------------------------- ### Get Trial Offer Config Example Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers Example request to fetch trial offer configuration using cURL. Replace `{configId}` with the actual ID and `YOUR_API_KEY_HERE` with your valid API key. ```curl curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/trial-offers/config/{configId}' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` ```JavaScript fetch('https://open-api-demo.open-api.magicline.com/v1/trial-offers/config/{configId}', { method: 'GET', headers: { 'X-API-KEY': 'YOUR_API_KEY_HERE' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```Node.js const https = require('https'); const options = { hostname: 'open-api-demo.open-api.magicline.com', port: 443, path: '/v1/trial-offers/config/{configId}', method: 'GET', headers: { 'X-API-KEY': 'YOUR_API_KEY_HERE' } }; const req = https.request(options, (res) => { let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { console.log(JSON.parse(data)); }); }); req.on('error', (error) => { console.error('Error:', error); }); req.end(); ``` ```Python import requests url = 'https://open-api-demo.open-api.magicline.com/v1/trial-offers/config/{configId}' headers = { 'X-API-KEY': 'YOUR_API_KEY_HERE' } response = requests.get(url, headers=headers) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}") ``` ```Java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.IOException; public class GetTrialOfferConfig { public static void main(String[] args) throws IOException, InterruptedException { HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://open-api-demo.open-api.magicline.com/v1/trial-offers/config/{configId}")) .header("X-API-KEY", "YOUR_API_KEY_HERE") .GET() .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` ```C# using System; using System.Net.Http; using System.Threading.Tasks; public class GetTrialOfferConfig { public static async Task Main(string[] args) { using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Add("X-API-KEY", "YOUR_API_KEY_HERE"); string url = "https://open-api-demo.open-api.magicline.com/v1/trial-offers/config/{configId}"; HttpResponseMessage response = await client.GetAsync(url); if (response.IsSuccessStatusCode) { string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } else { Console.WriteLine($"Error: {response.StatusCode}"); } } } } ``` ```PHP ``` ```Go package main import ( "fmt" "io/ioutil" "net/http" ) func main() { client := &http.Client{} req, err := http.NewRequest("GET", "https://open-api-demo.open-api.magicline.com/v1/trial-offers/config/{configId}", nil) if err != nil { fmt.Println("Error creating request:", err) return } req.Header.Add("X-API-KEY", "YOUR_API_KEY_HERE") res, err := client.Do(req) if err != nil { fmt.Println("Error sending request:", err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println("Error reading response body:", err) return } fmt.Println(string(body)) } ``` ```Ruby require 'uri' require 'net/http' uri = URI('https://open-api-demo.open-api.magicline.com/v1/trial-offers/config/{configId}') request = Net::HTTP::Get.new(uri) request['X-API-KEY'] = 'YOUR_API_KEY_HERE' response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| http.request(request) end puts response.body ``` ```R library(httr) url <- "https://open-api-demo.open-api.magicline.com/v1/trial-offers/config/{configId}" headers <- c('X-API-KEY' = 'YOUR_API_KEY_HERE') response <- GET(url, add_headers(headers)) if (http_status(response)$category == "Success") { print(content(response, "parsed")) } else { print(paste0("Error: ", http_status(response)$message)) } ``` -------------------------------- ### Curl Example for Trial Offers Class Slots Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers Example of how to call the Get Class Slots for Trial Offers API endpoint using curl. It demonstrates setting the classId, offset, sliceSize, and the API key. ```curl curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/trial-offers/bookable-trial-offers/classes/{classId}/slots?offset=0&sliceSize=50' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Integration Development and Testing Source: https://developer.sportalliance.com/apis/magicline/openapi/how-to-get-started Guidance on developing and testing integrations with the Magicline Open API, including the use of a built-in mock server for API response testing. ```APIDOC Development & Testing: 1. Explore API documentation. 2. Utilize the built-in mock server to test API responses. 3. Reach out for questions regarding Open API work. 4. Schedule a demo of the created app or services with PMs. ``` -------------------------------- ### Magicline Partner Program Signup Source: https://developer.sportalliance.com/apis/magicline/openapi/how-to-get-started Link to the registration form for the Magicline Partner Program. This form is the second step in becoming a partner and allows developers to share their use case. ```APIDOC Endpoint: Type: POST URL: https://form.typeform.com/to/P7tE9oZc Description: Magicline Partner Program Signup Form Parameters: - None (Form submission) ``` -------------------------------- ### Curl Example for Get Class Slot Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/classes An example of how to call the Get Class Slot by ID API endpoint using curl. ```curl curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/classes/{classId}/slots/{classSlotId}' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Get Customers Endpoint Example Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/customers Demonstrates how to call the GET /v1/customers endpoint with various query parameters and includes example requests in multiple languages. ```APIDOC GET /v1/customers Description: Returns all customers from studio in expected slices. Query Parameters: cardNumberFormat (string, optional): Defines how card numbers are interpreted. Enum: "DECIMAL", "HEX_MSB", "HEX_LSB". Default: "DECIMAL". offset (string, optional): Offset from last request (last ID of the customer). sliceSize (integer, optional): Desired size of data chunk. Range: 50-500. Default: 100. customerStatus (string, optional): Defines status of returned customers. Enum: "MEMBER", "PROSPECT". Default: "MEMBER". lastOffsetId (integer, optional, Deprecated): Last ID of customer from last chunk. Security: ApiKeyAuth Required Scopes: CUSTOMER_READ Example Usage: curl: curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/customers?cardNumberFormat=DECIMAL&customerStatus=MEMBER&lastOffsetId=0&offset=string&sliceSize=100' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' JavaScript: // Example for JavaScript (using fetch API) fetch('https://open-api-demo.open-api.magicline.com/v1/customers?cardNumberFormat=DECIMAL&customerStatus=MEMBER&sliceSize=100', { method: 'GET', headers: { 'X-API-KEY': 'YOUR_API_KEY_HERE', 'Content-Type': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); Python: import requests url = "https://open-api-demo.open-api.magicline.com/v1/customers" headers = { "X-API-KEY": "YOUR_API_KEY_HERE", "Content-Type": "application/json" } params = { "cardNumberFormat": "DECIMAL", "customerStatus": "MEMBER", "sliceSize": 100 } response = requests.get(url, headers=headers, params=params) print(response.json()) Node.js: // Example for Node.js (using axios) const axios = require('axios'); const url = 'https://open-api-demo.open-api.magicline.com/v1/customers'; const apiKey = 'YOUR_API_KEY_HERE'; axios.get(url, { headers: { 'X-API-KEY': apiKey, 'Content-Type': 'application/json' }, params: { cardNumberFormat: 'DECIMAL', customerStatus: 'MEMBER', sliceSize: 100 } }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error:', error); }); Java: // Example for Java (using OkHttp) // import okhttp3.*; // import java.io.IOException; // OkHttpClient client = new OkHttpClient(); // Request request = new Request.Builder() // .url("https://open-api-demo.open-api.magicline.com/v1/customers?cardNumberFormat=DECIMAL&customerStatus=MEMBER&sliceSize=100") // .addHeader("X-API-KEY", "YOUR_API_KEY_HERE") // .addHeader("Content-Type", "application/json") // .build(); // try (Response response = client.newCall(request).execute()) { // if (response.isSuccessful()) { // System.out.println(response.body().string()); // } else { // System.err.println("Error: " + response.code()); // } // } catch (IOException e) { // e.printStackTrace(); // } C#: // Example for C# (using HttpClient) // using System.Net.Http; // using System.Threading.Tasks; // public async Task GetCustomersAsync() // { // using (HttpClient client = new HttpClient()) // { // client.DefaultRequestHeaders.Add("X-API-KEY", "YOUR_API_KEY_HERE"); // client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); // string url = "https://open-api-demo.open-api.magicline.com/v1/customers?cardNumberFormat=DECIMAL&customerStatus=MEMBER&sliceSize=100"; // HttpResponseMessage response = await client.GetAsync(url); // if (response.IsSuccessStatusCode) // { // string responseBody = await response.Content.ReadAsStringAsync(); // Console.WriteLine(responseBody); // } // else // { // Console.WriteLine($"Error: {response.StatusCode}"); // } // } // } PHP: // Example for PHP // $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, "https://open-api-demo.open-api.magicline.com/v1/customers?cardNumberFormat=DECIMAL&customerStatus=MEMBER&sliceSize=100"); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); // $headers = array( // "X-API-KEY: YOUR_API_KEY_HERE", // "Content-Type: application/json" // ); // curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // $result = curl_exec($ch); // if (curl_errno($ch)) { // echo 'Error:' . curl_error($ch); // } // curl_close($ch); // echo $result; Go: // Example for Go // package main // import ( // "fmt" // "io/ioutil" // "net/http" // "strings" // ) // func main() { // client := &http.Client{} // req, err := http.NewRequest("GET", "https://open-api-demo.open-api.magicline.com/v1/customers?cardNumberFormat=DECIMAL&customerStatus=MEMBER&sliceSize=100", nil) // if err != nil { // fmt.Println(err) // return // } // req.Header.Add("X-API-KEY", "YOUR_API_KEY_HERE") // req.Header.Add("Content-Type", "application/json") // resp, err := client.Do(req) // if err != nil { // fmt.Println(err) // return // } // defer resp.Body.Close() // body, err := ioutil.ReadAll(resp.Body) // if err != nil { // fmt.Println(err) // return // } // fmt.Println(string(body)) // } Ruby: # Example for Ruby # require 'uri' # require 'net/http' # uri = URI("https://open-api-demo.open-api.magicline.com/v1/customers?cardNumberFormat=DECIMAL&customerStatus=MEMBER&sliceSize=100") # Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| # request = Net::HTTP::Get.new(uri) # request['X-API-KEY'] = 'YOUR_API_KEY_HERE' # request['Content-Type'] = 'application/json' # response = http.request(request) # puts response.body # end R: # Example for R # library(httr) # url <- "https://open-api-demo.open-api.magicline.com/v1/customers" # query_params <- list( # cardNumberFormat = "DECIMAL", # customerStatus = "MEMBER", # sliceSize = 100 # ) # headers <- c( # `X-API-KEY` = "YOUR_API_KEY_HERE", # `Content-Type` = "application/json" # ) # response <- GET(url, query = query_params, httr::add_headers(.headers = headers)) # content(response, "parsed") ``` -------------------------------- ### Fetch Bookable Trial Offer Classes (Python Example) Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers Example using Python's requests library to fetch bookable trial offer classes, showing parameter and header configuration. ```Python import requests def get_bookable_trial_offer_classes(offset=0, slice_size=50): api_key = 'YOUR_API_KEY_HERE' url = 'https://open-api-demo.open-api.magicline.com/v1/trial-offers/bookable-trial-offers/classes' headers = { 'X-API-KEY': api_key, 'Content-Type': 'application/json' } params = { 'offset': offset, 'sliceSize': slice_size } try: response = requests.get(url, headers=headers, params=params) response.raise_for_status() # Raise an exception for bad status codes return response.json() except requests.exceptions.RequestException as e: print(f"Error fetching bookable trial offer classes: {e}") return None # Example usage: # data = get_bookable_trial_offer_classes(offset=0, slice_size=50) # if data: # print(data) ``` -------------------------------- ### Magicline API Reference - Overview Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/customers This section provides an overview of the Magicline API, including links to general information, getting started guides, and specific API endpoints for managing activations and accessing various data resources. ```APIDOC Magicline Open API: - General Information: /apis/magicline/openapi/general-information - How to get started: /apis/magicline/openapi/how-to-get-started - Managing Activations: /apis/magicline/openapi/managing-activations - Use Case Descriptions - Changelog: /apis/magicline/openapi/changelog - Aggregator Partners - API reference: - Magicline API: /apis/magicline/openapi/openapi - Appointments: /apis/magicline/openapi/openapi/appointments - Checkin vouchers: /apis/magicline/openapi/openapi/checkin-vouchers - Classes: /apis/magicline/openapi/openapi/classes - Cross Studio: /apis/magicline/openapi/openapi/cross-studio - Customers: /apis/magicline/openapi/openapi/customers ``` -------------------------------- ### Fetch Bookable Trial Offer Classes (JavaScript Example) Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers Example using JavaScript (fetch API) to retrieve bookable trial offer classes, demonstrating how to set headers and query parameters. ```JavaScript async function getBookableTrialOfferClasses(offset = 0, sliceSize = 50) { const apiKey = 'YOUR_API_KEY_HERE'; const url = `https://open-api-demo.open-api.magicline.com/v1/trial-offers/bookable-trial-offers/classes?offset=${offset}&sliceSize=${sliceSize}`; try { const response = await fetch(url, { method: 'GET', headers: { 'X-API-KEY': apiKey, 'Content-Type': 'application/json' } }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); return data; } catch (error) { console.error('Error fetching bookable trial offer classes:', error); throw error; } } // Example usage: // getBookableTrialOfferClasses(0, 50) // .then(data => console.log(data)) // .catch(err => console.error(err)); ``` -------------------------------- ### Curl Example for Get Appointment Booking Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/appointments An example of how to call the Get Appointment Booking API endpoint using curl. It demonstrates the GET request method, the endpoint URL with a placeholder for the booking ID, and the necessary API key header. ```curl curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/appointments/booking/{bookingId}' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Get Customer Contracts Curl Example Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/customers Demonstrates how to call the Get Customer Contracts API using curl, including the API key and status parameter. ```curl curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/customers/{customerId}/contracts?status=ACTIVE' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Get Customer Contract Data Example Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/membership-self-service Retrieves a customer's current contract data for memberships. Requires `MEMBERSHIP_SELF_SERVICE_READ` scope and API Key authentication. Includes example cURL request. ```APIDOC GET /v1/memberships/{customerId}/self-service/contract-data Parameters: customerId (integer, required): Unique ID of the customer. Scopes: MEMBERSHIP_SELF_SERVICE_READ Security: ApiKeyAuth Example Request: curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/memberships/{customerId}/self-service/contract-data' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Create Lead Customer API Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers This section provides a reference to the API endpoint used for creating a lead customer. Further details on its request and response structure are expected. ```APIDOC Endpoint: /trial-offers/createleadcustomer Description: Create a lead customer. Related Methods: - Validate Lead Customer Creation (/trial-offers/validateforleadcustomercreation) ``` -------------------------------- ### Get Additional Modules API Endpoint Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/membership-self-service Details the GET request for retrieving additional modules for a studio. It specifies required scopes, security methods, the endpoint URL, and provides example usage via curl. ```APIDOC GET /v1/memberships/self-service/additional-modules Description: Get additional modules for a studio. Required Scopes: MEMBERSHIP_SELF_SERVICE_ADDITIONAL_MODULE_READ Security: ApiKeyAuth Example Usage (curl): curl -i -X GET \ https://open-api-demo.open-api.magicline.com/v1/memberships/self-service/additional-modules \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Fetch Bookable Trial Offer Classes (cURL Example) Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers Example using cURL to fetch bookable trial offer classes with specified offset and slice size, including API key authentication. ```curl curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/trial-offers/bookable-trial-offers/classes?offset=0&sliceSize=50' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Page Initialization Script Source: https://developer.sportalliance.com/apis/perfectgym/usecases/additional-modules JavaScript code snippet for initializing analytics and router data, commonly found in web applications. ```JavaScript window.__staticRouterHydrationData = JSON.parse("{\"loaderData\":{\"0\":null,\"0-11\":null},\"actionData\":null,\"errors\":null}"); if(true) { window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-P81J65BPWX', {"send_page_view":false,"groups":"/"}); } ``` -------------------------------- ### Curl Example for Get Customer Check-in History Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/customers Example request using curl to fetch customer check-in history. It demonstrates how to include path parameters, query parameters, and the API key in the request header. ```curl curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/customers/{customerId}/activities/checkins?fromDate=2019-08-24&offset=0&sliceSize=10&toDate=2019-08-24' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Studios API Endpoints Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers Endpoints for retrieving studio information and managing studio activations. ```APIDOC Studios API: Description: Get studio information Operations: GET /v1/studios/utilization GET /v1/studios/information POST /v1/studios/confirmActivation ``` -------------------------------- ### Get Additional Module Contract Response Schema Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/membership-self-service This section details the structure of the JSON response body for the Get Additional Module Contract API endpoint. It specifies the fields, their data types, whether they are required, and provides example values for each attribute, including nested objects and enumerations. ```APIDOC membership-self-service/getadditionalmodulecontract/response Description: Represents the details of an additional module contract. Fields: - name: string (required) Name of the additional module contract. Example: "drink flat" - price: object (required) Represents a financial data tuple. - amount: number (required) Amount of the finance data tuple. Example: 20 - currency: string (ISO 4217) (required) Currency of the finance data tuple. Example: "EUR" - startDate: string (date) (required) Start date of the additional module contract. Example: "2022-01-15" - endDate: string (date) End date of the additional module contract. Example: "2022-01-15" - cancelationDate: string (date) Cancelation date of the additional module contract. Example: "2022-01-15" - lastPossibleCancelationDate: string (date) Last possible cancelation date of the additional module contract. Example: "2022-01-15" - cancelationReason: string Represents the reason of a contract cancelation. Example: "Illness" - contractCancelationStatus: string Cancelation status of the contract cancelation. Enum Values: - PENDING_WITHDRAWAL_VERIFICATION: The cancelation withdrawal is pending verification. - CANCELED: The contract was canceled by the customer. - PENDING_VERIFICATION: The cancelation is pending verification. Example: "PENDING_VERIFICATION" - contractCancelationCanBeWithdrawn: boolean (required) Whether a contract cancelation for the additional module contract can be withdrawn. Example: true - trialPeriod: object Represents the trial period of an additional module. (Details for trialPeriod properties like 'term' and 'startDate' are omitted for brevity but would be defined here if fully expanded). - availableCancelationDates: Array of strings (date) List of available dates for contract cancelation. Example: ["2019-08-24"] Possible Responses: - 200 OK - 400 Bad Request - 401 Unauthorized - 403 Forbidden - 404 Not Found - 409 Conflict - 429 Too Many Requests - 500 Internal Server Error ``` -------------------------------- ### Trial Offers API Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/finance Manages trial offers, including retrieving bookable offers, configurations, and handling lead validation and creation. ```APIDOC Trial Offers API Operations: GET /v1/trial-offers/bookable-trial-offers/classes - Retrieves bookable trial offers for classes. GET /v1/trial-offers/bookable-trial-offers/appointments/bookable - Retrieves bookable trial offers for appointments. GET /v1/trial-offers/config/{configId} - Retrieves trial offer configuration by ID. POST /v1/trial-offers/lead/validate - Validates trial offer lead information. POST /v1/trial-offers/lead/create - Creates a new trial offer lead. GET /v1/trial-offers/bookable-trial-offers/classes/{classId}/slots - Retrieves available slots for a specific bookable class trial offer. GET /v1/trial-offers/bookable-trial-offers/appointments/bookable/{bookableAppointmentId}/slots - Retrieves available slots for a specific bookable appointment trial offer. POST /v1/trial-offers/classes/booking/validate - Validates a class booking for a trial offer. ``` -------------------------------- ### Supported Languages for API Interaction Source: https://developer.sportalliance.com/apis/perfectgym/deviceapi/deviceapi/access Lists the programming languages for which example requests or SDKs are available for the PerfectGym Device API. ```JavaScript // Example placeholder for JavaScript SDK or request generation ``` ```Python # Example placeholder for Python SDK or request generation ``` ```Java // Example placeholder for Java SDK or request generation ``` ```C# // Example placeholder for C# SDK or request generation ``` ```PHP // Example placeholder for PHP SDK or request generation ``` ```Go // Example placeholder for Go SDK or request generation ``` ```Ruby # Example placeholder for Ruby SDK or request generation ``` ```R # Example placeholder for R SDK or request generation ``` -------------------------------- ### Get Transfer Details API Endpoint Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/finance Details the Get Transfer Details API endpoint. This endpoint retrieves specific transfer details using a debt collection run ID. It outlines the request method, path, required parameters, security, and provides example usage. ```APIDOC GET /v1/debt-collection/{debtCollectionRunId}/details Purpose: Get transfer details by specified debtCollectionRunId. Required Scopes: DEBT_COLLECTION_READ Security: ApiKeyAuth Path Parameters: - debtCollectionRunId: integer (int64, required). Unique ID of the debt collection run. Example URLs: - Demo tenant: https://open-api-demo.open-api.magicline.com/v1/debt-collection/{debtCollectionRunId}/details - Mock server: https://redocly.sportalliance.com/_mock/apis/magicline/openapi/openapi/v1/debt-collection/{debtCollectionRunId}/details Example Curl Request: curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/debt-collection/{debtCollectionRunId}/details' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Get Blocked Debts API Endpoint Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/finance Defines the `getdebtcollectionblockeddebts` API endpoint. It specifies the HTTP method (GET), path, required security scopes (`DEBT_COLLECTION_READ`), authentication method (ApiKeyAuth), and available query parameters (`debtId`, `offset`, `sliceSize`). Includes example usage via cURL. ```APIDOC GET /v1/debt-collection/blocked/debts Required Scopes: DEBT_COLLECTION_READ Security: ApiKeyAuth Query Parameters: debtId (array of strings, uuid, required): Unique ID of the debt. offset (string, optional): Offset from last request. Default "0". sliceSize (integer, int32, optional): Desired size of data chunk. Minimum 1, Maximum 50. Default 10. Example Usage: Demo tenant: https://open-api-demo.open-api.magicline.com/v1/debt-collection/blocked/debts Mock server: https://redocly.sportalliance.com/_mock/apis/magicline/openapi/openapi/v1/debt-collection/blocked/debts ``` ```curl curl -i -X GET \ 'https://open-api-demo.open-api.magicline.com/v1/debt-collection/blocked/debts?debtId=497f6eca-6276-4993-bfeb-53cbbbba6f08&offset=0&sliceSize=10' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' ``` -------------------------------- ### Book Appointment Request (curl) Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers Example cURL command to book an appointment for trial offers, demonstrating the POST request with JSON payload and API key authentication. ```curl curl -i -X POST \ https://open-api-demo.open-api.magicline.com/v1/trial-offers/appointments/booking/book \ -H 'Content-Type: application/json' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' \ -d '{ "customerId": 203, "bookableAppointmentId": 20334, "startDateTime": "2022-06-22T08:00:00.000+02:00[Europe/Berlin]", "endDateTime": "2022-06-22T10:00:00.000+02:00[Europe/Berlin]", "instructorIds": [ 0 ] }' ``` -------------------------------- ### POST /v1/trial-offers/lead/create - Create Lead Customer Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers This API endpoint allows for the creation of a new lead customer. It requires customer details and a trial offer configuration ID. The response includes the ID of the newly created lead customer. ```APIDOC POST /v1/trial-offers/lead/create **Description:** Creates a lead customer. **Required Scopes:** TRIAL_OFFER_WRITE **Security:** ApiKeyAuth **Request Body:** application/json (required) - **leadCustomerData** (object, required): Lead customer information. - **firstname** (string, required): First name of the lead customer. Example: "Max" - **secondFirstname** (string, optional): Second first name of the lead customer. Example: "Peter" - **lastname** (string, required): Last name of the lead customer. Example: "Mustermann" - **secondLastname** (string, optional): Second last name of the lead customer. Example: "Meier" - **email** (string, required): Email of the lead customer. Example: "example@email.com" - **gender** (string, optional): Gender of the customer. Enum: MALE, FEMALE, UNISEX. Example: "MALE" - **dateOfBirth** (string, optional, date): Date of birth of the lead customer. Example: "2000-10-10" - **telephone** (string, optional): Telephone number of the lead customer. Example: "5006001112" - **address** (object, optional): Lead customer address information. - **street** (string) - **houseNumber** (string) - **zipCode** (string) - **city** (string) - **trialOfferConfigId** (integer, required): The ID of the trial offer config. Example: 1 **Responses:** - **200 OK:** - Body: application/json - **leadCustomerId** (integer): The ID of the created lead customer. Example: 1001 - **400 Bad Request:** Invalid input data. - **401 Unauthorized:** Authentication failed. - **403 Forbidden:** Insufficient permissions. - **404 Not Found:** Resource not found. - **409 Conflict:** Resource already exists or conflict detected. - **429 Too Many Requests:** Rate limit exceeded. - **500 Internal Server Error:** Server error. ``` ```curl curl -i -X POST \ https://open-api-demo.open-api.magicline.com/v1/trial-offers/lead/create \ -H 'Content-Type: application/json' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' \ -d '{ \ "leadCustomerData": { \ "firstname": "Max", \ "secondFirstname": "Peter", \ "lastname": "Mustermann", \ "secondLastname": "Meier", \ "email": "example@email.com", \ "gender": "MALE", \ "dateOfBirth": "2000-10-10", \ "telephone": "5006001112", \ "address": { \ "street": "Burgring", \ "houseNumber": "23A", \ "zipCode": "13000", \ "city": "Berlin" \ } \ }, \ "trialOfferConfigId": 1 \ }' ``` -------------------------------- ### Rating Mandatory Field Container Styles Source: https://developer.sportalliance.com/apis/magicline/openapi/how-to-get-started Styles for individual containers of mandatory fields within a rating form, ensuring they are displayed correctly. ```css .gzsCyC{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;} /*\!sc*/ data-styled.g284[id="Rating__StyledMandatoryFieldContainer-sc-l0bg02-3"]{content:"gzsCyC,";} ``` -------------------------------- ### Example Request using cURL Source: https://developer.sportalliance.com/apis/magicline/openapi/openapi/trial-offers Demonstrates how to call the 'Validate Class Slot for Trial Offers' API endpoint using cURL, including necessary headers and the request body. ```curl curl -i -X POST \ https://open-api-demo.open-api.magicline.com/v1/trial-offers/classes/booking/validate \ -H 'Content-Type: application/json' \ -H 'X-API-KEY: YOUR_API_KEY_HERE' \ -d '{ "customerId": 203, "classSlotId": 20334 }' ```