Properties Collection

API methods to work with Properties

Property is a physical premises – hotels, motels, lodges, cabins, chalets, luxury apartments and other types of buildings. Usually each property has a unique address.

Properties List

Retrieve list of properties associated with user.

Request
Success Response
Error Response

Request:

GET https://staging.channex.io/api/v1/properties

Success Response Example

Status Code: 200 OK

{
"data": [
{
"type": "property",
"id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"attributes": {
"id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"title": "Demo Hotel",
"is_active": true,
"email": "hotel@channex.io",
"phone": "01267237037",
"currency": "GBP",
"country": "GB",
"state": "Demo State",
"city": "Demo Town",
"address": "Demo Street",
"zip_code": "SA23 2JH",
"latitude": null,
"longitude": null,
"content": {
"description": "Some Property Description Text",
"photos": [{
"author": "Author Name",
"description": "Room View",
"id": "4355439c-df23-4f12-bffd-26476e31dd4a",
"kind": "photo",
"position": 0,
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"room_type_id": null,
"url": "https://img.channex.io/af08bc1d-8074-476c-bdb7-cec931edaf6a/"
}]
}
},
"relationships": {
"groups": {
"data": [
{
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"type": "group",
"attributes": {
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"title": "User Group"
}
}
]
}
}
}
]
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a list of Property objects in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.

Properties Health Info

Retrieve list of property health statistic info for properties associated with user.

Property health is the status of updates to and from the property such as total updates, successful updates and failed updates.

Request
Success Response
Error Response

Request:

GET https://staging.channex.io/api/v1/properties/health

Success Response Example

Status Code: 200 OK

{
"data": [
{
"type": "property_health",
"attributes": {
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"status": "active",
"is_busy": false,
"queue_length": 0,
"total_tasks_count": 146,
"success_tasks_count": 140,
"failed_tasks_count": 6,
"in_progress_tasks_count": 0,
"waiting_tasks_count": 0,
"avg_waiting_time": "9.0704",
"avg_execution_time": "0.0855"
}
}
]
}

Validation Error Response

Status Code: 401 Unauthorized

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a list of Property Health objects in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.

Possible Statuses API method can return three possible values for property health status: active when property is active and actor is launched not_launched when property is active, but actor is not launched not_active when property is disabled

Create Property

Create new Property.

Request
Success Response
Error Response

Request:

POST https://staging.channex.io/api/v1/properties

Query body (JSON):

{
"property": {
"title": "Demo Hotel",
"currency": "GBP",
"email": "hotel@channex.io",
"phone": "01267237037",
"zip_code": "SA23 2JH",
"country": "GB",
"state": "Demo State",
"city": "Demo Town",
"address": "Demo Street",
"longitude": "-0.2416781",
"latitude": "51.5285582",
"group_id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"content": {
"description": "Some Property Description Text",
"photos": [{
"url": "https://img.channex.io/af08bc1d-8074-476c-bdb7-cec931edaf6a/",
"position": 0,
"author": "Author Name",
"kind": "photo",
"description": "Room View"
}]
}
}
}

Success Response Example

Status Code: 201 Created

{
"data": {
"type": "property",
"id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"attributes": {
"id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"title": "Demo Hotel",
"is_active": true,
"email": "hotel@channex.io",
"phone": "01267237037",
"currency": "GBP",
"country": "GB",
"state": "Demo State",
"city": "Demo Town",
"address": "Demo Street",
"zip_code": "SA23 2JH",
"longitude": "-0.2416781",
"latitude": "51.5285582",
"content": {
"description": "Some Property Description Text",
"photos": [{
"author": "Author Name",
"description": "Room View",
"id": "4355439c-df23-4f12-bffd-26476e31dd4a",
"kind": "photo",
"position": 0,
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"room_type_id": null,
"url": "https://img.channex.io/af08bc1d-8074-476c-bdb7-cec931edaf6a/"
}]
}
},
"relationships": {
"groups": {
"data": [
{
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"type": "group",
"attributes": {
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"title": "User Group"
}
}
]
}
}
}
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Validation Error Response

Status Code: 422 Unprocessable Entity

{
"errors": {
"code": "validation_error",
"title": "Validation Error",
"details": {
"title": [
"can't be blank"
]
}
}
}

Fields

title [required]

Any non-empty string with maximum length of 255 symbols. Note: The property will be represented in the system under that title.

currency [required]

3 symbols long string with Currency Alphabetic code based at ISO 4217. Note: This currency will be used as default currency for nested Property entities and provided as default property currency to 3rd party services.

email [optional]

String with a valid email address. Note: This email address will be provided to 3rd party services as contact email address for that property. Field is optional at initial setup step, but required when you try connect first 3rd party service.

phone [optional]

String with maximum length of 32 symbols. Can contain digits, spaces, brackets and special characters. Note: This phone will be provided to 3rd party services as contact email address for that property. Field is optional at initial setup step, but required when you try connect first 3rd party service.

zip_code [optional]

String with maximum length of 32 symbols. Note: This zip_code will be provided to 3rd party services as part of contact address for that property. Field is optional at initial setup step, but required when you try connect first 3rd party service.

country [optional]

2 symbols long string with Country Alpha-2 code based at ISO-3166-1. Note: This country will be provided to 3rd party services as part of contact address for that property. Field is optional at initial setup step, but required when you try connect first 3rd party service.

state [optional]

String with maximum length of 255 symbols. Note: This state will be provided to 3rd party services as part of contact address for that property. Field is optional at initial setup step, but required when you try connect first 3rd party service.

city [optional]

String with maximum length of 255 symbols. Note: This city will be provided to 3rd party services as part of contact address for that property. Field is optional at initial setup step, but required when you try connect first 3rd party service.

address [optional]

String with maximum length of 255 symbols. Note: This address will be provided to 3rd party services as part of contact address for that property. Field is optional at initial setup step, but required when you try connect first 3rd party service.

longitude [optional]

Decimal number represented as String with maximum length of 10 symbols. Can have maximum 7 decimal chars. Minimum value: -180. Maximum value: +180. Note: This field is part of property coordinates. Field is optional at initial setup step, but required when you try connect first 3rd party service.

latitude [optional]

Decimal number represented as String with maximum length of 9 symbols. Can have maximum 7 decimal chars. Minimum value: -90. Maximum value: +90. Note: This field is part of property coordinates. Field is optional at initial setup step, but required when you try connect first 3rd party service.

group_id [optional]

String with valid UUID for Group object what you would like to use as Base Group for created Property. Field is optional, if it is not provided, system automatically assign Default User Group as Base Group for Property.

content [optional]

Object with content information for property. Content object can contain: description - optional text field with Property description. By default Description will be equal to null. photos - optional list of photos associated with Property. Each photo is object with next fields: url - photo URL position - integer value to represent photo position at list, Photo with position equal to 0 is used as Cover Photo for property description - Photo text description author - Name of photo Author kind - one of three possible values: photo, ad (advertising), menu (restaurant menu photo). More information about Photo API is here.

Returns

Success Method can return a Success result with 201 Created HTTP Code if operation is successful. Will contain a Property object in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.

Validation Error Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.

Get Property by ID

Retrieve specific property associated with User by ID.

Request
Success Response
Error Response

Request:

GET https://staging.channex.io/api/v1/properties/:id

Success Response Example

Status Code: 200 OK

{
"data": {
"type": "property",
"id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"attributes": {
"id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"title": "Demo Hotel",
"is_active": true,
"email": "hotel@channex.io",
"phone": "01267237037",
"currency": "GBP",
"country": "GB",
"state": "Demo State",
"city": "Demo Town",
"address": "Demo Street",
"zip_code": "SA23 2JH",
"latitude": null,
"longitude": null,
"content": {
"description": "Some Property Description Text",
"photos": [{
"author": "Author Name",
"description": "Room View",
"id": "4355439c-df23-4f12-bffd-26476e31dd4a",
"kind": "photo",
"position": 0,
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"room_type_id": null,
"url": "https://img.channex.io/af08bc1d-8074-476c-bdb7-cec931edaf6a/"
}]
}
},
"relationships": {
"groups": {
"data": [
{
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"type": "group",
"attributes": {
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"title": "User Group"
}
}
]
}
}
}
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Property object in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided or User not have access to requested Property.

Get Property Health Info by ID

Retrieve property health statistic info for specific property associated with user.

Request
Success Response
Error Response

Request:

GET https://staging.channex.io/api/v1/properties/:id/health

Success Response Example

Status Code: 200 OK

{
"data": {
"type": "property_health",
"attributes": {
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"is_active": true,
"is_busy": false,
"queue_length": 0,
"total_tasks_count": 146,
"success_tasks_count": 140,
"failed_tasks_count": 6,
"in_progress_tasks_count": 0,
"waiting_tasks_count": 0,
"avg_waiting_time": "9.0704",
"avg_execution_time": "0.0855"
}
}
}

Validation Error Response

Status Code: 401 Unauthorized

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Property Health object in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.

Update Property

Update property information.

Request
Success Response
Error Response

Request:

PUT https://staging.channex.io/api/v1/properties/:id

Query body (JSON):

{
"property": {
"title": "Demo Hotel",
"currency": "GBP",
"email": "hotel@channex.io",
"phone": "01267237037",
"zip_code": "SA23 2JH",
"country": "GB",
"state": "Demo State",
"city": "Demo Town",
"address": "Demo Street"
"longitude": "-0.2416781",
"latitude": "51.5285582",
"content": {
"description": "Some Property Description Text",
"photos": [{
"url": "https://img.channex.io/af08bc1d-8074-476c-bdb7-cec931edaf6a/",
"position": 0,
"author": "Author Name",
"kind": "photo",
"description": "Room View"
}]
}
}
}

Success Response Example

Status Code: 200 OK

{
"data": {
"type": "property",
"id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"attributes": {
"id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"title": "Demo Hotel",
"is_active": true,
"email": "hotel@channex.io",
"phone": "01267237037",
"currency": "GBP",
"country": "GB",
"state": "Demo State",
"city": "Demo Town",
"address": "Demo Street",
"zip_code": "SA23 2JH",
"latitude": null,
"longitude": null,
"content": {
"description": "Some Property Description Text",
"photos": [{
"author": "Author Name",
"description": "Room View",
"id": "4355439c-df23-4f12-bffd-26476e31dd4a",
"kind": "photo",
"position": 0,
"property_id": "716305c4-561a-4561-a187-7f5b8aeb5920",
"room_type_id": null,
"url": "https://img.channex.io/af08bc1d-8074-476c-bdb7-cec931edaf6a/"
}]
}
},
"relationships": {
"groups": {
"data": [
{
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"type": "group",
"attributes": {
"id": "f5338935-7fe0-40eb-9d7e-4dbf7ecc52c7",
"title": "User Group"
}
}
]
}
}
}
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
"errors": {
"code": "unauthorized",
"title": "Unauthorized"
}
}

Validation Error Response

Status Code: 422 Unprocessable Entity

{
"errors": {
"code": "validation_error",
"title": "Validation Error",
"details": {
"title": [
"can't be blank"
]
}
}
}

Fields

This method use same fields as Create Property method.

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Property object in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided or User not have access to requested Property.

Validation Error Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.