### Integration Setup API Request Example Source: https://developers.gympass.com/product/integration-setup-api/1.0/getting-started This example demonstrates how to make a GET request to retrieve webhook information for a specific gym, using the Authorization Bearer Token for authentication. ```APIDOC ## GET /v1/systems/gyms/{gymId}/webhooks ### Description Retrieves webhook information for a specific gym. ### Method GET ### Endpoint /v1/systems/gyms/000000/webhooks ### Parameters #### Header Parameters - **Authorization** (string) - Required - Bearer {{Wellhub Auth Token}} ### Request Example ```curl curl -X GET "{{integration-setup-api-url}}/v1/systems/gyms/000000/webhooks" \ -H "accept: application/json" \ -H "Authorization: Bearer {{Wellhub Auth Token}}" ``` ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Integration Setup API Request Example Source: https://developers.gympass.com/product/integration-setup-api/1.0/getting-started This example demonstrates how to make a GET request to retrieve webhook information for a specific gym. Ensure you replace `{{integration-setup-api-url}}` and `{{Wellhub Auth Token}}` with your actual values. The `Authorization` header must be formatted as `Bearer {{Wellhub Auth Token}}`. ```curl curl -X GET "{{integration-setup-api-url}}/v1/systems/gyms/000000/webhooks" \ -H "accept: application/json" \ -H "Authorization: Bearer {{Wellhub Auth Token}}" ``` -------------------------------- ### Booking Integration Example Source: https://developers.gympass.com/product/booking-api/1.0/getting-started Example of how to authenticate and make a POST request to the Booking API to create a class. ```APIDOC ## POST /booking/v1/gyms/{gymId}/classes ### Description This endpoint allows partners to create classes on the Wellhub platform. Once created, Wellhub synchronizes this information with its applications, and user bookings will automatically update the partner's schedule. ### Method POST ### Endpoint /booking/v1/gyms/{gymId}/classes ### Parameters #### Path Parameters - **gymId** (integer) - Required - The unique identifier of the gym. #### Request Body - **class details** (object) - Required - The details of the class to be created. (Note: Specific fields for class details are not provided in the source text.) ### Request Example ```curl curl --location --request POST '{{booking-api-url}}/booking/v1/gyms/1/classes' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{Wellhub Auth Token}}' \ --data-raw '{ ... }' ``` ### Response #### Success Response (200) - **Confirmation** (object) - Details about the created class. (Note: Specific fields for the success response are not provided in the source text.) #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Access Token Request Source: https://developers.gympass.com/product/partner-app-apis/1.0/user-registration-api Use this example to obtain an access token by sending your Partner API Key. Ensure the Content-Type is set to application/json. ```http GET https:// HEADER X-Api-Key: Content-Type: application/json ``` -------------------------------- ### User Registration Request Example Source: https://developers.gympass.com/product/partner-app-apis/1.0/user-registration-api This example shows a typical request to the User Registration API. Ensure the Content-Type header is set to application/json and the redirect_link is provided in the request body. ```http 2HEADER Content-Type: application/json BODY { "redirect_link": "https:///path/to/signup/form" } ``` -------------------------------- ### Successful Response Example Source: https://developers.gympass.com/product/access-control-api/1.0/endpoints This is an example of a successful response from the API, indicating one total item and zero errors. ```json { "metadata": { "total": 1, "errors": 0 }, "results": {} } ``` -------------------------------- ### Booking Requested Webhook Request Example Source: https://developers.gympass.com/product/booking-api/1.0/webhooks This example demonstrates the structure of an HTTP POST request for a booking-requested event. It includes the necessary headers and a JSON payload with user and slot details. ```bash curl --location --request POST 'localhost:8080/gym-webhook-url/booking/requested' \ --header 'Content-Type: application/json' \ --header 'X-Gympass-Signature: 0XFBDB1D1B18AA6C08324B7D64B71FB76370690E1D' \ --data-raw '{ \ "event_type": "booking-requested", \ "event_data": { \ "user": { \ "unique_token": "123456789012", \ "name": "Firstname Lastname", \ "email": "user@email.com" \ }, \ "slot": { \ "id": 01234567, \ "gym_id": 012345, \ "class_id": 654321, \ "booking_number": "BK_A1B2C3" \ }, \ "timestamp": 1560983373378, \ "event_id": "7e8cbb0f-9681-4d3e-8c36-2b3dd6ecbadb" \ } \ }' ``` -------------------------------- ### List Gym Categories Response Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Example response for the 'Get Gym Categories' endpoint, showing metadata and a list of available categories with their details. ```JSON { "metadata": { "total": 1, "errors": 0 }, "results": [ { "id": 1, "name": "Meditation", "locale": "de" } ] } ``` -------------------------------- ### Check-in Webhook Request Example Source: https://developers.gympass.com/product/access-control-api/1.0/check-in-webhook This example demonstrates the structure of the POST request sent to your registered webhook URL for a check-in event. It includes the necessary headers and the raw JSON data payload. ```bash curl --location --request POST 'https://your-webhook-url-here.com' \ --header 'Content-Type: application/json' \ --header 'X-Gympass-Signature: 0XFBDB1D1B18AA6C08324B7D64B71FB76370690E1D' \ --data-raw ' { \ "event_type": "checkin", \ "event_data": { \ "user": { \ "unique_token": "0123456789012", \ "first_name": "Firstname", \ "last_name": "Lastname", \ "email": "user@email.com", \ "phone_number": "447889123456" \ }, \ "location": { \ "lat": 51.4937541, \ "lon": 0.0633661 \ }, \ "gym": { \ "id": 123456, \ "title":" Name of the Gym", \ "product": { \ "id": 1, \ "description":"Description of product" \ } \ }, \ "timestamp": 1666629613 \ } \ } ' ``` -------------------------------- ### Booking Requested Webhook Response Example Source: https://developers.gympass.com/product/booking-api/1.0/webhooks This is an example of the JSON response received for a booking-requested webhook. It mirrors the structure of the request payload. ```json { "event_type": "booking-requested", "event_data": { "user": { "unique_token": "123456789012", "name": "Firstname Lastname", "email": "user@email.com" }, "slot": { "id": 01234567, "gym_id": 012345, "class_id": 654321, "booking_number": "BK_A1B2C3" }, "timestamp": 1560983373378, "event_id": "7e8cbb0f-9681-4d3e-8c36-2b3dd6ecbadb" } } ``` -------------------------------- ### Check-in Event Webhook Payload Example Source: https://developers.gympass.com/product/access-control-api/1.0/check-in-webhook This is an example of the JSON payload received for a check-in event. It contains user, location, gym, and timestamp information. ```json { "event_type": "checkin", "event_data": { "user": { "unique_token": "0123456789012" }, "location": { "lat": 51.4937541, "lon": 0.06336616 }, "gym": { "id": 123456, "title": " Name of the Gym", "product": { "description": "Test description", "id": 1 } }, "timestamp": 1560983373378 } } ``` -------------------------------- ### Booking Canceled Webhook Request Example Source: https://developers.gympass.com/product/booking-api/1.0/webhooks This example shows the HTTP POST request for a booking-canceled event. It includes the signature header and a JSON payload indicating the cancellation. ```bash curl --location --request POST 'localhost:8080/gym-webhook-url/booking/cancelation' \ --header 'Content-Type: application/json' \ --header 'X-Gympass-Signature: 0XFBDB1D1B18AA6C08324B7D64B71FB76370690E1D' \ --data-raw '{ \ "event_type": "booking-canceled", \ "event_data": { \ "user": { \ "unique_token": "123456789012" \ }, \ "slot": { \ "id": 01234567, \ "gym_id": 012345, \ "class_id": 654321, \ "booking_number": "BK_A1B2C3" \ }, \ "timestamp": 1560983373378, \ "event_id": "7e8cab0f-9981-4d3e-8c36-2b3dd6ecbadb" \ } \ }' ``` -------------------------------- ### Get All Webhooks Source: https://developers.gympass.com/product/integration-setup-api/1.0/endpoints Retrieves a list of all configured webhooks for a specific gym. ```APIDOC ## GET /v1/systems/gyms/{gym-id}/webhooks ### Description Retrieves a list of all configured webhooks for a specific gym. ### Method GET ### Endpoint {{integration-setup-api-url}}/v1/systems/gyms/{gym-id}/webhooks ### Parameters #### Path Parameters - **gym-id** (string) - Required - Provided by Wellhub, it is the unique identifier of the gym. #### Headers - **accept** (string) - Required - application/json - **Authorization** (string) - Required - Bearer {{Wellhub Auth Token}} ### Request Example ```curl curl -X GET "{{integration-setup-api-url}}/v1/systems/gyms/000000/webhooks" \ -H "accept: application/json" \ -H "Authorization: Bearer {{Wellhub Auth Token}}" ``` ### Response #### Success Response (200) - **webhooks** (array) - Description of the webhooks array - **event** (string) - The event associated with the webhook. - **url** (string) - The URL where the webhook events will be sent. - **secret** (string) - The secret used for webhook signature verification. - **additional_data** (boolean) - Indicates if additional data is included in the webhook payload. - **internal_product** (boolean or null) - Indicates if the webhook is for an internal product. #### Response Example ```json { "webhooks": [ { "event": "checkin", "url": "https://www.webhook-url-example.com", "secret": "string", "additional_data": true, "internal_product": true }, { "event": "booking-requested", "url": "https://www.webhook-url-updated.com", "secret": "string", "internal_product": null } ] } ``` ``` -------------------------------- ### Example Webhook Event Payload Source: https://developers.gympass.com/product/booking-api/1.0/webhooks This is an example of the JSON payload structure for a booking-late-canceled webhook event. ```json { "event_type": "booking-late-canceled", "event_data": { "user": { "unique_token": "123456789012" }, "slot": { "id": 01234567, "gym_id": 012345, "class_id": 654321, "booking_number": "BK_A1B2C3" }, "timestamp": 1560983373378, "event_id": "7e8cab0f-9981-4d3e-8c36-2b3dd6ecbadb" } } ``` -------------------------------- ### Create Gym Class - Response Source: https://developers.gympass.com/product/booking-api/1.0/endpoints This is an example of a successful response when creating a gym class. It returns the ID, name, reference, and self-referential link for the newly created class. ```json { "classes": [ { "id": 1, "name": "Cycle", "reference": "111", "links": [ { "rel": "self", "href": "gyms/1/classes/1" } ] } ] } ``` -------------------------------- ### POST Request to Create Classes Source: https://developers.gympass.com/product/booking-api/1.0/getting-started Use this example to make a POST request to create classes via the Booking API. Ensure you include the correct Content-Type and Authorization headers. ```curl curl --location --request POST '{{booking-api-url}}/booking/v1/gyms/1/classes' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{Wellhub Auth Token}}' \ --data-raw '{' ``` -------------------------------- ### User Status API Response Payload Example Source: https://developers.gympass.com/product/partner-app-apis/1.0/user-status-api An example of the response payload returned by the User Status API. It shows a list containing one entry with a partner_plan_id and a user object including a gpw_id. ```json [ { "partner_plan_id": "1", "user": { "gpw_id": "gpw-ec5bcb09-6e4d-46c2-b978-05ad44ca41c0" } } ] ``` -------------------------------- ### Get Gym Products Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Retrieves all products associated with a specific GymID. This is useful for setting up integrations and identifying correct Product IDs. ```json { "gym_id": 012345, "products": [ { "product_id": 987654, "name": "Swimming", "virtual": false, "updated_at": "2022-05-10T14:33:48.819005Z" } ] } ``` -------------------------------- ### Update Class Request Example Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Use this cURL command to update an existing class. Ensure you include the correct Content-Type and Authorization headers, and provide the gym_id and class_id in the URL. ```bash curl --location --request PUT '{{booking-api-url}}/booking/v1/gyms/1/classes/1' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{Wellhub Auth Token}}' \ --data-raw '{ \ "name": "Super Cycle", \ "description": "Our standard cycle classes", \ "notes": "Notes of our standard cycle classes", \ "bookable": true, \ "visible": true, \ "reference": "111", \ "product_id": 1, \ "categories": [1,2] \ }' ``` -------------------------------- ### GET /v1/partner-plans Source: https://developers.gympass.com/product/partner-app-apis/1.0/user-status-api This endpoint allows partners to synchronously check a user's current plan status in real-time. It's useful for verifying user eligibility for plans and services. ```APIDOC ## GET /v1/partner-plans ### Description This endpoint checks if a user is authorized to access the plans associated with a specific partner. It provides real-time access to the current user's plan status. ### Method GET ### Endpoint `https://api.wellness.gympass.com/v1/partner-plans` ### Parameters #### Path Parameters None #### Query Parameters - **gpw-id** (string) - Required - Wellhub Wellness user ID. Example: gpw-ec5bcb09-6e4d-46c2-b978-05ad44ca41c0 - **email** (string) - Optional - User email - **gympass-id** (integer) - Optional - Wellhub user ID *Note: At least one of the query parameters (gpw-id, email, gympass-id) is necessary. gpw-id has the highest precedence.* #### Request Body None ### Request Example ```bash curl --location 'https://api.wellness.gympass.com/v1/partner-plans?gpw-id=gpw-ec5bcb09-6e4d-46c2-b978-05ad44ca41c0' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` ### Headers - **Content-Type**: application/json - **Authorization**: Bearer (This key is shared in the Welcome Email) ### Response #### Success Response (200) - Response body (schema below) - Successful request #### Error Responses - **400**: Request payload has an error - **401**: Unauthorized request, missing or wrong API key - **403**: Forbidden request, partner API key not allowed - **404**: User not activated or user not allowed - **409**: User not supported by this flow, use async (webhooks) instead - **429**: Too many requests - **500**: Unexpected server error ``` -------------------------------- ### Get Class Slot Details Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Retrieves the details for a specific class slot. Requires the gym ID, class ID, and slot ID. ```bash curl --location --request GET '{{booking-api-url}}/booking/gyms/1/classes/1/slots/1' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {{Wellhub Auth Token}}' ``` -------------------------------- ### Get an Access Token Source: https://developers.gympass.com/product/partner-app-apis/1.0/user-registration-api Obtain an access token using an API Key to authorize subsequent requests to the User Registration endpoint. ```APIDOC ## Get an Access Token ### Description This endpoint is used to obtain an `access_token` required for authorizing calls to the Partner's User Registration endpoint. It requires your `X-Api-Key` and `Content-Type` header. ### Method GET ### Endpoint `https://` ### Parameters #### Headers - **Content-Type** (string) - Required - `application/json` - Supported content type - **X-Api-Key** (string) - Required - Example: `arfjJbfh...` - Partner API Key ### Request Example ``` GET https:// Content-Type: application/json X-Api-Key: ``` ### Response #### Success Response (200) - **access_token** (string) - Access Token to be used in the user registration call. Example: `eyJhbGciO...` - **token_type** (string) - Token type. Example: `Bearer` - **expires_at** (Int) - Expired at timestamp in seconds. Example: `1571536335` #### Response Example ```json { "access_token": "eyJhbGciO...", "token_type": "Bearer", "expires_at": 1571536335 } ``` #### Errors - **403 Forbidden**: Missing API key or wrong API key. - **500 Internal Server Error** ``` -------------------------------- ### Get Gym Products Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Displays all products associated with a GymID. A Product determines which gyms a user can access on a Wellhub plan and represents an activity a user can perform. ```APIDOC ## GET /setup/v1/gyms/:gym_id/products ### Description Displays all products associated with a GymID. A Product determines what gyms a user can access on a Wellhub plan. In addition, the product also represents an activity that the user can perform, so it is data that is commonly required to provide on most requests, such as for creating a class. For this purpose, we provide an API that allows you to retrieve all Products that are associated with a GymID, so you can use the correct Product IDs on your integration setup. ### Method GET ### Endpoint `{{booking-api-url}}/setup/v1/gyms/:gym_id/products` ### Parameters #### Path Parameters - **gym_id** (string) - Required - The identifier of the gym at Wellhub. Provided by Wellhub. #### Headers - **Accept** (string) - application/json - **Authorization** (string) - Bearer {{Wellhub Auth Token}} ### Response #### Success Response (200) - **gym_id** (integer) - The identifier of the gym. - **products** (array) - A list of products associated with the gym. - **product_id** (integer) - The identifier of the product. - **name** (string) - The name of the product. - **virtual** (boolean) - Indicates if the product is virtual. - **updated_at** (string) - The timestamp when the product was last updated. ### Response Example ```json { "gym_id": 012345, "products": [ { "product_id": 987654, "name": "Swimming", "virtual": false, "updated_at": "2022-05-10T14:33:48.819005Z" } ] } ``` ``` -------------------------------- ### Validate Access POST Response Source: https://developers.gympass.com/product/access-control-api/1.0/endpoints This is an example of a successful response from the access validation endpoint. It includes metadata about the request and details of the validated user and gym. ```json { "metadata": { "total": 1, "errors": 0 }, "results": { "user": { "gympass_id": "XXXXXXXXXXXXX" }, "gym": { "Id": XXX, "product": { "Id": XXX, "description": "XXXXXXX" } }, "validated_at": "2020-02-19T18:00:53Z" } } ``` -------------------------------- ### Get Class Source: https://developers.gympass.com/product/booking-api/1.0/endpoints GET a specific class resource. This endpoint allows you to retrieve the details of a particular class using its ID. ```APIDOC ## GET /booking/v1/gyms/:gym_id/classes/:class_id ### Description GET a specific class resource. ### Method GET ### Endpoint `/booking/v1/gyms/:gym_id/classes/:class_id` ### Parameters #### Path Parameters - **gym_id** (Int) - Required - It's the identifier of the gym at Wellhub. Provided by Wellhub. - **class_id** (Int) - Required - The identifier of the class resource. #### Query Parameters - **show-deleted** (Boolean) - Optional - Defaults to `false`. Set to `true` to include deleted classes in the results. #### Headers - **Accept** (String) - application/json - **Authorization** (String) - Bearer {{Wellhub Auth Token}} - _If you do not have this token, ask it to Wellhub contact._ ### Response #### Success Response (200) - **id** (Int) - The unique identifier of the class. - **name** (String) - The name of the class. - **slug** (String) - A URL-friendly version of the class name. - **description** (String) - The description of the class. - **notes** (String) - Notes associated with the class. - **bookable** (Boolean) - Indicates if the class is bookable. - **visible** (Boolean) - Indicates if the class is visible on the platform. - **product_id** (Int) - The product identifier for the class. - **gym_id** (Int) - The identifier of the gym the class belongs to. - **reference** (String) - The partner's reference ID for the class. - **created_at** (String) - The timestamp when the class was created. - **categories** (Array of Objects) - Optional. List of categories the class belongs to. - **id** (Int) - The category identifier. - **name** (String) - The category name. - **locale** (String) - The locale of the category name. #### Response Example ```json { "id": 1, "name": "Cycle", "slug": "cycle", "description": "Our standard cycle classes", "notes": "Notes", "bookable": true, "visible": true, "product_id": 1, "gym_id": 123, "reference": "111", "created_at": "2019-07-03T17:44:22Z[UTC]" } ``` ``` -------------------------------- ### Cancel Event Request Example Source: https://developers.gympass.com/product/partner-app-apis/1.0/user-status-api This example demonstrates the JSON payload structure for a user cancellation event notification sent by Wellhub. ```json { "user_id": "gpw-5vs3bf0a-3add-468d-85ff-a358a1befe9a", "plan_id": "0", "event_time": 1560983373378, "event_id": "7e8cbb0f-9681-4d3e-8c36-2b3dd6ecbadb", "event_type": "wellness-user-plan-canceled" } ``` -------------------------------- ### Create Slot Request Example Source: https://developers.gympass.com/product/booking-api/1.0/endpoints This cURL command demonstrates how to create a new slot for a given class. It requires the gym_id and class_id in the URL, along with necessary headers and a JSON payload detailing the slot's occurrence, capacity, and booking window. ```bash curl --location --request POST '{{booking-api-url}}/booking/v1/gyms/1/classes/1/slots' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{Wellhub Auth Token}}' \ --data-raw '{ \ "occur_date": "2019-07-30T10:00:00-05:00", \ "room": "Room 1", \ "status": 1, \ "length_in_minutes": 60, \ "total_capacity": 15, \ "total_booked": 5, \ "product_id": 1, \ "booking_window": { \ "opens_at": "2019-07-01T01:00:00-05:00", \ "closes_at": "2019-07-30T09:00:00-05:00" \ }, \ "instructors": [ \ { \ "name": "Axel", \ "substitute": false \ }, \ { \ "name": "Blaze", \ "substitute": true \ } \ ], \ "cancellable_until": "2019-07-29T20:00:00-05:00", \ "rating": 4.5, \ "virtual": true, \ "virtual_class_url": "http://your_url.com" \ }' ``` -------------------------------- ### Create Gym Class - Request Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Use this endpoint to create a new class in a specific gym. Ensure you provide all required fields such as name, description, bookable status, visibility, and product ID. The reference field can be used for internal linking. ```curl curl --location --request POST '{{booking-api-url}}/booking/v1/gyms/1/classes' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {{Wellhub Auth Token}}' \ --data-raw '{ \ "classes": [ \ { \ "name": "Cycle", \ "description": "Our standard cycle classes", \ "notes": "Notes of our standard cycle classes", \ "bookable": true, \ "visible": true, \ "reference": "111", \ "product_id": 1, \ "categories": [1, 2] \ } \ ] \ }' ``` -------------------------------- ### Create Webhook Subscription Source: https://developers.gympass.com/product/integration-setup-api/1.0/endpoints Sets up and subscribes to webhooks for specific events related to a gym. ```APIDOC ## POST /v1/systems/gyms/:gym-id/webhooks ### Description This endpoint is used to set up and subscribe to the webhooks. It is expected that subscribed webhooks fulfill the minimum requirements corresponding to the system integration type. ### Method POST ### Endpoint {{integration-setup-api-url}}/v1/systems/gyms/:gym-id/webhooks #### Path Parameters - **gym-id** (string) - Required - Provided by Wellhub, it is the unique identifier of the gym. #### Headers - **Content-Type**: application/json - **Authorization**: Bearer {{Wellhub Auth Token}} #### Request Body - **event** (string) - Required - Indicates the webhook event. The options are available on this page. - **url** (string) - Required - URL that Wellhub will use to notify you. - **secret** (string) - Required - Secret that we will use to send a signature header that you can validate when you receive the webhook. - **additional_data** (boolean) - Optional - Indicates if the user's additional data is required to be sent. - **internal_product** (boolean) - Optional - Indicates whether the sent event will contain product information. ### Request Example ```json { "webhooks": [ { "event": "checkin", "url": "https://www.webhook-url-example.com", "secret": "string", "additional_data": true, "internal_product": true }, { "event": "booking-requested", "url": "https://www.webhook-url-example.com", "secret": "string" } ] } ``` ### Response #### Success Response (204 NO CONTENT) No content is returned on success. ``` -------------------------------- ### Get Slot Details Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Retrieves the details of a specific class slot using its unique identifiers. ```APIDOC ## GET /booking/v1/gyms/:gym_id/classes/:class_id/slots/:slot_id ### Description Retrieves the details of a specific class slot. ### Method GET ### Endpoint `/booking/v1/gyms/:gym_id/classes/:class_id/slots/:slot_id` ### Parameters #### Path Parameters - **gym_id** (string) - Required - The identifier of the gym at Wellhub. - **class_id** (string) - Required - The identifier of the class at Wellhub. - **slot_id** (string) - Required - The identifier of the slot at Wellhub. #### Headers - **Accept** (string) - Optional - `application/json` - **Authorization** (string) - Required - Bearer {{Wellhub Auth Token}} ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the slot. - **class_id** (integer) - The identifier of the class. - **occur_date** (string) - The date and time the slot occurs. - **status** (integer) - The status of the slot. - **room** (string) - The room where the class is held. - **length_in_minutes** (integer) - The duration of the class in minutes. - **total_capacity** (integer) - The total capacity of the slot. - **total_booked** (integer) - The number of slots already booked. - **product_id** (integer) - The identifier of the product associated with the slot. - **booking_window** (object) - The booking window for the slot. - **opens_at** (string) - The time the booking window opens. - **closes_at** (string) - The time the booking window closes. - **cancellable_until** (string) - The time until which the slot can be cancelled. - **instructors** (array) - A list of instructors for the class. - **name** (string) - The name of the instructor. - **substitute** (boolean) - Indicates if the instructor is a substitute. - **rating** (number) - The rating of the class. - **virtual** (boolean) - Indicates if the class is virtual. - **virtual_class_url** (string) - The URL for the virtual class. ### Response Example ```json { "id": 1, "class_id": 1, "occur_date": "2019-07-09T10:00:00-03:00", "status": 1, "room": "Room 1", "length_in_minutes": 60, "total_capacity": 15, "total_booked": 5, "product_id": 1, "booking_window": { "opens_at": "2019-07-08T00:00:00-03:00", "closes_at": "2019-07-09T09:00:00-03:00" }, "cancellable_until": "2019-07-09T09:08:00-03:00", "instructors": [ { "name": "Axel", "substitute": false }, { "name": "Blaze", "substitute": true } ], "rating": 4.5, "virtual": true, "virtual_class_url": "http://your_url.com" } ``` ``` -------------------------------- ### Get Webhook by Event Source: https://developers.gympass.com/product/integration-setup-api/1.0/endpoints Retrieves a specific webhook based on the associated webhook event for a given gym. ```APIDOC ## GET /v1/systems/gyms/{gym-id}/webhooks/{webhook-event} ### Description Retrieves a specific webhook based on the associated webhook event for a given gym. ### Method GET ### Endpoint {{integration-setup-api-url}}/v1/systems/gyms/{gym-id}/webhooks/{webhook-event} ### Parameters #### Path Parameters - **gym-id** (string) - Required - Provided by Wellhub, it is the unique identifier of the gym. - **webhook-event** (string) - Required - Indicates the event of the webhook. The options are available on this page. #### Headers - **accept** (string) - Required - application/json - **Authorization** (string) - Required - Bearer {{Wellhub Auth Token}} ### Request Example ```curl curl -X GET "{{integration-setup-api-url}}/v1/systems/gyms/000000/webhooks/checkin" \ -H "accept: application/json" \ -H "Authorization: Bearer {{Wellhub Auth Token}}" ``` ### Response #### Success Response (200) - **webhook** (object) - Description of the webhook object - **event** (string) - The event associated with the webhook. - **url** (string) - The URL where the webhook events will be sent. - **secret** (string) - The secret used for webhook signature verification. - **additional_data** (boolean) - Indicates if additional data is included in the webhook payload. - **internal_product** (boolean or null) - Indicates if the webhook is for an internal product. #### Response Example ```json { "webhook": { "event": "checkin", "url": "https://www.webhook-url-example.com", "secret": "string", "additional_data": true, "internal_product": true } } ``` ``` -------------------------------- ### List Gym Classes - Response Source: https://developers.gympass.com/product/booking-api/1.0/endpoints This response provides a list of classes for a given gym, including details like ID, name, description, booking status, and creation timestamp. Some classes may also include associated categories. ```json { "classes": [ { "id": 1, "name": "Cycle", "slug": "cycle", "description": "Our standard cycle classes", "notes": "Notes", "bookable": true, "visible": true, "product_id": 1, "gym_id": 123, "reference": "111", "created_at": "2019-07-03T17:44:22Z[UTC]" }, { "id": 2, "name": "Super Cycle", "slug": "super-cycle", "description": "Our super advanced cycle class", "notes": "Notes", "bookable": true, "visible": true, "product_id": 1, "gym_id": 123, "reference": "111", "created_at": "2019-07-03T17:44:22Z[UTC]", "categories": [ { "id": 1, "name": "Meditation", "locale": "de" } ] } ] } ``` -------------------------------- ### List Classes Source: https://developers.gympass.com/product/booking-api/1.0/endpoints GET a list of classes in a given gym. This endpoint retrieves all classes associated with a specific gym. ```APIDOC ## GET /booking/v1/gyms/:gym_id/classes ### Description GET a list of classes in a given gym. ### Method GET ### Endpoint `/booking/v1/gyms/:gym_id/classes` ### Parameters #### Path Parameters - **gym_id** (Int) - Required - The identifier of the gym at Wellhub. Provided by Wellhub. #### Headers - **Accept** (String) - application/json - **Authorization** (String) - Bearer {{Wellhub Auth Token}} - _If you do not have this token, ask it to Wellhub contact._ ### Response #### Success Response (200) - **classes** (Array of Objects) - A list of classes available in the gym. - **id** (Int) - The unique identifier of the class. - **name** (String) - The name of the class. - **slug** (String) - A URL-friendly version of the class name. - **description** (String) - The description of the class. - **notes** (String) - Notes associated with the class. - **bookable** (Boolean) - Indicates if the class is bookable. - **visible** (Boolean) - Indicates if the class is visible on the platform. - **product_id** (Int) - The product identifier for the class. - **gym_id** (Int) - The identifier of the gym the class belongs to. - **reference** (String) - The partner's reference ID for the class. - **created_at** (String) - The timestamp when the class was created. - **categories** (Array of Objects) - Optional. List of categories the class belongs to. - **id** (Int) - The category identifier. - **name** (String) - The category name. - **locale** (String) - The locale of the category name. #### Response Example ```json { "classes": [ { "id": 1, "name": "Cycle", "slug": "cycle", "description": "Our standard cycle classes", "notes": "Notes", "bookable": true, "visible": true, "product_id": 1, "gym_id": 123, "reference": "111", "created_at": "2019-07-03T17:44:22Z[UTC]" }, { "id": 2, "name": "Super Cycle", "slug": "super-cycle", "description": "Our super advanced cycle class", "notes": "Notes", "bookable": true, "visible": true, "product_id": 1, "gym_id": 123, "reference": "111", "created_at": "2019-07-03T17:44:22Z[UTC]", "categories": [ { "id": 1, "name": "Meditation", "locale": "de" } ] } ] } ``` ``` -------------------------------- ### Subscribe to System Integration Requested Webhook Source: https://developers.gympass.com/product/integration-setup-api/1.0/system-integration-requested-webhook To receive the System Integration Requested webhook, you must register your webhook endpoint using the provided API. This ensures that your system is notified when a partner selects it for integration. ```APIDOC ## POST /v1/systems/gyms/notification-webhook ### Description Registers a webhook endpoint to receive the System Integration Requested event. ### Method POST ### Endpoint {{integration-setup-api-url}}/v1/systems/gyms/notification-webhook ### Headers - **Content-Type** (string) - Required - application/json - **Authorization** (string) - Required - Bearer {{Wellhub Auth Token}} ### Request Body - **type** (String) - Required - Indicates the webhook event. Must be SYSTEM_INTEGRATION_REQUESTED. - **URL** (String) - Required - The URL that Wellhub will use to notify you. - **secret** (String) - Required - A secret used to send a signature header for validation. ### Request Example ```curl curl -X POST "{{integration-setup-api-url}}/v1/systems/gyms/notification-webhook" \ -H "Authorization: Bearer {{Wellhub Auth Token}}" \ -H "Content-Type: application/json" \ -d '{ \ "type": "SYSTEM_INTEGRATION_REQUESTED", \ "url": "https://www.webhook-url-example.com", \ "secret": "secret" \ }' ``` ### Response #### Success Response (204) - NO CONTENT ``` -------------------------------- ### Health Check GET Request Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Use this endpoint to verify the health status of the Booking API. Requires an Authorization header. ```curl curl --location --request GET '{{booking-api-url}}/booking/v1/health' \ --header 'Authorization: Bearer {{Wellhub Auth Token}}' ``` -------------------------------- ### Get Access Token Response Source: https://developers.gympass.com/product/partner-app-apis/1.0/user-registration-api A successful response will contain the access_token, token_type, and expires_at timestamp. The access_token is Bearer token. ```json { "access_token": "eyJhbGciO...", "token_type": "Bearer", "expires_at": 1571536335 } ``` -------------------------------- ### List Class Slots by Time Range Source: https://developers.gympass.com/product/booking-api/1.0/endpoints Retrieves a list of class slots for a given class within a specified time range. If no time range is provided, it defaults to all slots on the current day. Requires gym ID and class ID. Time parameters 'from' and 'to' should be in the gym's local timezone. ```bash curl --location --request GET '{{booking-api-url}}/booking/v1/gyms/:gym_id/classes/:class_id/slots?from=2019-09-09T00:00:00%2B03:00&to=2019-09-09T23:59:59%2B03:00' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {{Wellhub Auth Token}}' ``` -------------------------------- ### Create Custom Code (POST) Source: https://developers.gympass.com/product/access-control-api/1.0/endpoints Use this endpoint to create a new custom check-in code for a user at a specific gym. Ensure the custom code is valid and meets the length requirements. ```json { "metadata": { "total": 1, "errors": 0 }, "results": {} } ``` ```json {"metadata":{"total":0,"errors":1},"errors":[{"message":"length must be between 1 and 13 characters","key":"custom_code"}]} ``` ```json {"metadata":{"total":0,"errors":1},"errors":[{"message":"Already exists a custom code for that gym and user","key":"checkin.custom-code.already-exists"}]} ``` ```json {"metadata": { "total": 0, "errors": 1},"errors": [ { "Message": "User is not authorized to access this resource with an explicit deny" }]} ``` ```json {"metadata":{"total":0,"errors":1},"errors":[{"message":"There was an unexpected internal server error","key":"checkin.custom-code.unexpected-error"}]} ``` -------------------------------- ### Get Access Token Errors Source: https://developers.gympass.com/product/partner-app-apis/1.0/user-registration-api Handles potential errors during the access token request, such as invalid API keys or server issues. ```http 403 Forbidden. Missing API key or wrong API key 500 Internal Server Error ```