You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a C# Client for Infobip API and you can use it as a dependency to add [Infobip APIs][apidocs] to your application.
7
-
To use this, you'll need an Infobip account. If not already having one, you can create a [free trial][freetrial] account [here][signup].
6
+
This is a C# Client for [Infobip API][apidocs] and you can use it as a dependency in your application.
7
+
To use this library you'll need an Infobip account. You can create a [free trial][freetrial] account [here][signup].
8
8
9
-
Built on top of [OpenAPI Specification](https://swagger.io/specification/), powered by [OpenAPI Generator](https://openapi-generator.tech/).
9
+
The library is built on top of [OpenAPI Specification](https://swagger.io/specification/) and powered by [OpenAPI Generator](https://openapi-generator.tech/).
We support multiple authentication methods, e.g. you can use [API Key Header](https://www.infobip.com/docs/essentials/api-authentication#api-key-header). In this case value for `ApiKeyPrefix` in example below will be `App`.
57
-
58
-
To see your base URL, log in to the [Infobip API Resource][apidocs] hub with your Infobip credentials.
56
+
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`.
59
+
To see your base URL, log in to the [Infobip API Resource][apidocs] hub with your Infobip account.
59
60
60
61
```csharp
61
62
varconfiguration=newConfiguration()
@@ -64,8 +65,11 @@ To see your base URL, log in to the [Infobip API Resource][apidocs] hub with you
64
65
ApiKeyPrefix="<put API key prefix here (App/Basic/IBSSO/Bearer)>",
65
66
ApiKey="<put your API key here>"
66
67
};
67
-
68
-
varsendSmsApi=newSendSmsApi(configuration);
68
+
```
69
+
70
+
Next step is to initialize the API client. In this case we're instantiating the SMS API client.
71
+
```csharp
72
+
varsendSmsApi=newSendSmsApi(configuration);
69
73
```
70
74
71
75
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.
@@ -74,7 +78,7 @@ Since library is utilizing the `HttpClient` behind the scene for handling the HT
74
78
```
75
79
76
80
#### Send an SMS
77
-
Simple example for sending an SMS message.
81
+
Here's a simple example for sending an SMS message. First prepare the message by creating an instance of `SmsAdvancedTextualRequest` and its nested objects.
78
82
79
83
```csharp
80
84
varsmsMessage=newSmsTextualMessage()
@@ -92,8 +96,10 @@ Simple example for sending an SMS message.
Send the message and inspect the `ApiException` for more information in case of failure.
99
+
100
+
Now we can send the message using client instantiated before and inspect the `ApiException` for more information in case of failure.
96
101
You can get the HTTP status code from `ErrorCode` property, and more details about error from `ErrorContent` property.
102
+
97
103
```csharp
98
104
try
99
105
{
@@ -136,7 +142,7 @@ Example of webhook implementation:
136
142
returnOk();
137
143
}
138
144
```
139
-
If you prefer to use your own serializer, please pay attention to the supported [date format](https://www.infobip.com/docs/essentials/integration-best-practices#date-formats).
145
+
If you prefer to use your own serializer, please pay attention to the supported [date format][datetimeformat].
140
146
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.
141
147
142
148
#### Fetching delivery reports
@@ -154,6 +160,7 @@ Each request will return a batch of delivery reports - only once.
154
160
155
161
#### Unicode & SMS preview
156
162
Infobip API supports Unicode characters and automatically detects encoding. Unicode and non-standard GSM characters use additional space, avoid unpleasant surprises and check how different message configurations will affect your message text, number of characters and message parts.
163
+
Use the preview SMS message functionality to verify those details as demonstrated below.
157
164
158
165
```csharp
159
166
varsmsPreviewRequest=newSmsPreviewRequest()
@@ -165,8 +172,8 @@ Infobip API supports Unicode characters and automatically detects encoding. Unic
165
172
```
166
173
167
174
#### Receive incoming SMS
168
-
If you want to receive SMS messages from your subscribers we can have them delivered to you in real time. When you buy and configure a number capable of receiving SMS, specify your endpoint as explained [here](https://www.infobip.com/docs/api#channels/sms/receive-inbound-sms-messages).
169
-
e.g. `https://{yourDomain}/incoming-sms`.
175
+
If you want to receive SMS messages from your subscribers we can have them delivered to you in real time.
176
+
When you buy and configure a number capable of receiving SMS, specify your endpoint as explained [here][receive-inbound-sms]e.g. `https://{yourDomain}/incoming-sms`.
170
177
171
178
Example of webhook implementation:
172
179
@@ -184,15 +191,22 @@ Example of webhook implementation:
184
191
#### Two-Factor Authentication (2FA)
185
192
For 2FA quick start guide please check [these examples](two-factor-authentication.md).
186
193
194
+
#### Send email
195
+
For send email quick start guide please check [these examples](email.md).
196
+
187
197
## Ask for help
188
198
189
-
Feel free to open issues on the repository for any issue or feature request. As per pull requests, for details check the `CONTRIBUTING`[file][contributing] related to it - in short, we will not merge any pull requests, this code is auto-generated.
199
+
Feel free to open issues on the repository for any issue or feature request.
200
+
Check the `CONTRIBUTING`[file][contributing] for details about contributions - in short, we will not merge any pull requests since this code is auto-generated.
190
201
191
-
If it is, however, something that requires our imminent attention feel free to contact us @ [support@infobip.com](mailto:support@infobip.com).
202
+
However, if you find something that requires our imminent attention feel free to contact us @ [support@infobip.com](mailto:support@infobip.com).
We support multiple authentication methods, e.g. you can use [API Key Header](https://www.infobip.com/docs/essentials/api-authentication#api-key-header). In this case value for `ApiKeyPrefix` in example below will be `App`.
6
+
7
+
To see your base URL, log in to the [Infobip API Resource](https://www.infobip.com/docs/api) hub with your Infobip credentials.
8
+
9
+
```csharp
10
+
varconfiguration=newConfiguration()
11
+
{
12
+
BasePath="<set your base URL here>",
13
+
ApiKeyPrefix="<set API key prefix here (App/Basic/IBSSO/Bearer)>",
0 commit comments