Skip to content

aliBordbar1992/HotelBedsSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HotelBeds SDK

HotelBeds SDK is a wrapper for the HotelBeds APITude and currently implements Activities BOOKINGAPI and Transfers BOOKINGAPI.

Features

  • .NET Core compatible
  • Request builder helpers
  • Easily swap between production and test api

Usage

Easily integrate this library with your .NET core app. In your startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    ...
    //if you want to use ActivitiesBooking
    services.AddActivityApiClient("your api key", "your secret");
    
    //if you want to use TransfersBooking
    services.AddTransferApiClient("your api key", "your secret");
    ...
}

and if you want to use test api urls in development, just do as following:

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    //...
    if (env.IsDevelopment())
    {
        //...
        app.UseActivityTestApi();
        app.UseTransferTestApi();
    }
    //...
}

In your controller, just inject IActivityApi to use activities, and ITransferApi to transfers:

public class ActivityController : ControllerBase
{
    private readonly IActivityApi _activityApi;
    private readonly ITransferApi _transferApi;
    
    public ActivityController(IActivityApi activityApi, ITransferApi transferApi)
    {
        _activityApi = activityApi;
        _transferApi = transferApi;
    }
}

About

Unofficial --|-- An SDK wrapping on HotelBeds Api --|-- https://developer.hotelbeds.com/docs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages