BookingClient 1.0.1

dotnet add package BookingClient --version 1.0.1
                    
NuGet\Install-Package BookingClient -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BookingClient" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BookingClient" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="BookingClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BookingClient --version 1.0.1
                    
#r "nuget: BookingClient, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BookingClient@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BookingClient&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=BookingClient&version=1.0.1
                    
Install as a Cake Tool

BookingClient C# SDK 1.0.0

Welcome to the BookingClient SDK documentation. This guide will help you get started with integrating and using the BookingClient SDK in your project.

Versions

  • API version: 1.0
  • SDK version: 1.0.0

About the API

Partner Connect API Service

Table of Contents

Setup & Configuration

Supported Language Versions

This SDK is compatible with the following versions: C# >= .NET 6

Installation

To get started with the SDK, we recommend installing using nuget:

dotnet add package BookingClient

Authentication

Access Token Authentication

The BookingClient API uses an Access Token for authentication.

This token must be provided to authenticate your requests to the API.

Setting the Access Token

When you initialize the SDK, you can set the access token as follows:

using BookingClient;
using BookingClient.Config;

var config = new BookingClientConfig()
{
	AccessToken = "YOUR_ACCESS_TOKEN"
};

var client = new BookingClientClient(config);

If you need to set or update the access token after initializing the SDK, you can use:

client.SetAccessToken("YOUR_ACCESS_TOKEN")

API Key Authentication

The BookingClient API uses API keys as a form of authentication. An API key is a unique identifier used to authenticate a user, developer, or a program that is calling the API.

Setting the API key

When you initialize the SDK, you can set the API key as follows:

using BookingClient;
using BookingClient.Config;

var config = new BookingClientConfig()
{
	ApiKeyAuth = new ApiKeyAuthConfig("YOUR_API_KEY")
};

var client = new BookingClientClient(config);

If you need to set or update the API key after initializing the SDK, you can use:

client.SetApiKey("YOUR_API_KEY")

Sample Usage

Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:

using BookingClient;
using BookingClient.Config;
using BookingClient.Models;
using Environment = BookingClient.Http.Environment;

var apiKeyConfig = new ApiKeyAuthConfig("YOUR_API_KEY");

var config = new BookingClientConfig
{
  Environment = Environment.Default,
AccessToken = "YOUR_ACCESS_TOKEN",
ApiKeyAuth = apiKeyConfig
};

var client = new BookingClientClient(config);

var booker = new BookerInputDto("gt", BookerInputDto.Platform.Android);
var guests = new GuestsInputDto(5, 0);
var input = new SearchInputDto("checkin", "checkout", booker, guests);

var response = await client.DemandApiV3Compatible.SearchAsync(input, SearchAccept.ApplicationJson);

Console.WriteLine(response);

Services

The SDK provides various services to interact with the API.

<details> <summary>Below is a list of all available services with links to their detailed documentation:</summary>

Name
DemandApiV3CompatibleService
DemandApiV2CompatibleService

</details>

Models

The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.

<details> <summary>Below is a list of all available models with links to their detailed documentation:</summary>

Name Description
SearchInputDto
ResponseOutputListSearchOutputDto
SearchAccept
DetailsInputDto
ResponseOutputListDetailsOutputDto
PostDetailsAccept
ConstantInputDto
ResponseOutputConstantsOutputDto
GetAccommodationConstantsAccept
ResponseOutputV2ReviewScoresOutputDto
ReviewScoresInputDto
GetHotelsReviewScoresAccept
ResponseOutputV2HotelsOutputDto
HotelsInputDto
GetHotelsAccept
ResponseOutputV2HotelTypesOutputDto
HotelTypeInputDto
GetHotelTypesAccept
ResponseOutputV2HotelThemeTypesOutputDto
HotelThemeTypeInputDto
GetHotelThemeTypesAccept
ResponseOutputV2HotelFacilityTypeOutputDto
HotelFacilityInputDto
GetRoomFacilityTypesAccept
ResponseOutputV2HotelAvailabilityOutputDto
HotelAvailabilityInputDto
GetHotelAvailabilityAccept
ResponseOutputV2BlockAvailabilityOutputDto
BlockAvailabilityInputDto
GetBlockAvailabilityAccept
BookerInputDto The booker's information.
GuestsInputDto The guest details for the request.
Coordinates Limit the result list to the specified coordinates.
AllocationInputDto The exact allocation of guests to rooms.
SearchOutputDto
PriceDataDtoDouble The price components of this product or selection of products. 'base' and 'extra_charges' are returned only when explicitly requested (via 'extras=extra_charges').
ProductDto
ExtraChargesDtoDouble The charge breakdown. Includes taxes and fees.
PoliciesDto The policies for this product.
PriceDataDtoListChargeDto The price components of this product or selection of products. 'base' and 'extra_charges' are returned only when explicitly requested (via 'extras=extra_charges').
DealDto This specifies the deal tagging for the product.
CancellationDto The cancellation policy for this product.
MealPlanDto The meal plan policy for this product.
PaymentDto Payment terms and conditions for this product.
ExtraChargesDtoListChargeDto The charge breakdown. Includes taxes and fees.
ChargeDto
DetailsOutputDto
TranslatedString Translated description of this room. The maximum number of characters returned may be limited by contract.
CheckinCheckoutTimesDto
ContactsDto Contact information of the accommodation.
FacilityDto The list of facilities available in this property. Requires {"extras":["facilities"]}.
DescriptionDto Textual information about the accommodation. Requires {"extras":["description"]}.
KeyCollectionInformationDto
LocationDto All location related information of this accommodation property.
PhotoDto
ProgramSettingsDto Details of programmes undergone by the property.
RatingDto
RoomDto The list of room types available at this property. Requires {"extras":["rooms"]}.
LocalTime The time till when checkout can be done at this property.
ContactDto Contact information of the accommodation. It can be null if the data is missing.
TranslationInformation Text containing important information about the property. The value is translated in the requested languages.
TruncatedString The translated description text of this accommodation property in the requested languages. The maximum number of characters returned may be limited by contract.
AlternativeKeyLocationDto Alternate location to collect the key of this accommodation property. This is returned if the key to access the property is in another location.
LazyTranslatedString Translated accommodation address.
CoordinatesDto A signed integer number that uniquely identifies a city.
PhotoUrlDto
BedOptionDto Lists all possible bedding options for this room or apartment.
CribsAndExtraBedsDto Lists room options regarding adding cribs and/or extra beds.
RoomMaximumOccupancyDto Occupancy limits and options.
NumberOfRoomsDto Total rooms available.
BedConfigurationDto Lists all alternative bed configurations that are supported.
BedDto Detail list of all different types and number of beds included in this configuration.
Meta
ReviewScoresOutputDto
ScoreBreakdown A breakdown of scores per reviewer type and review question.
ScoreDistribution A breakdown of all review scores into buckets 1 - 10.
QuestionDto Review scores per question.
HotelsOutputDto
HotelDataDto Hotel specific information.
RoomDataDto This block has room data for this hotel.
HotelPhotoDto Photos specific information of the hotel.
RoomInfoDto
BedroomDto
RoomOccupancyDto
RoomSizeDto
HotelTypesOutputDto
TranslationDto
HotelThemeTypesOutputDto
HotelFacilityTypeOutputDto
HotelAvailabilityOutputDto
BlockAvailabilityOutputDto
BlockOutputDto The object containing all the relevant information for the combination of room, policy, meal and occupancy that determines the price." A block is the unique entity you book with booking.com.

</details>

License

This SDK is licensed under the MIT License.

See the LICENSE file for more details.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 214 9/16/2024
1.0.0 129 7/31/2024