### Report Generation and Configuration Source: https://developers.cloudbeds.com/reference/post_datainsights-v1-1-stock-reports-stock-report-id-clone-1 This section covers the configuration of reports, including filtering, sorting, and formatting. ```APIDOC ## Report Configuration Details ### Description This endpoint allows for detailed configuration of reports, including setting filters, sorting criteria, and display formats. ### Method POST (Implied, as this describes a request body structure for report creation/modification) ### Endpoint `/reports` (Assumed endpoint for report creation/modification) ### Parameters #### Request Body - **filters** (object) - Optional - Defines the criteria for filtering report data. See `ReportFilters` schema for details. - **sort** (array of objects) - Optional - Specifies the sorting order for the report data. Each object should conform to the `ReportSort` schema. - **cdf** (object) - Required - The column or custom data field to sort by. - **type** (string) - Optional - Defaults to 'default'. Can be 'default' or 'custom'. - **column** (string) - Required - The name of the column or custom data field. - **multi_level_id** (integer) - Optional - Indicates the multi-level location of the CDF. - **direction** (string) - Required - The sort direction, either 'asc' or 'desc'. - **settings** (object) - Optional - Configuration for report display details and totals. - **details** (boolean) - Required - Whether to include detailed report information. - **totals** (boolean) - Required - Whether to include report totals. - **transpose** (boolean) - Optional - Whether to transpose the report. - **formats** (object) - Optional - Formatting options for the report export. - **date** (string) - Optional - Defaults to 'YYYY-MM-DD'. Specifies the date format for the export. Accepts various formats like 'YYYY-MM-DD', 'MM/DD/YYYY', etc., or null. - **type** (string) - ReadOnly - The type of report ('List', 'Summary', 'Pivot'). - **folder_id** (integer) - ReadOnly - The ID of the folder where the report is stored. Nullable. ### Request Example ```json { "filters": { ... }, "sort": [ { "cdf": { "column": "credit_amount", "type": "default" }, "direction": "asc" } ], "settings": { "details": true, "totals": false, "transpose": true }, "formats": { "date": "MM/DD/YYYY" } } ``` ### Response #### Success Response (200) - **type** (string) - The type of report generated. - **folder_id** (integer) - The ID of the folder containing the report. #### Response Example ```json { "type": "List", "folder_id": 1 } ``` ``` -------------------------------- ### Get Report by ID - API Request Example (Shell) Source: https://developers.cloudbeds.com/reference/get_datainsights-v1-1-reports-report-id-1 Demonstrates how to retrieve a specific report using its ID via a GET request. Requires the report_id in the path and X-PROPERTY-ID in the header. This example uses cURL for illustration. ```shell curl -X GET "https://api.cloudbeds.com/datainsights/v1.1/reports/{report_id}" \ -H "X-PROPERTY-ID: {property_id}" ``` -------------------------------- ### GET /getRoomsUnassigned Source: https://developers.cloudbeds.com/reference/get_getroomsunassigned-2 Retrieves a list of unassigned rooms within a property. This endpoint is an alias for `getRooms` and shares its parameters, response structure, and examples. ```APIDOC ## GET /getRoomsUnassigned ### Description Returns a list of unassigned rooms in the property. This endpoint is an alias of `getRooms`. Please refer to the `getRooms` documentation for parameters, response, and examples. ### Method GET ### Endpoint /getRoomsUnassigned ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) Refer to the `getRooms` endpoint documentation for response details. #### Response Example Refer to the `getRooms` endpoint documentation for response examples. ``` -------------------------------- ### POST /websites/developers_cloudbeds_reference Source: https://developers.cloudbeds.com/reference/post_datainsights-v1-1-stock-reports-1 Publishes a new report to a stock report with optional rules. Returns 201 CREATED on success. ```APIDOC ## POST /websites/developers_cloudbeds_reference ### Description Publishes a single report to a stock report with optional rules. ### Method POST ### Endpoint /websites/developers_cloudbeds_reference ### Parameters #### Request Body - **rules** (object) - Optional - Rules to apply to the report. ### Request Example ```json { "rules": { "optional_rule_1": "value1", "optional_rule_2": "value2" } } ``` ### Response #### Success Response (201 CREATED) - **message** (string) - Success message indicating the report was published. #### Response Example ```json { "message": "Report published successfully." } ``` ``` -------------------------------- ### GET /datainsights/v1.1/property/settings/{name} Source: https://developers.cloudbeds.com/reference/get_datainsights-v1-1-property-settings-name-1 Retrieves specific property settings, such as the start of the week or currency rounding precision, for a given property. ```APIDOC ## GET /datainsights/v1.1/property/settings/{name} ### Description Retrieves specific property settings for a given property. This endpoint allows you to fetch details like the start of the week or currency rounding precision. ### Method GET ### Endpoint /datainsights/v1.1/property/settings/{name} ### Parameters #### Path Parameters - **name** (string) - Required - The name of the property setting to retrieve. Accepted values are `start_of_week` and `currency_cdf_rounding_precision`. #### Query Parameters None. #### Header Parameters - **X-PROPERTY-ID** (integer) - Required - The property ID of the client. ### Request Example ```json { "headers": { "X-PROPERTY-ID": 12345 } } ``` ### Response #### Success Response (200) - **title** (string) - The title of the property setting. - **type** (string) - The type of options available for the setting (e.g., `PickList`). - **options** (array) - A list of available options for the property setting. - **name** (string) - The name of the option (e.g., `Monday`). - **value** (string) - The value of the option to be used in the API (e.g., `Monday`). #### Response Example ```json { "title": "Start of Week", "type": "PickList", "options": [ { "name": "Monday", "value": "Monday" }, { "name": "Tuesday", "value": "Tuesday" } ] } ``` ``` -------------------------------- ### Report Generation and Configuration Source: https://developers.cloudbeds.com/reference/post_datainsights-v1-1-stock-reports-1 This section covers the configuration and generation of various reports. It details the parameters available for filtering, sorting, and customizing the output format. ```APIDOC ## POST /reports ### Description Generates a report based on specified filters, sort order, and settings. ### Method POST ### Endpoint /reports ### Parameters #### Request Body - **filters** (object) - Required - Criteria to filter the report data. - **sort** (array) - Optional - Specifies how the report should be sorted. - **cdf** (object) - Required - The column to sort by. - **type** (string) - Optional - Type of CDF ('default' or 'custom'). Defaults to 'default'. - **column** (string) - Required - Name of the CDF column. - **multi_level_id** (integer) - Optional - Multi-level identifier for the CDF. - **direction** (string) - Required - Sort direction ('asc' or 'desc'). - **settings** (object) - Optional - Report display settings. - **details** (boolean) - Required - Whether to include details in the report. - **totals** (boolean) - Required - Whether to include totals in the report. - **transpose** (boolean) - Optional - Whether to transpose the report. - **formats** (object) - Optional - Formatting options for the report. - **date** (string) - Optional - Date format for the export. Defaults to 'YYYY-MM-DD'. ### Request Example ```json { "filters": { "date_range": { "start_date": "2023-01-01", "end_date": "2023-01-31" } }, "sort": [ { "cdf": { "column": "booking_id" }, "direction": "asc" } ], "settings": { "details": true, "totals": true }, "formats": { "date": "MM/DD/YYYY" } } ``` ### Response #### Success Response (200) - **report_id** (string) - The unique identifier for the generated report. - **status** (string) - The current status of the report generation. #### Response Example ```json { "report_id": "rep_abcdef123456", "status": "processing" } ``` ``` -------------------------------- ### Chart Settings Reference Source: https://developers.cloudbeds.com/reference/put_datainsights-v1-1-stock-reports-stock-report-id-charts-chart-id-1 Details on how to configure chart settings, including metrics, kind, axis, and stacking options. ```APIDOC ## Chart Settings Reference ### Description This section details the structure and options available for configuring chart settings within the API. It covers how to define metrics, chart types, axis configurations, and stacking options for data visualization. ### Method N/A (Reference Object) ### Endpoint N/A (Reference Object) ### Parameters #### Chart Settings Object - **stack** (string) - Optional - Stack option of Chart kind bar. Enum: `normalized`, `standard`. Example: `normalized` #### ChartSettingsMetrics Object - **cdf** (object) - Required - Defines the chart metric. - **type** (string) - Optional - Report cdf type. Enum: `default`, `custom`. Default: `default`. Example: `default` - **column** (string) - Required - Report cdf name. Example: `credit_amount` - **multi_level_id** (integer) - Optional - Multi-level where CDF is located. Enum: `1`, `2`, `3`, `4` - **kind** (string) - Required - Kind of chart. Enum: `line`, `bar`, `area`. Example: `line` - **axis** (string) - Required - Left or right vertical axis. Enum: `left`, `right`. Example: `left` #### Categories - **categories** (array) - Optional - List of CDFs in group rows or group columns (or the text string "Periods" for period comparison reports) to categorize data. Categories are represented horizontally (x-axis) on most charts. Example: `"Periods"` #### Metrics - **metrics** (array) - Optional - List of CDFs with metrics to represent data. Metrics will be represented vertically (y-axis) on most charts. See `ChartSettingsMetrics` for item structure. ### Request Example ```json { "chartSettings": { "stack": "normalized", "categories": "Periods", "metrics": [ { "cdf": { "type": "default", "column": "credit_amount" }, "kind": "line", "axis": "left" } ] } } ``` ### Response #### Success Response (200) - **chartSettings** (object) - Chart configuration details. - **stack** (string) - Stack option of Chart kind bar. - **categories** (string) - Categories for the chart. - **metrics** (array) - List of metrics configured for the chart. - **cdf** (object) - Defined CDF for the metric. - **type** (string) - Type of CDF. - **column** (string) - Name of the CDF column. - **multi_level_id** (integer) - Multi-level identifier for the CDF. - **kind** (string) - Kind of chart. - **axis** (string) - Vertical axis for the metric. #### Response Example ```json { "chartSettings": { "stack": "normalized", "categories": "Periods", "metrics": [ { "cdf": { "type": "default", "column": "credit_amount", "multi_level_id": 1 }, "kind": "line", "axis": "left" } ] } } ``` ``` -------------------------------- ### GET /api/v1/integrations/app_state Source: https://developers.cloudbeds.com/reference/get_getappstate-2 Retrieve the current state of an integration for a specified property. This endpoint can be used to check if an integration is enabled, disabled, installing, or pending. ```APIDOC ## GET /api/v1/integrations/app_state ### Description Retrieves the integration state for a given property. The state can be one of 'enabled', 'disabled', 'installing', or 'pending'. ### Method GET ### Endpoint /api/v1/integrations/app_state ### Parameters #### Query Parameters - **propertyID** (string) - Optional - Property identifier to be queried. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **success** (boolean) - Returns if the request could be completed. - **data** (object) - Integration state details. - **app_state** (string) - Integration state. Possible values: 'enabled', 'disabled', 'installing', 'pending'. #### Response Example ```json { "success": true, "data": { "app_state": "enabled" } } ``` ``` -------------------------------- ### Chart Settings Configuration Example Source: https://developers.cloudbeds.com/reference/post_datainsights-v1-1-reports-report-id-charts-1 Specifies the configuration for charts, including how metrics are aggregated (e.g., 'sum', 'count'), the type of chart ('line', 'bar', 'area'), and which vertical axis to use ('left', 'right'). It also includes an option for 'stack' for bar charts. ```json { "metrics": [ { "cdf": { "type": "default", "column": "credit_amount" }, "metrics": [ "sum" ], "kind": "line", "axis": "left" } ], "stack": "normalized" } ``` -------------------------------- ### GET /accounting/v1.0/trial-balance/configuration/status Source: https://developers.cloudbeds.com/reference/istrialbalanceconfigured-1 Retrieves information about whether a property has configured its trial balance report. This is useful for checking the current status of trial balance setup for a given property. ```APIDOC ## GET /accounting/v1.0/trial-balance/configuration/status ### Description Returns information if property has configured trial balance report. ### Method GET ### Endpoint /accounting/v1.0/trial-balance/configuration/status ### Parameters #### Header Parameters - **X-Property-ID** (integer) - Required - Property id ### Response #### Success Response (200) - **configuredAt** (string) - Configured datetime (ISO 8601) in UTC - **configured** (boolean) - True if this property has configured trial balance. #### Response Example ```json { "configuredAt": "2017-07-21T17:32:28.000Z", "configured": true } ``` ``` -------------------------------- ### Chart Settings and Metrics Source: https://developers.cloudbeds.com/reference/get_datainsights-v1-1-stock-reports-stock-report-id-charts-1 Details on configuring chart settings, including metrics, kind, axis, and categories for data visualization. ```APIDOC ## Chart Settings and Metrics ### Description This section details the configuration for charts, including how to define metrics, chart types, axes, and data categorization. ### Parameters #### Request Body - **metric** (string) - Enum: `sum`, `mean`, `max`, `min`, `count`, `std`, `var` - Description: Chart metric. Not required for dynamic cdfs. Example: `sum` - **kind** (string) - Enum: `line`, `bar`, `area` - Description: Kind of chart. Example: `line` - **axis** (string) - Enum: `left`, `right` - Description: Left or right vertical axis. Example: `left` - **stack** (string) - Enum: `normalized`, `standard` - Description: Stack option of Chart kind bar. Example: `normalized` - **categories** (string) - Description: List of CDFs in group rows or group columns (or the text string "Periods" for period comparison reports) to categorize data. Categories are represented horizontally (x-axis) on most charts. Example: `"Periods"` - **metrics** (array) - Description: List of CDFs with metrics to represent data. Metrics will be represented vertically (y-axis) on most charts. - **cdf** (object) - Description: Configuration for a specific CDF metric. - **type** (string) - Enum: `default`, `custom` - Description: Report cdf type. Example: `default` - **column** (string) - Description: Report cdf name. Example: `credit_amount` - **multi_level_id** (integer) - Enum: `1`, `2`, `3`, `4` - Description: Multi-level where CDF is located. ### Request Example ```json { "metric": "sum", "kind": "line", "axis": "left", "categories": "Periods", "metrics": [ { "cdf": { "type": "default", "column": "credit_amount", "multi_level_id": 1 } } ] } ``` ### Response #### Success Response (200) - **message** (string) - Description: A confirmation message indicating the chart settings were processed successfully. #### Response Example ```json { "message": "Chart settings updated successfully." } ``` ``` -------------------------------- ### Report Period Definition Example Source: https://developers.cloudbeds.com/reference/get_datainsights-v1-1-search-1 Defines a reporting period with a start and end date, and an optional name and CDF (Custom Data Field) configuration. Supports relative dates and multi-level CDFs. ```json { "cdf": { "type": "default", "column": "credit_amount" }, "name": "Month-To-Date", "id": "start_of_last_year_to_today", "start": "start_current_year", "end": "today", "start_relative_to_end": false } ``` -------------------------------- ### Get Stock Report by ID - API Request Example Source: https://developers.cloudbeds.com/reference/get_datainsights-v1-1-stock-reports-stock-report-id-1 This snippet demonstrates how to retrieve a specific stock report using its unique identifier. It outlines the HTTP method, endpoint, and expected parameters. The response structure for successful retrieval and potential error codes are also detailed. ```json { "method": "get", "path": "/stock_reports/{stock_report_id}", "summary": "Get one stock report.", "description": "Stock reports are the reports that Cloudbeds owns.\n\n**Notes**\n- A stock report can not be edited, but can be copied.\n- Since a stock report doesn't belong to any property, it's mandatory to define it.\n- A copied stock report is the same as creating a new report where all the features are available.", "parameters": [ { "in": "path", "name": "stock_report_id", "required": true, "schema": { "type": "integer", "minimum": 0 } } ], "responses": { "200": { "description": "OK" }, "404": { "description": "Not Found" }, "500": { "description": "Internal Server Error" } }, "tags": [ "Stock reports" ] } ``` -------------------------------- ### Report Creation and Configuration Source: https://developers.cloudbeds.com/reference/post_datainsights-v1-1-reports-report-id-clone-1 This section details the structure and parameters required for creating and configuring reports, including defining report groups, periods, comparisons, and filters. ```APIDOC ## POST /reports ### Description Creates a new report based on the provided configuration. This includes specifying the data source, grouping, time periods, comparisons, and filters. ### Method POST ### Endpoint /reports ### Parameters #### Request Body - **report_group** (object) - Optional - Specifies the grouping and sorting of data for the report. See ReportGroup schema. - **periods** (array) - Optional - Defines the time periods to be included in the report. Maximum of 3 periods. See ReportPeriod schema. - **comparisons** (array) - Optional - A list of up to 5 comparisons to be made within the report. See ReportComparison schema. - **filters** (object) - Optional - Specifies the criteria for filtering the report data. See ReportFilter schema. ### Request Example ```json { "report_group": { "cdf": [ "weekday", "d", "m", "time_hour", "time_minute", "time_second" ], "description": "Report group modifier" }, "periods": [ { "cdf": { "type": "default", "column": "credit_amount" }, "name": "Month-To-Date", "start": "start_current_month", "end": "today" } ], "filters": { "and": [ { "cdf": { "type": "default", "column": "checkin_date" }, "operator": "less_than_or_equal", "value": "today" } ] } } ``` ### Response #### Success Response (201 Created) - **report_id** (string) - The unique identifier for the newly created report. #### Response Example ```json { "report_id": "rpt_abc123xyz" } ``` ## GET /reports/{report_id} ### Description Retrieves the configuration details for a specific report. ### Method GET ### Endpoint /reports/{report_id} ### Parameters #### Path Parameters - **report_id** (string) - Required - The unique identifier of the report to retrieve. ### Response #### Success Response (200 OK) - **report_group** (object) - The configuration for the report group. - **periods** (array) - The list of configured periods for the report. - **comparisons** (array) - The list of configured comparisons for the report. - **filters** (object) - The configured filters for the report. #### Response Example ```json { "report_group": { "cdf": [ "weekday", "d", "m", "time_hour", "time_minute", "time_second" ], "description": "Report group modifier" }, "periods": [ { "cdf": { "type": "default", "column": "credit_amount" }, "name": "Month-To-Date", "start": "start_current_month", "end": "today" } ], "filters": { "and": [ { "cdf": { "type": "default", "column": "checkin_date" }, "operator": "less_than_or_equal", "value": "today" } ] } } ``` ``` -------------------------------- ### Get Dataset by ID Updated At Source: https://developers.cloudbeds.com/reference/get_datainsights-v1-1-datasets-dataset-id-updated-at-1 Obtain the last time your property received an event based on the Dataset ID. For example, if the Dataset ID is 'Reservation', it will show the last time DI received a reservation. If you have a lag bigger than 5 minutes, please raise a ZD Ticket. ```APIDOC ## GET /datasets/{dataset_id}/updated_at ### Description Obtain the last time your property received an event based on the Dataset ID. This endpoint is useful for tracking data synchronization and identifying potential delays. ### Method GET ### Endpoint `/datasets/{dataset_id}/updated_at` ### Parameters #### Path Parameters - **dataset_id** (integer) - Required - The ID of the dataset to query. ### Request Example ``` GET /datasets/3/updated_at ``` ### Response #### Success Response (200) - **updated_at** (string) - The timestamp of the last update for the specified dataset. #### Response Example ```json { "updated_at": "2023-10-27T10:30:00Z" } ``` #### Error Response (401) - **error** (object) - Contains error details. - **code** (integer) - Error code. - **status** (string) - Error status. - **description** (string) - Error description. - **message** (object) - Error message. #### Error Response (500) - **error** (object) - Contains error details. - **code** (integer) - Error code. - **status** (string) - Error status. - **description** (string) - Error description. - **message** (object) - Error message. ``` -------------------------------- ### Chart Configuration Options Source: https://developers.cloudbeds.com/reference/get_datainsights-v1-1-stock-reports-stock-report-id-charts-1 Defines the structure for chart configuration, including the chart's title, its type (e.g., line, bar, pie), and various settings. The 'settings' object allows for fine-tuning, such as enabling or disabling the legend and toolbox, and specifying data metrics with their associated aggregation methods and display axes. ```json { "description": { "type": "string", "description": "Chart title", "example": "My cool new chart" }, "kind": { "type": "string", "enum": [ "line", "bar", "area", "pie", "donut", "sunburst", "treemap", "geomap", "heatmap", "combo" ], "description": "Kind of chart", "example": "bar" }, "settings": { "default": { "legend": false, "toolbox": false }, "allOf": [ { "type": "object", "properties": { "legend": { "type": "boolean", "description": "Toggle to show/hide legend", "example": false, "nullable": false }, "toolbox": { "type": "boolean", "description": "Toggle to show/hide the toolbox", "example": false, "nullable": false }, "metrics": { "description": "List of CDFs with metrics and vertical axis to represent data.", "example": { "cdf": { "type": "default", "column": "credit_amount" }, "metric": "sum", "kind": "line", "axis": "left" }, "type": "array", "items": { "type": "object", "properties": { "cdf": { "description": "Report CDF", "example": { "type": "default", "column": "credit_amount" }, "allOf": [ { "type": "object", "properties": { "type": { "type": "string", "default": "default", "enum": [ "default", "custom" ], "description": "Report cdf type", "example": "default" }, "column": { "type": "string", "description": "Report cdf name", "example": "credit_amount" }, "multi_level_id": { "type": "integer", "enum": [ 1, 2, 3, 4 ], "description": "Multi-level where CDF is located" } }, "required": [ "column" ], "x-readme-ref-name": "ReportCDF" } ] }, "metric": { "description": "Aggregation to apply to the metric" } } } } } } ] } } ``` -------------------------------- ### Report Configuration API Source: https://developers.cloudbeds.com/reference/post_datainsights-v1-1-stock-reports-stock-report-id-clone-1 This section details the parameters available for configuring reports, including data columns, comparison periods, and filters. ```APIDOC ## Report Configuration Details ### Description This document outlines the structure for configuring reports, specifying data fields, temporal periods for comparison, and filtering criteria. ### Method N/A (Configuration Schema) ### Endpoint N/A (Configuration Schema) ### Parameters #### Request Body - **report_group** (object) - Optional - Report group modifier. - **cdf** (object) - Required - Common Data Field for the report group. - **type** (string) - Optional - Report cdf type. Enum: `default`, `custom`. Default: `default`. - **column** (string) - Required - Report cdf name. - **multi_level_id** (integer) - Optional - Multi-level where CDF is located. Enum: `1`, `2`, `3`, `4`. - **periods** (array) - Optional - Periods to compare. Max items: 3. - **items** (object) - Defines a period for comparison. - **cdf** (object) - Required - Common Data Field for the period. - **type** (string) - Optional - Report cdf type. Enum: `default`, `custom`. Default: `default`. - **column** (string) - Required - Report cdf name. - **multi_level_id** (integer) - Optional - Multi-level where CDF is located. Enum: `1`, `2`, `3`, `4`. - **name** (string) - Required - Label for a period. - **id** (string) - ReadOnly - Machine name of period (auto-generated). - **start** (string) - Required - The beginning date or relative date of a period. - **end** (string) - Required - The beginning date or relative date of a period. - **start_relative_to_end** (boolean) - Optional - If true, relative start date will be relative to the end date instead of today. - **comparisons** (array) - Optional - A list of up to 5 Comparisons. - **items** ($ref: '#/components/schemas/ReportComparison') - Defines a comparison. - **filters** (object) - Optional - Report filters. Minimum items: 1. - **and** (array) - Represents a logical AND condition. - **items** (object) - A condition within the AND clause. - **cdf** (object) - Common Data Field for the filter. - **type** (string) - Optional - Report cdf type. Enum: `default`, `custom`. - **column** (string) - Required - Report cdf name. - **operator** (string) - Required - The comparison operator (e.g., `less_than_or_equal`). - **value** (string) - Required - The value to compare against. - **or** (array) - Represents a logical OR condition. - **items** (object) - A condition within the OR clause. - **cdf** (object) - Common Data Field for the filter. - **type** (string) - Optional - Report cdf type. Enum: `default`, `custom`. - **column** (string) - Required - Report cdf name. - **operator** (string) - Required - The comparison operator (e.g., `less_than_or_equal`). - **value** (string) - Required - The value to compare against. ### Request Example ```json { "report_group": { "cdf": { "column": "weekday" } }, "periods": [ { "cdf": { "column": "credit_amount" }, "name": "Last Month", "start": "start_of_last_month", "end": "end_of_last_month" }, { "cdf": { "column": "credit_amount" }, "name": "This Month", "start": "start_current_month", "end": "today" } ], "filters": { "and": [ { "cdf": { "type": "default", "column": "checkin_date" }, "operator": "less_than_or_equal", "value": "today" } ] } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure of the operation. - **message** (string) - A confirmation message. #### Response Example ```json { "status": "success", "message": "Report configuration updated successfully." } ``` ``` -------------------------------- ### GET /communication/email-templates Source: https://developers.cloudbeds.com/reference/get_getemailtemplates-2 Retrieves a list of all email templates. This endpoint can be filtered by 'propertyID' to get templates for a specific property. ```APIDOC ## GET /communication/email-templates ### Description Retrieves a list of all email templates. This endpoint can be filtered by 'propertyID' to get templates for a specific property. ### Method GET ### Endpoint /communication/email-templates ### Parameters #### Query Parameters - **propertyID** (string) - Optional - Property ID to filter templates by. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **success** (boolean) - Returns if the request could be completed. - **data** (array) - List of existing email templates. - **emailTemplateID** (string) - ID of the email template. - **name** (string) - Name of the email template. - **subject** (string) - Subject of the email template. - **isActive** (boolean) - True if email template is active; false if not. #### Response Example ```json { "success": true, "data": [ { "emailTemplateID": "tmpl_12345", "name": "Welcome Email", "subject": "Welcome to Cloudbeds!", "isActive": true }, { "emailTemplateID": "tmpl_67890", "name": "Booking Confirmation", "subject": "Your Booking Confirmation", "isActive": true } ] } ``` ``` -------------------------------- ### GET /getDashboard Source: https://developers.cloudbeds.com/reference/get_getdashboard-2 Retrieves basic information about the current state of the hotel. This endpoint is useful for getting a quick overview of hotel operations. ```APIDOC ## GET /getDashboard ### Description Returns basic information about the current state of the hotel. ### Method GET ### Endpoint /getDashboard ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **response** (object) - Contains the dashboard data. - **reservations** (object) - Reservation statistics. - **checkedIn** (integer) - Number of checked-in reservations. - **checkedOut** (integer) - Number of checked-out reservations. - **staying** (integer) - Number of reservations currently staying. - **dueOut** (integer) - Number of reservations due out. - **scheduled** (integer) - Number of scheduled reservations. - **occupancy** (object) - Occupancy statistics. - **adults** (integer) - Number of adults. - **children** (integer) - Number of children. - **infants** (integer) - Number of infants. - **earnings** (object) - Earnings statistics. - **today** (number) - Earnings for today. - **month** (number) - Earnings for the current month. - **year** (number) - Earnings for the current year. #### Response Example ```json { "success": true, "response": { "reservations": { "checkedIn": 10, "checkedOut": 5, "staying": 15, "dueOut": 3, "scheduled": 20 }, "occupancy": { "adults": 25, "children": 5, "infants": 2 }, "earnings": { "today": 1500.50, "month": 45000.75, "year": 540000.00 } } } ``` ``` -------------------------------- ### POST /reports Source: https://developers.cloudbeds.com/reference/post_datainsights-v1-1-stock-reports-stock-report-id-query-export-async-1 Initiates the generation of a report based on specified criteria. The response includes a task ID to track the report's status. ```APIDOC ## POST /reports ### Description Initiates the generation of a report. You can specify the report format, whether to include charts, and other optional parameters. A task ID is returned to monitor the generation progress. ### Method POST ### Endpoint /reports ### Parameters #### Query Parameters - **include_charts** (boolean) - Optional - Flag to include charts in the export, defaults to True #### Header Parameters - **X-PROPERTY-ID** (integer) - Required - Property id of the client ### Request Body - **format** (string) - Required - The desired format for the report (e.g., "xlsx", "pdf"). - **filters** (object) - Optional - An object containing filters to apply to the report data. - **field1** (string) - Description of filter field 1. - **field2** (integer) - Description of filter field 2. ### Request Example ```json { "format": "xlsx", "filters": { "date_from": "2023-01-01", "date_to": "2023-12-31" } } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the report generation task. - **status** (string) - The current status of the report generation task (e.g., "PENDING", "PROCESSING", "COMPLETED"). - **result** (object) - Contains details about the generated report if the task is completed. - **url** (string) - Download URL of the generated report. - **format** (string) - The format of the generated report. - **view** (string) - The view of the report (e.g., "raw"). - **filename** (string) - The name of the generated report file. - **generated_at** (string) - The timestamp when the report was generated. - **email** (object) - Information about the email sent to the user, if applicable. - **MessageId** (string) - ID of the email sent. - **ResponseMetadata** (object) - Metadata about the email sending response. - **RequestId** (string) - Request ID for the email service. - **HTTPStatusCode** (integer) - HTTP status code of the email sending request. - **HTTPHeaders** (object) - Headers from the email sending response. - **date** (string) - Date of the response. - **content_type** (string) - Content type of the response. - **content_length** (integer) - Length of the content. - **connection** (string) - Connection type. - **x_amzn_requestid** (string) - Amazon Request ID. #### Response Example ```json { "id": "53cce75e-eed6-4040-8a98-8accf372947a", "status": "PENDING", "result": null } ``` ``` -------------------------------- ### Get Report Summary by ID (OpenAPI) Source: https://developers.cloudbeds.com/reference/get_datainsights-v1-1-reports-report-id-summary-1 Details the OpenAPI specification for the 'Get report summary by id' endpoint. It specifies the HTTP method (GET), path parameters, possible responses (including unauthorized and internal server errors), and security requirements. ```json { "get": { "responses": { "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "Get report summary by id", "tags": [ "Reports" ], "security": [ { "Authorization": [] } ] }, "parameters": [ { "in": "path", "name": "report_id", "required": true, "schema": { "type": "integer", "minimum": 0 } } ] } ``` -------------------------------- ### Report Generation Configuration Source: https://developers.cloudbeds.com/reference/post_datainsights-v1-1-stock-reports-stock-report-id-query-export-async-1 This section details the structure for configuring report generation, including grouping, filtering, and column definitions. ```APIDOC ## Report Generation API ### Description This API allows for the generation of custom reports. You can define how data should be grouped, filtered, and which columns to include. ### Method POST ### Endpoint /reports/generate ### Parameters #### Request Body - **columns** (array[ReportColumns]) - Required - Specifies the columns to include in the report. - **group_rows** (array[ReportGroup], optional) - Specifies how rows should be grouped. - **group_columns** (array[ReportGroup], optional) - Specifies how columns should be grouped. - **filters** (object, optional) - Defines filters to apply to the report data. ### Request Example ```json { "columns": [ { "cdf": { "column": "example_column" }, "aggregate": { "function": "sum" } } ], "group_rows": [ { "cdf": { "column": "date_column" }, "modifier": "month" } ], "filters": { "and": [ { "field": "status", "operator": "eq", "value": "active" } ] } } ``` ### Response #### Success Response (200) - **report_id** (string) - The ID of the generated report. - **status** (string) - The current status of the report generation. #### Response Example ```json { "report_id": "rep_12345abcde", "status": "processing" } ``` ## Report Columns and Grouping Definitions ### ReportColumns Represents a column to be included in the report. - **cdf** (object) - Required - Defines the column data. - **type** (string, optional) - The type of CDF, defaults to 'default'. - **column** (string) - Required - The name of the column. - **multi_level_id** (integer, optional) - The multi-level identifier for the CDF. - **aggregate** (object, optional) - Specifies aggregation for the column. - **function** (string) - Required - The aggregation function to apply (e.g., 'sum', 'mean', 'max', 'min', 'count', 'std', 'var'). ### ReportGroup Represents a grouping configuration for rows or columns. - **cdf** (object) - Required - Defines the data for grouping. - **type** (string, optional) - The type of CDF, defaults to 'default'. - **column** (string) - Required - The name of the column to group by. - **multi_level_id** (integer, optional) - The multi-level identifier for the CDF. - **modifier** (string, optional) - A modifier to apply to the grouping (e.g., 'second', 'minute', 'hour', 'day', 'month', 'year', 'week', 'weekday', 'd', 'm', 'time_hour', 'time_minute', 'time_second'). ### ReportCDF Represents the core definition of a column or grouping field. - **type** (string, optional) - The type of CDF, defaults to 'default' ('default', 'custom'). - **column** (string) - Required - The name of the column. - **multi_level_id** (integer, optional) - The multi-level identifier for the CDF. ```