Infobip.Api.SDK
1.0.3
dotnet add package Infobip.Api.SDK --version 1.0.3
NuGet\Install-Package Infobip.Api.SDK -Version 1.0.3
<PackageReference Include="Infobip.Api.SDK" Version="1.0.3" />
paket add Infobip.Api.SDK --version 1.0.3
#r "nuget: Infobip.Api.SDK, 1.0.3"
// Install Infobip.Api.SDK as a Cake Addin #addin nuget:?package=Infobip.Api.SDK&version=1.0.3 // Install Infobip.Api.SDK as a Cake Tool #tool nuget:?package=Infobip.Api.SDK&version=1.0.3
Infobip API C# SDK
This is a C# SDK for Infobip API and you can use it as a dependency to add Infobip APIs features to your application. To use this, you'll need an Infobip account. If you do not own one, you can create a free account here.
Table of contents:
General Info
For Infobip API C# SDK versioning we use Semantic Versioning scheme.
This library is targeting .NET Standard 2.0. When a library is built against a certain version of .NET Standard, it can run on any .NET implementation that implements that version of .NET Standard (or higher)
License
Published under MIT License.
Installation
To start using the Infobip API C# SDK library add it as dependency to your project. You should install Infobip API C# SDK:
Install-Package Infobip.Api.SDK
Or via the .NET Core command line interface:
dotnet add package Infobip.Api.SDK
Either commands, from Package Manager Console or .NET Core CLI, will download and install Infobip API C# SDK and all required dependencies.
Usage Example
Call example used to send WhatsApp text message
public async Task<WhatsAppSingleMessageInfoResponse> SendWhatsAppTextMessage()
{
var configuration = new ApiClientConfiguration(
"https://XYZ.api.infobip.com",
"YOUR_API_KEY_FROM_PORTAL");
var client = new InfobipApiClient(configuration);
var request = new WhatsAppTextMessageRequest
{
From = "FROM_NUMBER",
To = "TO_NUMBER",
MessageId = "MESSAGE_ID",
Content = new WhatsAppTextContent("Message Text!")
};
return await client.WhatsApp.SendWhatsAppTextMessage(request);
}
Exceptions
There are several exceptions defined and they can be thrown by InfobipApiClient class, if some error occurs when calling an API endpoint:
- InfobipException - Occurs during api endpoint call execution in case of general error.
- InfobipRequestNotValidException - Occurs during api endpoint call execution when request model is not valid.
- InfobipBadRequestException - Occurs during api endpoint call execution when http response status code is BadRequest (400).
- InfobipUnauthorizedException - Occurs during api endpoint call execution when http response status code is Unauthorized (401).
- InfobipForbiddenException - Represents errors that occurs during api endpoint call execution in case when http response status code is Forbidden (403).
- InfobipNotFoundException - Represents errors that occurs during api endpoint call execution in case when http response status code is NotFound (404).
- InfobipTooManyRequestsException - Represents errors that occurs during api endpoint call execution in case when http response status code is TooManyRequests (429).
Documentation
Infobip API Documentation can be found here.
Development
Feel free to participate in this open source project by following the standard fork → clone → edit → pull request workflow!
For running Tests you can use Visual Studio or your favorite console.
To run them from console, just change working directory to src directory, and run following command.
dotnet test
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- JsonSubTypes (>= 1.8.0)
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- Microsoft.AspNetCore.WebUtilities (>= 2.2.0)
- Microsoft.Extensions.Http (>= 6.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Net.Http (>= 4.3.4)
- System.Net.Http.Json (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.