Skip to content

Commit c4361b8

Browse files
author
infobip-ci
committed
Update to version 3.0.0
1 parent 23e7339 commit c4361b8

File tree

143 files changed

+19074
-15466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+19074
-15466
lines changed

CHANGELOG.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,48 @@ All notable changes to the library will be documented in this file.
55
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file.
77

8-
## [ [2.1.3](https://github.com/infobip/infobip-api-csharp-client/releases/tag/2.1.2) ] - 2023-12-28
8+
## [ [3.0.0](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v3.0.0) ] - 2024-07-31
9+
10+
🎉 **NEW Major Version of `Infobip.Api.Client`.**
11+
12+
⚠️ **IMPORTANT NOTE:** This release contains breaking changes.
13+
All changes, including breaking changes, are addressed and explained in the list below.
14+
If you find out that something was not addressed properly, please submit an issue.
15+
16+
### Added
17+
- Most recent [Infobip SMS API](https://www.infobip.com/docs/api/channels/sms) feature set.
18+
- Most recent [Infobip Email API](https://www.infobip.com/docs/api/channels/email) feature set.
19+
- Most recent [Infobip 2FA API](https://www.infobip.com/docs/api/platform/2fa) feature set.
20+
- [FileParameter](https://github.com/infobip/infobip-api-csharp-client/blob/master/src/Infobip.Api.Client/Client/FileParameter.cs) class that represents a File passed to the API as a Parameter, allows using different backends for files.
21+
- Added dependency JsonSubTypes 2.0.1
22+
23+
### Changed
24+
- Some products contain a few breaking changes as some API endpoints have changed since last major release. If you have issues when migrating the existing implementation, please check the official API documentation or submit an issue.
25+
- `SendSmsApi`, `ScheduledSmsApi` and `ReceiveSmsApi` classes have been unified into [SmsApi](https://github.com/infobip/infobip-api-csharp-client/blob/master/src/Infobip.Api.Client/Api/SmsApi.cs) class.
26+
- `SendEmailApi`, `ScheduledEmailApi` and `EmailValidationApi` classes have been unified into [EmailApi](https://github.com/infobip/infobip-api-csharp-client/blob/master/src/Infobip.Api.Client/Api/EmailApi.cs) class.
27+
- `EmailStatus` and `SmsStatus` have been unified into [MessageStatus](https://github.com/infobip/infobip-api-csharp-client/blob/master/src/Infobip.Api.Client/Model/MessageStatus.cs) class.
28+
- `EmailPrice` and `SmsPrice` have been unified into [MessagePrice](https://github.com/infobip/infobip-api-csharp-client/blob/master/src/Infobip.Api.Client/Model/MessagePrice.cs) class.
29+
- `EmailReportError` and `SmsError` have been unified into [MessageError](https://github.com/infobip/infobip-api-csharp-client/blob/master/src/Infobip.Api.Client/Model/MessageError.cs) class.
30+
- API key authentication enforced
31+
- DeserializeAsync method in [ApiClient](https://github.com/infobip/infobip-api-csharp-client/blob/master/src/Infobip.Api.Client/Client/ApiClient.cs) class is no longer publicly accessible
32+
- Newtonsoft.Json updated to version 13.0.3
33+
34+
### Removed
35+
- [Basic](https://www.infobip.com/docs/essentials/api-essentials/api-authentication#basic), [IBSSO Token Header](https://www.infobip.com/docs/essentials/api-essentials/api-authentication#ibsso-token-header) and client credentials grant type [OAuth2](https://www.infobip.com/docs/essentials/api-essentials/api-authentication#oauth-20) authentication methods. Use [API Key Header](https://www.infobip.com/docs/essentials/api-essentials/api-authentication#api-key-header) authentication method instead. Example of its usage can be found in the [README](https://github.com/infobip/infobip-api-csharp-client/blob/master/README.md#Quickstart).
36+
- `GlobalConfiguration` utility class. Having static default configuration is error-prone and provides an unnecessary overhead. An ApiClient instance should always be injected in the given API class.
37+
- Unused model classes.
38+
39+
## [ [2.1.3](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v2.1.3) ] - 2023-12-28
40+
941
### Fixed
10-
- Template id being to large to store in integer (https://github.com/infobip/infobip-api-csharp-client/issues/28)
42+
- Template id being too large to store in integer (https://github.com/infobip/infobip-api-csharp-client/issues/28)
43+
44+
## [ [2.1.2](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v2.1.2) ] - 2023-02-20
1145

12-
## [ [2.1.2](https://github.com/infobip/infobip-api-csharp-client/releases/tag/2.1.2) ] - 2023-02-20
1346
### Fixed
1447
- README example (https://github.com/infobip/infobip-api-csharp-client/pull/13)
1548

16-
## [ [2.1.1](https://github.com/infobip/infobip-api-csharp-client/releases/tag/2.1.1) ] - 2022-12-29
49+
## [ [2.1.1](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v2.1.1) ] - 2022-12-29
1750

1851
### Changed
1952
- Newtonsoft.Json updated to 13.0.2
@@ -22,13 +55,13 @@ and this library adheres to [Semantic Versioning](http://semver.org/) as mention
2255
### Fixed
2356
- Memory leak caused by not disposing CancellationTokenSource fixed
2457

25-
## [ [2.1.0](https://github.com/infobip/infobip-api-csharp-client/releases/tag/2.1.0) ] - 2021-10-25
58+
## [ [2.1.0](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v2.1.0) ] - 2021-10-25
2659

2760
### Added
2861
- Support for [Infobip Email API](https://www.infobip.com/docs/api#channels/email)
2962

3063

31-
## [ [2.0.0](https://github.com/infobip/infobip-api-csharp-client/releases/tag/2.0.0) ] - 2021-05-11
64+
## [ [2.0.0](https://github.com/infobip/infobip-api-csharp-client/releases/tag/v2.0.0) ] - 2021-05-11
3265

3366
🎉 **NEW Major Version of `Infobip.Api.Client`.**
3467

CONTRIBUTING.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
# Getting Involved
22

3-
Thanks for your interest in the project, we'd love to have you involved! Check out the sections below to find out more about what to do next...
3+
Thanks for your interest in the project, we'd love to have you involved! Check out sections below to find out more about what to do next...
44

55
## Submitting an Issue
66

7-
If you've seen something that is or might seem like a bug or a mistake in the documentation, or you simply have a suggestion for a new feature, please go ahead and open us [an issue][issue-link].
7+
If you've seen something that is or may seem like a bug or a mistake in documentation, or you simply have a suggestion for a new feature, please go ahead and open [an issue][issue-link].
88
Include as much information as you have.
99

10-
Before you submit your issue please do the archive search first, maybe the same question was already answered or is pending.
10+
Before you submit your issue, please do the archive search first, as there may be a similar question that's already been answered or is pending a response.
1111

12-
If you did not find a related issue among the already asked, feel free to open a new issue.
12+
If you haven't found any related issues among the already asked, feel free to open a new one.
1313

14-
For new feature requests, any sort of bug, anomaly, issue etc. please try to provide us structured information as listed below.
15-
You don't have to follow it to the letter but having it structured like below may save us a lot of time to pinpoint and fix the issue quicker.
14+
For new feature requests, any sort of bug, anomaly, issue, etc. please try to provide information, as structured below.
15+
You don't have to follow it to the letter, but having it structured like below may save us a lot of time to pinpoint and fix the issue quicker.
1616

1717
### New issue structure (bugs, anomalies, improvements...)
1818
Providing the following information will increase the chances of your issue being dealt with quickly:
1919

20-
* **Short TO-THE-POINT Overview** - what seems to be the issue
20+
* **Short TO-THE-POINT Overview** - what seems to be the issue.
2121
* **Description** - more detailed explanation of the issue. The stack trace in cases where it is applicable.
22-
* **Which `Infobip.Api.Client` version(s)** - which library version(s) did you used when occurred with this issue.
23-
* **Environment** - is this a problem with all development/testing/production environments or only specific one(s)?
24-
* **Reproducing** - how did it happen? Is it an isolated anomaly, can you reproduce it, what are the steps to reproduce it?
22+
* **Which `Infobip.Api.Client` version(s)** - which library version(s) did you use when the issue occurred.
23+
* **Environment** - is this a problem with all development/testing/production environments or only a specific one(s)?
24+
* **Reproducing** - how did it happen? Is it an isolated anomaly, can you recreate it, what are the steps to recreate it?
2525
* **Related Issues** - is there something similar to this issue that has been reported before? If so, please tag that issue(s) as a reference.
26-
* **Suggest a Fix** - this code is generated, but perhaps you can point to the part of the code that might be causing the bug.
26+
* **Suggest a Fix** - this code is auto generated, but perhaps you can provide us with your code sample as a fix to the part of the code that is causing the bug.
2727

2828
## Pull requests disclaimer
29-
We will not be accepting pull requests. However, because source code within this repository is **generated**, hence the changes will need to be made by us within library generation configuration.
30-
Having said that, we still fully do encourage you to submit an issue since that will help us track it and keep you up-to-date.
29+
We will not be accepting any pull requests, as the source code within this repository is **auto generated**. Any change needs to be made by us within the library generation configuration.
30+
Having said that, we still fully encourage you to submit an issue, since that will help us track it and keep you up to date.
3131

3232
[issue-link]: https://github.com/infobip/infobip-api-csharp-client/issues/new

README.md

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Infobip API C# Client
22

3+
<img src="https://cdn-web.infobip.com/uploads/2023/01/Infobip-logo.svg" height="93px" alt="Infobip" />
4+
35
[![NuGet](https://badgen.net/nuget/v/Infobip.Api.Client?icon=nuget)](https://www.nuget.org/packages/Infobip.Api.Client)
46
[![MIT License](https://badgen.net/github/license/infobip/infobip-api-csharp-client)](https://opensource.org/licenses/MIT)
57

@@ -8,8 +10,6 @@ To use this library you'll need an Infobip account. You can create a [free trial
810

911
The library is built on top of [OpenAPI Specification](https://swagger.io/specification/) and powered by [OpenAPI Generator](https://openapi-generator.tech/).
1012

11-
<img src="https://udesigncss.com/wp-content/uploads/2020/01/Infobip-logo-transparent.png" height="48px" alt="Infobip" />
12-
1313
#### Table of contents:
1414
* [Documentation](#documentation)
1515
* [General Info](#general-info)
@@ -26,7 +26,7 @@ For `Infobip.Api.Client` versioning we use [Semantic Versioning][semver] scheme.
2626

2727
Published under [MIT License][license].
2828

29-
[.NET Standard 2.0](https://dotnet.microsoft.com/en-us/platform/dotnet-standard#versions) is targeted for usage of this library.
29+
[.NET Standard 2.0](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0) is targeted for usage of this library.
3030

3131
## Installation
3232
Recommended way of library usage is to install it via [NuGet Package Manager](https://www.nuget.org/downloads).
@@ -37,64 +37,63 @@ Within Visual Studio, use the Package Manager UI to browse for `Infobip.Api.Clie
3737
#### Package Manager Console
3838
Alternatively, also within Visual Studio, use the Package Manager Console command:
3939

40-
Install-Package Infobip.Api.Client -Version 2.1.3
40+
Install-Package Infobip.Api.Client -Version 3.0.0
4141

4242
#### .NET CLI
4343
If you are used to .NET CLI, the following command is going to be sufficient for you:
4444

45-
dotnet add package Infobip.Api.Client --version 2.1.3
45+
dotnet add package Infobip.Api.Client --version 3.0.0
4646

4747
### Package reference
4848
Including the package directly into project file is also valid option.
4949

50-
<PackageReference Include="Infobip.Api.Client" Version="2.1.3" />
50+
<PackageReference Include="Infobip.Api.Client" Version="3.0.0" />
5151

5252
## Quickstart
5353

5454
#### Initialize the Client
5555

5656
Before initializing client we have to prepare `Configuration` object for handling authentication.
57-
We support multiple authentication methods, e.g. you can use [API Key Header][authentication-apikey].
58-
In this case value for `ApiKeyPrefix` in example below will be `App`.
57+
The library supports the [API Key Header](https://www.infobip.com/docs/essentials/api-essentials/api-authentication#api-key-header) authentication method.
5958
To see your base URL, log in to the [Infobip API Resource][apidocs] hub with your Infobip account.
6059

6160
```csharp
6261
var configuration = new Configuration()
6362
{
64-
BasePath = "<put your base URL here>",
65-
ApiKeyPrefix = "<put API key prefix here (App/Basic/IBSSO/Bearer)>",
63+
BasePath = "<put your base URL here prefixed by https://>",
6664
ApiKey = "<put your API key here>"
6765
};
6866
```
6967

7068
Next step is to initialize the API client. In this case we're instantiating the SMS API client.
7169
```csharp
72-
var sendSmsApi = new SendSmsApi(configuration);
70+
var smsApi = new SmsApi(configuration);
7371
```
7472

7573
Since library is utilizing the `HttpClient` behind the scene for handling the HTTP calls you can provide your own instance of `HttpClient` to `SendSmsApi` constructor and have a control over its lifecycle.
7674
```csharp
77-
var sendSmsApi = new SendSmsApi(myHttpClientInstance, configuration);
75+
var smsApi = new SmsApi(myHttpClientInstance, configuration);
7876
```
7977

8078
#### Send an SMS
8179
Here's a simple example for sending an SMS message. First prepare the message by creating an instance of `SmsAdvancedTextualRequest` and its nested objects.
8280

8381
```csharp
84-
var smsMessage = new SmsTextualMessage()
85-
{
86-
From = "InfoSMS",
87-
Destinations = new List<SmsDestination>()
82+
var smsMessage = new SmsTextualMessage(
83+
from: "SMSInfo",
84+
destinations: new List<SmsDestination>()
8885
{
8986
new SmsDestination(to: "41793026727")
9087
},
91-
Text = "This is a dummy SMS message sent using Infobip.Api.Client"
92-
};
88+
text: "This is a dummy SMS message sent using Infobip.Api.Client"
89+
);
9390

94-
var smsRequest = new SmsAdvancedTextualRequest()
95-
{
96-
Messages = new List<SmsTextualMessage>() { smsMessage }
97-
};
91+
var smsRequest = new SmsAdvancedTextualRequest(
92+
messages: new List<SmsTextualMessage>
93+
{
94+
smsMessage
95+
}
96+
);
9897
```
9998

10099
Now we can send the message using client instantiated before and inspect the `ApiException` for more information in case of failure.
@@ -103,7 +102,7 @@ You can get the HTTP status code from `ErrorCode` property, and more details abo
103102
```csharp
104103
try
105104
{
106-
var smsResponse = sendSmsApi.SendSmsMessage(smsRequest);
105+
var smsResponse = smsApi.SendSmsMessage(smsRequest);
107106

108107
System.Diagnostics.Debug.WriteLine($"Status: {smsResponse.Messages.First().Status}");
109108
}
@@ -127,7 +126,7 @@ Bulk ID will be received only when you send a message to more than one destinati
127126
For each SMS that you send out, we can send you a message delivery report in real time. All you need to do is specify your endpoint when sending SMS in `notifyUrl` field of `SmsTextualMessage`, or subscribe for reports by contacting our support team.
128127
e.g. `https://{yourDomain}/delivery-reports`
129128

130-
You can use data models from the library and the pre-configured `Newtonsoft.Json` serializer (version 12.0.3).
129+
You can use data models from the library and the pre-configured `Newtonsoft.Json` serializer (version 13.0.3).
131130

132131
Example of webhook implementation:
133132

@@ -146,12 +145,17 @@ If you prefer to use your own serializer, please pay attention to the supported
146145
Library is using custom date format string `yyyy-MM-ddTHH:mm:ss.fffzzzz` when serializing dates. This format does not exactly match the format from our documentation above, but it is the closest possible. This format produces the time zone offset value with `:` as time separator, but our backend services will deserialize it correctly.
147146

148147
#### Fetching delivery reports
149-
If you are for any reason unable to receive real time delivery reports on your endpoint, you can use `messageId` or `bulkId` to fetch them.
148+
If you are for any reason unable to receive real time delivery reports on your endpoint, you can use our [Delivery reports API](https://www.infobip.com/docs/api/channels/sms/logs-and-status-reports/get-outbound-sms-message-delivery-reports) to fetch them.
150149
Each request will return a batch of delivery reports - only once.
150+
You can filter reports by multiple parameters (see API's documentation for full list), for example, by `bulkId`, `bulkId` and `limit` like in the snippet below:
151151

152152
```csharp
153153
int numberOfReportsLimit = 10;
154-
var smsDeliveryResult = sendSmsApi.GetOutboundSmsMessageDeliveryReports(bulkId, messageId, numberOfReportsLimit);
154+
var smsDeliveryResult = smsApi.GetOutboundSmsMessageDeliveryReports(
155+
bulkId: bulkId,
156+
messageId: messageId,
157+
limit: numberOfReportsLimit
158+
);
155159
foreach (var smsReport in smsDeliveryResult.Results)
156160
{
157161
Console.WriteLine($"{smsReport.MessageId} - {smsReport.Status.Name}");
@@ -163,12 +167,11 @@ Infobip API supports Unicode characters and automatically detects encoding. Unic
163167
Use the preview SMS message functionality to verify those details as demonstrated below.
164168

165169
```csharp
166-
var smsPreviewRequest = new SmsPreviewRequest()
167-
{
168-
Text = "Let's see how many characters will remain unused in this message."
169-
};
170+
var smsPreviewRequest = new SmsPreviewRequest(
171+
text: "Let's see how many characters will remain unused in this message."
172+
);
170173

171-
var smsPreviewResponse = sendSmsApi.PreviewSmsMessage(smsPreviewRequest);
174+
var smsPreviewResponse = smsApi.PreviewSmsMessage(smsPreviewRequest);
172175
```
173176

174177
#### Receive incoming SMS
@@ -202,11 +205,11 @@ Check the `CONTRIBUTING` [file][contributing] for details about contributions -
202205
However, if you find something that requires our imminent attention feel free to contact us @ [support@infobip.com](mailto:support@infobip.com).
203206

204207
[apidocs]: https://www.infobip.com/docs/api
205-
[freetrial]: https://www.infobip.com/docs/essentials/free-trial
208+
[freetrial]: https://www.infobip.com/docs/essentials/getting-started/free-trial
206209
[signup]: https://www.infobip.com/signup
207210
[semver]: https://semver.org
208211
[license]: LICENSE
209212
[contributing]: CONTRIBUTING.md
210213
[authentication-apikey]: https://www.infobip.com/docs/essentials/api-authentication#api-key-header
211-
[datetimeformat]: https://www.infobip.com/docs/essentials/integration-best-practices#date-formats
212-
[receive-inbound-sms]: https://www.infobip.com/docs/api#channels/sms/receive-inbound-sms-messages
214+
[datetimeformat]: https://www.infobip.com/docs/essentials/api-essentials/integration-best-practices#date-formats-backward-compatibility
215+
[receive-inbound-sms]: https://www.infobip.com/docs/api/channels/sms/inbound-sms/receive-inbound-sms-messages

0 commit comments

Comments
 (0)