inMobile.NET.API.Client 4.3.0.44

dotnet add package inMobile.NET.API.Client --version 4.3.0.44
NuGet\Install-Package inMobile.NET.API.Client -Version 4.3.0.44
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="inMobile.NET.API.Client" Version="4.3.0.44" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add inMobile.NET.API.Client --version 4.3.0.44
#r "nuget: inMobile.NET.API.Client, 4.3.0.44"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install inMobile.NET.API.Client as a Cake Addin
#addin nuget:?package=inMobile.NET.API.Client&version=4.3.0.44

// Install inMobile.NET.API.Client as a Cake Tool
#tool nuget:?package=inMobile.NET.API.Client&version=4.3.0.44

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.3.0.44 591 2/29/2024
4.2.0.42 892 1/30/2024
4.1.0.41 2,077 9/6/2023
4.0.0.39 8,795 8/22/2022
4.0.0.38 6,018 4/7/2022
4.0.0.37 1,075 3/8/2022
4.0.0.35 888 2/17/2022
4.0.0.34 885 2/9/2022
4.0.0.33 855 2/8/2022
4.0.0.32 906 2/8/2022
4.0.0.31 928 2/4/2022
4.0.0.30 935 2/4/2022
4.0.0.24 13,738 11/18/2021
4.0.0.16 4,405 8/23/2021
4.0.0.15 776 8/23/2021
4.0.0.11 794 8/23/2021
4.0.0.10 806 8/23/2021
4.0.0.9 854 8/20/2021
4.0.0.8 849 8/20/2021
4.0.0.7 845 8/20/2021
4.0.0.5 816 8/20/2021
4.0.0.4 842 8/20/2021
2.4.0.12 827 11/17/2021
2.4.0.11 1,895 8/23/2021
2.4.0.10 811 8/23/2021
2.4.0.9 789 8/23/2021
2.4.0.8 791 8/23/2021
2.4.0.7 811 8/23/2021
2.4.0.6 817 8/20/2021
2.4.0.5 1,246 8/17/2021
2.4.0.4 16,099 2/26/2021
2.4.0.3 873 2/26/2021
2.4.0.2 866 2/26/2021
2.3.9 916 2/26/2021
2.3.8 3,071 2/19/2021
2.3.6 56,897 1/8/2020
2.3.5 1,176 12/12/2019
2.3.4 1,145 10/1/2019
2.3.2 3,328 6/5/2019
2.3.1 1,133 6/5/2019
2.2.29 18,046 3/14/2018
2.2.27 1,519 3/14/2018
2.2.22 1,489 3/14/2018
2.2.10 1,966 11/24/2017
2.2.9 1,471 10/20/2017
2.2.8 1,402 10/20/2017
2.2.7 1,489 10/6/2017