CONNECTIVITY API

Connect Channel Manager API

Technical documentation for the method that connects a property to Channel Manager and enables all connectivity permissions.

Description

This endpoint is used to connect a property with Channel Manager. It loads the property from the database, records or updates the connectivity history, and enables a predefined set of connectivity permissions for that property.

Endpoint

POST /connectChannelManager

Request

Content-Type: application/json

Authorization: Bearer <token>

Field Type Description
Id Long Property identifier
Request Body Example
{
  "id": 15
}

Process

  • A list of 8 ConnectivityPrefDTO objects is created manually, all with status = true.
  • The Property is retrieved from the database using propertyIdDto.getId().
  • The method checks whether a ConnectivityHistory entry already exists for the property.
  • If a history entry exists, its dateConnected field is updated with the current date.
  • If no history entry exists, a new ConnectivityHistory object is created and saved.
  • The method iterates through all predefined connectivity preferences.
  • For each item, the related ConnectivityInfo is loaded from the database.
  • The method checks whether the connectivity preference already exists for the given property, permission name, and OTA name.
  • If the preference already exists and the status is false, the existing entry is deleted.
  • If the preference does not exist and the status is true, a new ConnectivityPreferences entry is created and saved.
  • After all permissions are processed, the endpoint returns true.

Main Objects Used

The method uses PropertyIdDto, Property, ConnectivityPrefDTO, ConnectivityInfo, ConnectivityPreferences, and ConnectivityHistory.

Notes

  • If the specified property or related connectivity information does not exist, the operation may result in an exception due to the way the data is retrieved.
  • The lookup of connection history assumes that at least one record is always present, which may lead to issues if the result is unexpectedly empty.
  • The set of connectivity permissions is predefined using fixed identifiers, which reduces flexibility in case changes are made to the permissions configuration.
  • The method uses different naming conventions for the OTA, which may lead to inconsistencies and should be reviewed to ensure alignment.
  • The endpoint always returns a successful response and does not provide detailed information about potential errors.
  • Adopting a transactional approach and returning more structured responses would improve reliability and make the endpoint more suitable for production use.