### Retrieve Listings (Node.js) Source: https://open-api-docs.guesty.com/reference/listings This Node.js example shows how to make a GET request to the Guesty /listings API endpoint. It uses the 'axios' library to handle the HTTP request and includes common parameters for filtering and pagination. Ensure 'axios' is installed (`npm install axios`). ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://open-api.guesty.com/v1/listings', params: { active: 'true', pmsActive: 'true', listed: 'true', available: '', ignoreFlexibleBlocks: 'false', sort: 'title', limit: '25', skip: '0' }, headers: { accept: 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### Get All Rate Plans Request (cURL) Source: https://open-api-docs.guesty.com/reference/open-api-rate-plan-crud-v1 Example cURL request to retrieve all rate plans. It demonstrates the GET method, endpoint URL with query parameters for pagination, and the expected accept header. ```shell curl --request GET \ --url 'https://open-api.guesty.com/v1/rm-rate-plans-ext/rate-plans?skip=0&limit=25' \ --header 'accept: application/json' ``` -------------------------------- ### Get Property Logs using PHP Source: https://open-api-docs.guesty.com/reference/properties-logs Demonstrates fetching property logs in PHP using cURL. This snippet shows the setup for a cURL request, including the URL, headers, and execution. It's a practical example for PHP developers interacting with the API. ```php = 200 && $http_code < 300) { return json_decode($response, true); } else { // Handle error, maybe return null or throw an exception error_log("Error fetching property logs: HTTP Code " . $http_code . " - Response: " . $response); return null; } } // Example usage: // $logs = get_property_logs('your_property_id'); // print_r($logs); ?> ``` -------------------------------- ### List Integrations - Node.js Source: https://open-api-docs.guesty.com/reference/integrations Node.js example to fetch all account integrations from the Guesty API. Uses the 'axios' library for making HTTP requests. Ensure 'axios' is installed (`npm install axios`). ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://open-api.guesty.com/v1/integrations', headers: { 'accept': 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### Get Supported Amenities using Node.js Source: https://open-api-docs.guesty.com/reference/amenities This Node.js snippet shows how to fetch a list of all supported amenities from the Guesty API. It utilizes the 'node-fetch' library to make an asynchronous GET request and handle the JSON response. Ensure 'node-fetch' is installed. ```JavaScript const fetch = require('node-fetch'); const options = { method: 'GET', headers: { 'accept': 'application/json' } }; fetch('https://open-api.guesty.com/v1/properties-api/amenities/supported', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### List Integrations - PHP Source: https://open-api-docs.guesty.com/reference/integrations PHP code for fetching all account integrations using cURL. This example sets up the request headers and executes the GET request to the Guesty API. ```php ``` -------------------------------- ### GET Property Languages - cURL and JSON Example Source: https://open-api-docs.guesty.com/reference/getpropertylanguages Demonstrates retrieving the list of supported languages for a specific listing using the GET /marketing/languages/{id} endpoint. Uses Bearer (bearerAuth) for authorization. The cURL shows the request, and the JSON block shows the OpenAPI definition containing the response schema and example. ```bash curl -X GET "https://open-api.guesty.com/v1/marketing/languages/{id}" \ -H "Accept: application/json" ``` ```json { "openapi": "3.0.3", "info": { "title": "GUESTY OPEN API", "description": "Guesty Open API documentation", "version": "1" }, "servers": [ { "url": "https://open-api.guesty.com/v1" } ], "security": [ { "bearerAuth": [] } ], "paths": { "/marketing/languages/{id}": { "get": { "operationId": "getPropertyLanguages", "summary": "[Beta] Retrieve a list of supported languages for specific listing", "description": "Retrieve a list of supported languages for specific listing by listing id", "tags": [ "Marketing fields" ], "parameters": [ { "name": "id", "required": true, "in": "path", "description": "The listing ID whose languages you wish to retrieve or upsert", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Return a list of languages", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "slug": { "type": "string" }, "active": { "type": "boolean" } }, "example": { "name": "German - Germany", "slug": "de_de", "active": true } }, "example": [ { "name": "English - United States", "slug": "en_us", "active": true }, { "name": "German - Germany", "slug": "de_de", "active": true }, { "name": "Italian - Italy", "slug": "it_it", "active": false }, { "name": "Portuguese - Portugal", "slug": "pt_pt", "active": false }, { "name": "Polish - Poland", "slug": "pl_pl", "active": false }, { "name": "Spanish - Spain", "slug": "es_es", "active": false }, { "name": "Japanese - Japan", "slug": "ja_jp", "active": false }, { "name": "Greek - Greece", "slug": "el_gr", "active": false }, { "name": "Korean - Korea", "slug": "ko_kr", "active": false }, { "name": "Romanian - Romania", "slug": "ro_ro", "active": false }, { "name": "Indonesian - Indonesia", "slug": "in_in", "active": false }, { "name": "French - France", "slug": "fr_fr", "active": false }, { "name": "Chinese - China", "slug": "zh_chs", "active": false }, { "name": "Dutch - Netherlands", "slug": "nl_nl", "active": false } ] } } } }, "403": { "description": "Unauthorized Request.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "object", "properties": { "code": { "type": "string", "example": "UNAUTHORIZED" }, "message": { "type": "string", "example": "Unauthorized" } } } } } } } } } } } } } ``` -------------------------------- ### Example API Endpoint Documentation Source: https://open-api-docs.guesty.com/reference/get_hooks-hookid This section provides a detailed example of how an API endpoint might be documented, showcasing request and response structures. ```APIDOC ## POST /api/hooks ### Description This endpoint allows the creation of new hooks within the system, enabling automated actions based on specific triggers. ### Method POST ### Endpoint /api/hooks #### Request Body - **accountId** (string) - Required - The ID of the account to associate the hook with. - **listingIds** (array[string]) - Optional - A list of listing IDs to apply the hook to. - **excludeListingIds** (array[string]) - Optional - A list of listing IDs to exclude the hook from. - **enabled** (boolean) - Required - Whether the hook is currently enabled. - **filters** (array) - Optional - Filters to apply to the hook. - **action** (string) - Required - The action to perform when the trigger occurs (e.g., "send sms"). - **target** (string) - Required - The target of the action (e.g., "user"). - **when** (integer) - Required - When the action should occur, represented as a timestamp or code. - **useNoReply** (boolean) - Optional - Whether to use a no-reply number for SMS actions. - **trigger** (string) - Required - The event that triggers the hook (e.g., "reservation confirmed"). - **humanRepresentation** (string) - Optional - A human-readable description of the hook. - **name** (string) - Required - The name of the hook. - **to** (object) - Required - Details about the recipient of the action. - **userId** (string) - Required - The ID of the user to send the action to. - **sms** (object) - Optional - SMS specific details. - **body** (string) - Required - The body of the SMS message. ### Request Example ```json { "accountId": "5fb67280e39677002e6c2683", "listingIds": [ "5d14d253765308001fcb596c" ], "excludeListingIds": [], "enabled": true, "filters": [], "action": "send sms", "target": "user", "when": 0, "useNoReply": false, "trigger": "reservation confirmed", "humanRepresentation": "Send sms to 1a1a 1a1a on booking confirmation", "name": "Confirmation Hook 1", "to": { "userId": "5d48a21cdda60600237e0647" }, "sms": { "body": "Hi! Will be a pleasure to host you!" } } ``` ### Response #### Success Response (200) - **_id** (string) - The unique identifier of the created hook. - **accountId** (string) - The ID of the account. - **listingIds** (array[string]) - List of listing IDs. - **excludeListingIds** (array[string]) - List of excluded listing IDs. - **enabled** (boolean) - Hook status. - **filters** (array) - Applied filters. - **action** (string) - Action performed by the hook. - **target** (string) - Target of the action. - **when** (integer) - Timestamp or code for when the action occurs. - **useNoReply** (boolean) - Whether a no-reply number was used. - **createdAt** (string) - Timestamp of creation. - **updatedAt** (string) - Timestamp of last update. - **trigger** (string) - Event that triggers the hook. - **humanRepresentation** (string) - Human-readable hook description. - **name** (string) - Name of the hook. - **to** (object) - Recipient details. - **userId** (string) - User ID of the recipient. - **sms** (object) - SMS details. - **body** (string) - SMS message body. #### Response Example ```json { "_id": "616442ca8eb305002d901545", "accountId": "5fb67280e39677002e6c2683", "listingIds": [ "5d14d253765308001fcb596c" ], "excludeListingIds": [], "enabled": true, "filters": [], "action": "send sms", "target": "user", "when": 0, "useNoReply": false, "createdAt": "2021-10-11T13:57:30.241Z", "updatedAt": "2021-10-11T13:57:30.247Z", "trigger": "reservation confirmed", "humanRepresentation": "Send sms to 1a1a 1a1a on booking confirmation", "name": "Confirmation Hook 1", "to": { "userId": "5d48a21cdda60600237e0647" }, "sms": { "body": "Hi! Will be a pleasure to host you!" } } ``` ``` -------------------------------- ### Get Property Logs using Node.js Source: https://open-api-docs.guesty.com/reference/properties-logs Provides a Node.js code example for fetching property logs. It utilizes the 'axios' library to make the GET request and demonstrates how to configure parameters. This snippet is useful for integrating the API into Node.js applications. ```javascript const axios = require('axios'); const getPropertyLogs = async (propertyId, limit = 20, skip = 0) => { try { const response = await axios.get('https://open-api.guesty.com/v1/property-logs/' + propertyId, { params: { limit: limit, skip: skip }, headers: { 'accept': 'application/json' } }); return response.data; } catch (error) { console.error('Error fetching property logs:', error); throw error; } }; // Example usage: // getPropertyLogs('your_property_id').then(logs => console.log(logs)); ``` -------------------------------- ### Get All Rate Plans - PHP Source: https://open-api-docs.guesty.com/reference/open-api-rate-plan-crud-v1 PHP code snippet using cURL to fetch rate plans from the Guesty API. This example sets up the cURL request to include the correct URL, parameters, and headers for a successful retrieval. ```php ``` -------------------------------- ### Deprecated API Example for HomeAway Integrations Source: https://open-api-docs.guesty.com/reference/put_integrations-id This snippet shows an example of a deprecated API response related to HomeAway integrations. It illustrates the structure of a deprecated endpoint's example response. ```json { "example": "API is deprecated for HomeAway integrations" } ``` -------------------------------- ### Get Property Logs using Ruby Source: https://open-api-docs.guesty.com/reference/properties-logs Illustrates how to retrieve property logs in Ruby using the 'Net::HTTP' library. This example shows how to construct the request, set headers, and handle the response, making it suitable for Ruby-based projects. ```ruby require 'net/http' require 'uri' def get_property_logs(property_id, limit = 20, skip = 0) uri = URI.parse("https://open-api.guesty.com/v1/property-logs/#{property_id}?limit=#{limit}&skip=#{skip}") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Get.new(uri.request_uri) request['accept'] = 'application/json' response = http.request(request) return JSON.parse(response.body) if response.is_a?(Net::HTTPSuccess) nil end # Example usage: # logs = get_property_logs('your_property_id') # puts logs.inspect ``` -------------------------------- ### Make a GET Request - cURL Source: https://open-api-docs.guesty.com/reference/reservations This snippet demonstrates how to make a GET request to the Guesty API using cURL. It includes setting the request URL and header. This is a basic example to retrieve reservations from the API. ```cURL curl --request GET \ --url https://open-api.guesty.com/v1/reservations \ --header 'accept: application/json' ``` -------------------------------- ### GET /properties-api/amenities/supported Source: https://open-api-docs.guesty.com/reference/getsupportedamenities Retrieves a list of all supported amenities, including their names, groups and channels. This endpoint is useful for displaying available amenity options during property setup or editing. ```APIDOC ## GET /properties-api/amenities/supported ### Description Retrieves a list of all supported amenities, including their names, groups and channels. ### Method GET ### Endpoint /properties-api/amenities/supported ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example { "example": "N/A" } ### Response #### Success Response (200) - **name** (string) - The name of the amenity - **group** (string) - The name of the amenity group that it belongs to - **channels** (object) - An object containing channels as keys and their respective values for the amenity. #### Response Example { "example": [ { "name": "Elevator", "group": "Accessibility", "channels": { "airbnb2": "elevator", "bookingCom": "5132", "homeaway2": "AMENITIES_ELEVATOR", "rentalsUnited": "689", "tripAdvisor": "ELEVATOR_IN_BUILDING" } }, { "name": "Gym", "group": "Wellness", "channels": { "airbnb2": "gym" } } ] } #### Error Response (403) - **error** (object) - **code** (string) - Error code, e.g., "UNAUTHORIZED" - **message** (string) - Error message, e.g., "Unauthorized" ``` -------------------------------- ### Retrieve All Rate Strategies with cURL Source: https://open-api-docs.guesty.com/reference/ratestrategyopenapi Make a GET request to retrieve rate strategies from Guesty API using cURL. This example shows basic usage with required headers. No authentication credentials are included in the example. ```shell curl --request GET \ --url https://open-api.guesty.com/v1/rm-rate-strategies-open-api/rate-strategies \ --header 'accept: application/json' ``` -------------------------------- ### Guesty API Example Task: Post Stay Clean Source: https://open-api-docs.guesty.com/reference/post_tasks-open-api-create-single-task Illustrates a 'Post Stay Clean' task, a typical cleaning task between guest stays. It showcases the use of assignee groups, checklists, attachments, and specific scheduling times (fixed start time with duration). ```json { "title": "Post Stay Clean", "description": "A regular clean between guest stays.", "priority": 2, "type": "cleaning", "assigneeGroup": [ "Cleaners A", "Cleaners B" ], "assigneeId": "69gvymvx55zwf5nn2ubng97cm", "supervisorId": "eg2x3iyeqnttngcn4mhzrzawr", "checklist": [ "Clean floors", "Clean bathroom with bleach.", "Change the linen" ], "attachments": [ { "title": "Clean Room 7", "url": "attachment.png", "mimetyoe": "image/png", "size": 4401630, "client": "cbt" } ], "startTime": "2021-05-10T11:30:00-04:00", "plannedDuration": 2, "canStartAfter": "2021-05-10T11:30:00-04:00", "mustFinishBefore": "2021-05-10T14:00:00-04:00", "listingId": "5803ca18e48f450300c76173", "reservationId": "5803ca18e48f450300c76173", "comments": [ { "text": "This is a cool comment", "attachments": [] } ] } ``` -------------------------------- ### Get hooks via cURL Source: https://open-api-docs.guesty.com/reference/hooks Example cURL command to fetch webhook subscriptions from Guesty API. Requires authentication headers and accepts query parameters for pagination/filtering. ```shell curl --request GET \ --url https://open-api.guesty.com/v1/hooks \ --header 'accept: application/json' ``` -------------------------------- ### Retrieve Listings (Python) Source: https://open-api-docs.guesty.com/reference/listings This Python script demonstrates fetching listings from the Guesty API using the 'requests' library. It constructs the URL with query parameters for filtering and pagination. Ensure the 'requests' library is installed (`pip install requests`). ```python import requests url = "https://open-api.guesty.com/v1/listings" params = { "active": "true", "pmsActive": "true", "listed": "true", "available": "", "ignoreFlexibleBlocks": "false", "sort": "title", "limit": "25", "skip": "0" } headers = { "accept": "application/json" } response = requests.get(url, params=params, headers=headers) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}") print(response.text) ``` -------------------------------- ### Define partner data schema examples in JSON Source: https://open-api-docs.guesty.com/reference/guestsopenapicontroller_createguest Provides JSON examples for partner objects (airbnb2, rentalsUnited, bookingCom, homeAway, tripAdvisor) along with policy and returningGuest definitions. These examples are used in the OpenAPI specification to illustrate expected request payloads. No external dependencies; the schema part of the API definition. ```JSON { "airbnb2": { "type": "object", "example": { "index": "index", "id": 4246064595217, "url": "https://www.airbnb.com", "firstName": "Rick" } }, "rentalsUnited": { "type": "object", "example": { "firstName": "Rick", "lastName": "Sanchez", "fullName": "Rick Sanchez", "failedPaymentMethod": "failed payment method" } }, "bookingCom": { "type": "object", "example": { "firstName": "Rick", "lastName": "Sanchez", "fullName": "Rick Sanchez", "url": "https://www.booking.com" } }, "homeAway": { "type": "object", "example": { "title": "title", "firstName": "Rick", "lastName": "Sanchez", "fullName": "Rick Sanchez", "url": "https://www.homeaway.com" } }, "tripAdvisor": { "type": "object", "example": { "title": "title", "first": "Rick", "lastName": "Sanchez", "fullName": "Rick Sanchez", "proxyEmail": "proxyemail@email.com", "url": "https://www.tripadvisor.com" } }, "policy": { "type": "object", "example": { "marketing": { "isAccepted": false, "dateOfAcceptance": null }, "privacyObject": { "isAccepted": false, "dateOfAcceptance": null, "versionNumber": "ffewfewgw" } } }, "returningGuest": { "type": "boolean" } } ``` -------------------------------- ### Retrieve Owner Reservations (cURL) Source: https://open-api-docs.guesty.com/reference/owners-reservations Example of how to retrieve a list of owner reservations using cURL. This request fetches reservation data, starting from the first entry (skip=0), and requires an 'accept: application/json' header. ```Shell curl --request GET \ --url 'https://open-api.guesty.com/v1/owners-reservations?skip=0' \ --header 'accept: application/json' ``` -------------------------------- ### Example JSON Payload for Listing Calendar Data Source: https://open-api-docs.guesty.com/reference/get_availability-pricing-api-calendar-listings-minified-listingid Provides an example of the JSON payload representing calendar data for a specific listing. This includes details like listing ID, date range, currency, and a subset of calendar entries with pricing and blocking information. ```json { "days": { "listingId": "687510715f4958000edfd6ba", "startDate": "2025-08-29", "endDate": "2025-09-10", "currency": "USD", "calendar": [ { "date": "2025-08-29", "price": 11, "minNights": 1, "blocks": { "m": true } } ] } } ``` -------------------------------- ### Get Property Logs using Python Source: https://open-api-docs.guesty.com/reference/properties-logs Presents a Python example for retrieving property logs using the 'requests' library. This code snippet shows how to build the request, including URL and headers, and process the JSON response. It's ideal for Python integrations. ```python import requests def get_property_logs(property_id, limit=20, skip=0): url = f"https://open-api.guesty.com/v1/property-logs/{property_id}" params = { 'limit': limit, 'skip': skip } headers = { 'accept': 'application/json' } try: response = requests.get(url, params=params, headers=headers) response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx) return response.json() except requests.exceptions.RequestException as e: print(f"Error fetching property logs: {e}") return None # Example usage: # logs = get_property_logs('your_property_id') # if logs: # print(logs) ``` -------------------------------- ### Fetch Complexes List - cURL Source: https://open-api-docs.guesty.com/reference/complexes This Shell script uses cURL to perform a GET request to retrieve a list of all complexes from the Guesty API. It sets the 'accept' header to application/json. Authorization headers may be required but are not included in this example. The command outputs the JSON response on success. ```shell curl --request GET \ --url https://open-api.guesty.com/v1/properties-api/complexes \ --header 'accept: application/json' ``` -------------------------------- ### Get Supported Amenities using cURL Source: https://open-api-docs.guesty.com/reference/amenities This snippet demonstrates how to make a GET request to the Guesty API to retrieve a list of all supported amenities using cURL. It includes the necessary URL and headers for the request. The response is expected in JSON format. ```Shell curl --request GET \ --url https://open-api.guesty.com/v1/properties-api/amenities/supported \ --header 'accept: application/json' ``` -------------------------------- ### GET /websites/open-api-docs_guesty_reference Source: https://open-api-docs.guesty.com/reference/get_views This endpoint appears to be a placeholder or an example structure within a larger OpenAPI definition. It doesn't represent a functional API call for retrieving data. ```APIDOC ## GET /websites/open-api-docs_guesty_reference ### Description This section outlines the structure of an OpenAPI definition, including components for security schemes and request/response bodies for various potential API endpoints. It does not represent a directly callable API endpoint. ### Method GET ### Endpoint /websites/open-api-docs_guesty_reference ### Parameters No parameters are defined for this conceptual endpoint. ### Request Example ```json {} ``` ### Response #### Success Response (200) This is a conceptual documentation structure and does not return a typical API response. #### Response Example ```json { "openapi": "3.0.0", "info": { "title": "Guesty API", "version": "1.0.0" }, "servers": [ { "url": "https://api.guesty.com/v1" } ], "paths": {}, "components": { "securitySchemes": { "bearerAuth": { "type": "apiKey", "name": "authorization", "in": "header" } } } } ``` ``` -------------------------------- ### GET /v1/rm-rate-plans-ext/rate-plans Source: https://open-api-docs.guesty.com/reference/open-api-rate-plan-crud-v1 Retrieves all rate plans by channel. This API is currently in pilot, allowing the creation and management of independent rate plans. ```APIDOC ## GET /v1/rm-rate-plans-ext/rate-plans ### Description Retrieves all rate plans by channel. ### Method GET ### Endpoint /v1/rm-rate-plans-ext/rate-plans ### Parameters #### Query Parameters - **skip** (number) - Required - Defaults to 0. The number of items to skip before starting to collect the result set. - **limit** (number) - Required - Defaults to 25. The numbers of items to return. - **sort** (string) - Required - The field by which to sort the items returned. - **channelId** (json) - Required - The channel to which the rate plans apply. ### Request Example ```bash curl --request GET \ --url 'https://open-api.guesty.com/v1/rm-rate-plans-ext/rate-plans?skip=0&limit=25' \ --header 'accept: application/json' ``` ### Response #### Success Response (200) - **requestId** (string) - required - **ratePlans** (array of objects) - required - **ratePlans** (object) - **_id** (string) - required - **id** (string) - **accountId** (string) - required - **type** (string) - required - enum: `independent` - **name** (string) - required - **description** (string) - **cancellationPolicy** (string | null) - enum: `strict`, `strict_60`, `strict_90`, `super_strict`, `moderate`, `semi_moderate`, `semi_flexible`, `firm`, `flex`, `free` - **cancellationFee** (string | null) - enum: `FIRST_NIGHT`, `50%_TOTAL_PRICE`, `TOTAL_PRICE`, `100`, `50`, `0` - **mealPlans** (array of numbers) - **availabilityRules** (object) - **pricingModel** (string) - required - enum - **channelSync** (array of strings) - **active** (boolean) - required - **createdAt** (date-time) - required - **updatedAt** (date-time) - required - **count** (number) - required - **limit** (number) - required - **skip** (number) - required #### Response Example ```json { "example": "response body" } ``` #### Error Responses - **401** (Client unauthorized) - **403** (Access is forbidden for this client) - **500** (Internal server error) ``` -------------------------------- ### List Integrations - Ruby Source: https://open-api-docs.guesty.com/reference/integrations Ruby code snippet to fetch all integrations using the 'net/http' library. This example shows how to construct the request and handle the response. ```ruby require 'uri' require 'net/http' uri = URI.parse('https://open-api.guesty.com/v1/integrations') request = Net::HTTP::Get.new(uri) request['accept'] = 'application/json' response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| http.request(request) end puts response.body ``` -------------------------------- ### Get Imported Calendar by ID (Node.js) Source: https://open-api-docs.guesty.com/reference/calendar-sync-ical-import Provides a Node.js example using the 'node-fetch' library to get an imported calendar by its ID. It sends a GET request to the Guesty API, specifying the required URL and headers. ```javascript import fetch from 'node-fetch'; const options = { method: 'GET', headers: { 'accept': 'application/json' } }; fetch('https://open-api.guesty.com/v1/icalendar-api/imported-calendars/importedCalendarId', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); ``` -------------------------------- ### Rate Plan Details Source: https://open-api-docs.guesty.com/reference/rateplancontroller_initunassignlistings Retrieves details about rate plans, including pricing models, channel synchronization, and activation status. ```APIDOC ## GET /rate-plans ### Description Retrieves a list of rate plans associated with an account. This endpoint provides detailed information about each rate plan, including its ID, associated account ID, type, name, pricing model, channel synchronization settings, active status, and creation/update timestamps. ### Method GET ### Endpoint /rate-plans ### Query Parameters - **accountId** (string) - Required - The ID of the account to retrieve rate plans for. ### Response #### Success Response (200) - **ratePlan** (object) - An array of rate plan objects, each containing: - **_id** (string) - Unique identifier for the rate plan. - **accountId** (string) - The ID of the account this rate plan belongs to. - **type** (string) - The type of rate plan (e.g., 'standard', 'seasonal'). - **name** (string) - The name of the rate plan. - **restrictedDates** (array of strings) - Dates when this rate plan is restricted. - **pricingModel** (string) - The pricing model used (e.g., 'nightly_rate'). - **channelSync** (array of strings) - Channels this rate plan is synchronized with (e.g., 'bookingCom', 'manual_reservations'). - **active** (boolean) - Indicates if the rate plan is currently active. - **createdAt** (string) - The date and time the rate plan was created (ISO 8601 format). - **updatedAt** (string) - The date and time the rate plan was last updated (ISO 8601 format). - **requestId** (string) - A unique identifier for the request. #### Response Example ```json { "ratePlan": [ { "_id": "6519b9b32d8c4d001c8b4f7a", "accountId": "640a1c3b1f2b3c001d4a5b6c", "type": "standard", "name": "Standard Rate", "restrictedDates": [], "pricingModel": "nightly_rate", "channelSync": [ "bookingCom", "manual_reservations" ], "active": true, "createdAt": "2023-12-01T04:09:27.335Z", "updatedAt": "2023-12-01T04:09:27.335Z" } ], "requestId": "req_12345abcdef" } ``` #### Error Response (400) - **description**: Bad request. Indicates an issue with the request parameters or format. ``` -------------------------------- ### Get Supported Amenities using Python Source: https://open-api-docs.guesty.com/reference/amenities This Python snippet shows how to retrieve a list of supported amenities from the Guesty API using the 'requests' library. It performs a GET request with the 'accept' header set to 'application/json' and prints the JSON response. ```Python import requests url = "https://open-api.guesty.com/v1/properties-api/amenities/supported" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Get Imported Calendar by ID (Ruby) Source: https://open-api-docs.guesty.com/reference/calendar-sync-ical-import A Ruby example demonstrating how to use the 'net/http' library to fetch an imported calendar by its ID. It constructs and sends a GET request to the Guesty API endpoint. ```ruby require 'uri' require 'net/http' require 'json' uri = URI.parse("https://open-api.guesty.com/v1/icalendar-api/imported-calendars/importedCalendarId") request = Net::HTTP::Get.new(uri) request['accept'] = 'application/json' response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| http.request(request) end puts JSON.parse(response.body) ``` -------------------------------- ### Task Scheduling Details Source: https://open-api-docs.guesty.com/reference/post_tasks-open-api-create-single-task This section details the parameters for scheduling tasks, including fixed and flexible time options. It explains the usage of `startTime`, `canStartAfter`, and `mustFinishBefore` for different scheduling scenarios. ```APIDOC ## Task Scheduling Parameters ### Description Provides details on how to schedule tasks with fixed or flexible time. ### Parameters #### Request Body Parameters - **startTime** (string) - Conditional - The date and time the task must begin (fixed task). If this has a value, `canStartAfter` and `mustFinishBefore` should be left blank. - **canStartAfter** (string) - Conditional - The date and time after which the task can begin (flexible task). If `startTime` has a value, leave `canStartFrom` and `mustFinishBefore` blank, and vice versa. - **mustFinishBefore** (string) - Conditional - The date and time before which the task must be completed (flexible task). If `startTime` has a value, leave `canStartFrom` and `mustFinishBefore` blank, and vice versa. - **plannedDuration** (number) - Optional - The amount of time budgeted for the task in hours. ``` -------------------------------- ### Get Supported Amenities using PHP Source: https://open-api-docs.guesty.com/reference/amenities This PHP snippet demonstrates how to fetch supported amenities from the Guesty API using cURL. It sets the appropriate URL and headers for a GET request and retrieves the JSON response, which is then decoded into a PHP array. ```PHP ``` -------------------------------- ### Get Promotion List by Account ID - cURL Source: https://open-api-docs.guesty.com/reference/promotions-open-api This snippet demonstrates how to retrieve a promotion list by account ID using a cURL request. It specifies the HTTP method and the target URL. No specific dependencies are required beyond a standard cURL installation. ```Shell curl --request GET \ --url https://open-api.guesty.com/v1/rm-promotions/promotions ``` -------------------------------- ### Guesty API Reference Source: https://open-api-docs.guesty.com/reference/roomphotoscontroller_assignroomphoto This section details various endpoints available in the Guesty API, including examples for requests and responses. ```APIDOC ## Guesty API Endpoints This document outlines the available endpoints for interacting with the Guesty API. ### Components #### Security Schemes ##### bearerAuth - **Type**: API Key - **Name**: authorization - **In**: header ### Example Endpoints (Illustrative - specific endpoints not detailed in provided text) #### GET /properties ##### Description Retrieves a list of properties associated with the account. ##### Method GET ##### Endpoint /properties #### POST /bookings ##### Description Creates a new booking for a property. ##### Method POST ##### Endpoint /bookings ##### Request Body - **property_id** (integer) - Required - The ID of the property to book. - **check_in_date** (string) - Required - The desired check-in date (YYYY-MM-DD). - **check_out_date** (string) - Required - The desired check-out date (YYYY-MM-DD). ##### Request Example ```json { "property_id": 123, "check_in_date": "2023-10-26", "check_out_date": "2023-10-29" } ``` ##### Response ###### Success Response (201) - **booking_id** (integer) - The ID of the newly created booking. - **status** (string) - The status of the booking. ###### Response Example ```json { "booking_id": 456, "status": "confirmed" } ``` #### GET /bookings/{booking_id} ##### Description Retrieves details for a specific booking. ##### Method GET ##### Endpoint /bookings/{booking_id} ##### Parameters ###### Path Parameters - **booking_id** (integer) - Required - The ID of the booking to retrieve. ``` -------------------------------- ### Get Supported Amenities using Ruby Source: https://open-api-docs.guesty.com/reference/amenities This Ruby snippet illustrates how to retrieve a list of supported amenities from the Guesty API using the built-in Net::HTTP library. It constructs a GET request to the specified URL and parses the JSON response. No external gems are required. ```Ruby require 'uri' require 'net/http' require 'json' url = URI("https://open-api.guesty.com/v1/properties-api/amenities/supported") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["accept"] = "application/json" response = http.request(request) puts JSON.parse(response.body) ``` -------------------------------- ### Website Property Details Source: https://open-api-docs.guesty.com/reference/rateplancontroller_initunassignlistings Retrieves detailed information about a specific website property, including its pricing structure, meal plan options, and complex availability rules. ```APIDOC ## GET /websites/{propertyId} ### Description Retrieves detailed information about a specific website property, including its pricing structure, meal plan options, and complex availability rules. ### Method GET ### Endpoint /websites/{propertyId} ### Parameters #### Path Parameters - **propertyId** (string) - Required - The unique identifier for the property. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **cancellationFee** (number) - The fee charged for cancellation. - **mealPlans** (array) - A list of available meal plan options (e.g., "breakfast", "lunch", "dinner", "all_inclusive"). - **availabilityRules** (object) - Rules governing property availability: - **advanceNotice** (number) - The minimum advance notice required for booking. - **bookingWindow** (number) - The window of time in advance bookings can be made. - **dateRange** (object) - Specifies the date range for availability rules. - **to** (string, format: date-time) - The end date of the range. - **from** (string, format: date-time) - The start date of the range. - **repeatedDays** (object) - Defines availability for specific days of the week. - **0** (object) - Availability for Sunday. - **available** (boolean) - Whether the property is available on this day (default: true). - **1** (object) - Availability for Monday. - **available** (boolean) - Whether the property is available on this day (default: true). - **2** (object) - Availability for Tuesday. - **available** (boolean) - Whether the property is available on this day (default: true). #### Response Example ```json { "cancellationFee": 50, "mealPlans": [ "all_inclusive" ], "availabilityRules": { "advanceNotice": 10, "bookingWindow": 20, "dateRange": { "to": "2024-12-31T23:59:59Z", "from": "2024-01-01T00:00:00Z", "repeatedDays": { "0": {"available": true}, "1": {"available": true}, "2": {"available": true} } } } } ``` ``` -------------------------------- ### List Integrations - cURL Source: https://open-api-docs.guesty.com/reference/integrations Example of how to retrieve a list of all account integrations using cURL. This request requires an 'accept' header for JSON response. ```shell curl --request GET \ --url https://open-api.guesty.com/v1/integrations \ --header 'accept: application/json' ``` -------------------------------- ### Get All Rate Plans - Python Source: https://open-api-docs.guesty.com/reference/open-api-rate-plan-crud-v1 Python code snippet using the 'requests' library to get rate plans. It makes a GET request to the API endpoint, specifying skip and limit parameters, and the 'accept' header for JSON. ```python import requests url = "https://open-api.guesty.com/v1/rm-rate-plans-ext/rate-plans" params = { "skip": 0, "limit": 25 } headers = { "accept": "application/json" } response = requests.get(url, params=params, headers=headers) print(response.json()) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.