HotelBeds SDK is a wrapper for the HotelBeds APITude and currently implements Activities BOOKINGAPI and Transfers BOOKINGAPI.
- .NET Core compatible
- Request builder helpers
- Easily swap between production and test api
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;
}
}