inMobile.NET.API.Client
4.4.0.45
dotnet add package inMobile.NET.API.Client --version 4.4.0.45
NuGet\Install-Package inMobile.NET.API.Client -Version 4.4.0.45
<PackageReference Include="inMobile.NET.API.Client" Version="4.4.0.45" />
paket add inMobile.NET.API.Client --version 4.4.0.45
#r "nuget: inMobile.NET.API.Client, 4.4.0.45"
// Install inMobile.NET.API.Client as a Cake Addin #addin nuget:?package=inMobile.NET.API.Client&version=4.4.0.45 // Install inMobile.NET.API.Client as a Cake Tool #tool nuget:?package=inMobile.NET.API.Client&version=4.4.0.45
inMobile-.NET-API-Client
Official .NET client for the inMobile V4 API
You can always download the latest release as a NuGet package <a href="https://www.nuget.org/packages/inMobile.NET.API.Client/" >here.</a>
Create a client
var apiKey = new InMobileApiKey("My secret key");
var client = new InMobileApiClient(apiKey: apiKey);
Sending SMS messages
SMS: Send messages
// Wrap the following in a try/catch - should also be done for all calls to the api
try
{
var result = client.SmsOutgoing.SendSmsMessages(new List<OutgoingSmsMessageCreateInfo>() {
new OutgoingSmsMessageCreateInfo(to: "4511223344", text: "Hello world", from: "FancyShop", statusCallbackUrl: null)
});
// statusCallbackUrl: Specify a url if you want report callbacks
}
catch (InMobileApiException ex)
{
Console.WriteLine("Unexpected exception: " + ex.Message);
}
SMS: Send messages using template
var result = client.SmsOutgoing.SendSmsMessagesUsingTemplate(new OutgoingSmsTemplateCreateInfo(
templateId: new SmsTemplateId("MY-TEMPLATE-ID"),
new List<OutgoingSmsTemplateMessageCreateInfo>
{
new OutgoingSmsTemplateMessageCreateInfo(
placeholders: new Dictionary<string, string>(),
to: "4511223344",
statusCallbackUrl: null)
}));
// statusCallbackUrl: Specify a url if you want report callbacks
SMS: Cancel messages
var result = client.SmsOutgoing.CancelMessages(new List<OutgoingMessageId>
{
new OutgoingMessageId("MESSAGE-ID-1"),
new OutgoingMessageId("MESSAGE-ID-2")
});
SMS: Pull message statuses
Note that this is the PULL version of getting statuses.
var reports = client.SmsOutgoing.GetStatusReports(limit: 10); // Limit must be between 1 and 250.
Blacklist
Blacklist: Add
var blacklistEntry = client.Blacklist.Add(new NumberInfo(countryCode: "45", phoneNumber: "11223344"));
Blacklist: Get all
var allBlacklistEntries = client.Blacklist.GetAll();
Blacklist: Get by id
var blacklistEntry = client.Blacklist.GetById(blacklistEntryId: new BlacklistEntryId("7b69cc8c-aafd-4697-917a-6ecd314def5e"));
Blacklist: Get by number
var blacklistEntry = client.Blacklist.GetByNumber(new NumberInfo(countryCode: "45", phoneNumber: "12345678"));
Blacklist: Remove by id
client.Blacklist.RemoveById(blacklistEntryId: new BlacklistEntryId("f0d0767b-5f9e-4d33-8155-1c29fefd8238"));
Blacklist: Remove by number
client.Blacklist.RemoveByNumber(new NumberInfo(countryCode: "45", phoneNumber: "12345678"));
Lists and recipients
Lists: Create
var createdList = client.Lists.CreateList(name: "My list name");
Lists: Get all
var allLists = client.Lists.GetAllLists();
Lists: Get by id
var list = client.Lists.GetListById(listId: new RecipientListId("af20c37d-c9d2-4343-8c46-8c8fbc5c5b14"));
Lists: Update (without loading the list first)
var updatedList = client.Lists.UpdateList(new RecipientListUpdateInfo(
listId: new RecipientListId("ff5d0e4f-02a3-4930-8bb8-11da43bd7ab8"),
name: "New list name"));
This will reduce the network latency during the whole operation and considerably reduce the risk of lost updates compared to the next example with (load, update, save).
Lists: Update (load, update, save)
var list = client.Lists.GetListById(listId: new RecipientListId("ff5d0e4f-02a3-4930-8bb8-11da43bd7ab8"));
list.Name = "New list name";
client.Lists.UpdateList(list);
There could be a risk of lost updates, if multiple sources manipulate the recipients at the same time.
Lists: Delete by id
client.Lists.DeleteListById(listId: new RecipientListId("1b6415e9-9f94-419a-9d9b-21974f6586e7"));
Recipients: Create
var newRecipient = new RecipientCreateInfo(listId: new RecipientListId("a2e2dfee-4a45-44b7-98fd-223399c31dba"),
numberInfo: new NumberInfo(countryCode: "45", phoneNumber: "11223344"));
newRecipient.Fields.Add("email", "some_email@mywebsite.com"); // Optional
var createdRecipient = client.Lists.CreateRecipient(recipient: newRecipient);
Recipients: Get all
var allRecipients = client.Lists.GetAllRecipientsInList(listId: new RecipientListId("6e076753-3d8e-4603-8ff8-66b6b6d8ff82"));
Recipients: Get by id
var recipient = client.Lists.GetRecipientById(listId: new RecipientListId("6e076753-3d8e-4603-8ff8-66b6b6d8ff82"),
recipientId: new RecipientId("d317de6f-234c-401d-9bd8-6eaa3b5f3b35"));
Recipients: Get by number
var recipient = client.Lists.GetRecipientByNumber(
listId: new RecipientListId("0dd17a28-c392-486c-8f8d-8ab897b07c39"),
numberInfo: new NumberInfo(countryCode: "45",
phoneNumber: "12345678"));
Recipients: Update (without loading the recipient first)
client.Lists.UpdateRecipient(new RecipientUpdateInfo(
recipientId: new RecipientId("d317de6f-234c-401d-9bd8-6eaa3b5f3b35"),
listId: new RecipientListId("6e076753-3d8e-4603-8ff8-66b6b6d8ff82"),
numberInfo: new NumberInfo("33", "999999"),
fields: new Dictionary<string, string>() {
{ "firstname", "Bill" },
{ "Custom2", "Val2" }
}));
This will reduce the network latency during the whole operation and considerably reduce the risk of lost updates compared to the next example with (load, update, save).
Recipients: Update (load, update, save)
// Load recipient
var recipient = client.Lists.GetRecipientById(listId: new RecipientListId("6e076753-3d8e-4603-8ff8-66b6b6d8ff82"),
recipientId: new RecipientId("d317de6f-234c-401d-9bd8-6eaa3b5f3b35"));
// Update desired values (In the example we update the msisdn and the email)
recipient.NumberInfo = new NumberInfo(countryCode: "45", phoneNumber: "99998888");
recipient.Fields["email"] = "some_new_email@mydomain.com";
There could be a risk of lost updates, if multiple sources manipulate the recipients at the same time.
Recipients: Delete by id
client.Lists.DeleteRecipientById(listId: new RecipientListId("8b481e37-8709-455a-9b74-74efe99ac7de"),
recipientId: new RecipientId("a99317fc-141a-4848-8672-367750bc61b0"));
Recipients: Delete by number
client.Lists.DeleteRecipientByNumber(listId: new RecipientListId("8b481e37-8709-455a-9b74-74efe99ac7de"),
numberInfo: new NumberInfo(
countryCode: "45",
phoneNumber: "12345678"));
SMS Templates
SMS Templates: Get all
var allSmsTemplates = client.SmsTemplates.GetAll();
SMS Templates: Get by id
var smsTemplate = client.SmsTemplates.GetById(new SmsTemplateId("MY-TEMPLATE-ID"));
SMS GDPR
SMS GDPR: Create deletion request
var result = client.SmsGdpr.CreateDeletionRequest(new NumberInfo("45", "11223344"));
Tools
Tools: Parse mobile numbers
var result = client.Tools.ParsePhoneNumbers(new List<ParsePhoneNumberInfo>
{
new ParsePhoneNumberInfo("DK", "+45 11 22 33 44")
});
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. |
.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
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
4.4.0.45 | 2,744 | 8/14/2024 |
4.3.0.44 | 4,942 | 2/29/2024 |
4.2.0.42 | 1,631 | 1/30/2024 |
4.1.0.41 | 2,866 | 9/6/2023 |
4.0.0.39 | 11,013 | 8/22/2022 |
4.0.0.38 | 6,166 | 4/7/2022 |
4.0.0.37 | 1,147 | 3/8/2022 |
4.0.0.35 | 920 | 2/17/2022 |
4.0.0.34 | 913 | 2/9/2022 |
4.0.0.33 | 884 | 2/8/2022 |
4.0.0.32 | 934 | 2/8/2022 |
4.0.0.31 | 955 | 2/4/2022 |
4.0.0.30 | 964 | 2/4/2022 |
4.0.0.24 | 15,577 | 11/18/2021 |
4.0.0.16 | 6,123 | 8/23/2021 |
4.0.0.15 | 807 | 8/23/2021 |
4.0.0.11 | 823 | 8/23/2021 |
4.0.0.10 | 832 | 8/23/2021 |
4.0.0.9 | 881 | 8/20/2021 |
4.0.0.8 | 877 | 8/20/2021 |
4.0.0.7 | 870 | 8/20/2021 |
4.0.0.5 | 842 | 8/20/2021 |
4.0.0.4 | 872 | 8/20/2021 |
2.4.0.12 | 860 | 11/17/2021 |
2.4.0.11 | 2,572 | 8/23/2021 |
2.4.0.10 | 838 | 8/23/2021 |
2.4.0.9 | 816 | 8/23/2021 |
2.4.0.8 | 822 | 8/23/2021 |
2.4.0.7 | 842 | 8/23/2021 |
2.4.0.6 | 843 | 8/20/2021 |
2.4.0.5 | 1,275 | 8/17/2021 |
2.4.0.4 | 16,853 | 2/26/2021 |
2.4.0.3 | 896 | 2/26/2021 |
2.4.0.2 | 895 | 2/26/2021 |
2.3.9 | 955 | 2/26/2021 |
2.3.8 | 3,256 | 2/19/2021 |
2.3.6 | 61,460 | 1/8/2020 |
2.3.5 | 1,203 | 12/12/2019 |
2.3.4 | 1,170 | 10/1/2019 |
2.3.2 | 3,713 | 6/5/2019 |
2.3.1 | 1,160 | 6/5/2019 |
2.2.29 | 18,098 | 3/14/2018 |
2.2.27 | 1,549 | 3/14/2018 |
2.2.22 | 1,516 | 3/14/2018 |
2.2.10 | 2,009 | 11/24/2017 |
2.2.9 | 1,524 | 10/20/2017 |
2.2.8 | 1,426 | 10/20/2017 |
2.2.7 | 1,512 | 10/6/2017 |