.NET Standard 2.0
dotnet add package inMobile.NET.API.Client --version
NuGet\Install-Package inMobile.NET.API.Client -Version
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="" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add inMobile.NET.API.Client --version
#r "nuget: inMobile.NET.API.Client,"
#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=

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


Official .NET client for the inMobile V4 API

You can always download the latest release as a NuGet package <a href="" >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
    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: 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";

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", ""); // 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"] = "";

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: Create deletion request

var result = client.SmsGdpr.CreateDeletionRequest(new NumberInfo("45", "11223344"));


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. 
.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)
Additional computed target framework(s)
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 164 9/6/2023 5,738 8/22/2022 5,428 4/7/2022 743 3/8/2022 488 2/17/2022 502 2/9/2022 486 2/8/2022 517 2/8/2022 518 2/4/2022 520 2/4/2022 12,319 11/18/2021 2,225 8/23/2021 422 8/23/2021 415 8/23/2021 405 8/23/2021 493 8/20/2021 419 8/20/2021 425 8/20/2021 418 8/20/2021 431 8/20/2021 424 11/17/2021 1,228 8/23/2021 405 8/23/2021 413 8/23/2021 401 8/23/2021 399 8/23/2021 414 8/20/2021 856 8/17/2021 13,974 2/26/2021 430 2/26/2021 450 2/26/2021
2.3.9 426 2/26/2021
2.3.8 2,066 2/19/2021
2.3.6 51,163 1/8/2020
2.3.5 737 12/12/2019
2.3.4 672 10/1/2019
2.3.2 2,329 6/5/2019
2.3.1 694 6/5/2019
2.2.29 17,531 3/14/2018
2.2.27 1,063 3/14/2018
2.2.22 1,029 3/14/2018
2.2.10 1,506 11/24/2017
2.2.9 1,005 10/20/2017
2.2.8 976 10/20/2017
2.2.7 1,038 10/6/2017