This method unsubscribes one or more phone numbers from a license key. Unsubscribed numbers will no longer receive any messages you send.

Endpoint

POST:
https://messaging.esendex.us/Messaging.svc/AddUnsubscribedNumbers

Syntax

AddUnsubscribedNumbers(LicenseKey, PhoneNumbers)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
LicenseKeyYour license key.GUIDTrue00000000-0000-0000-0000-000000000000
PhoneNumbersThe phone numbers you want to unsubscribe.Array of String valuesTrue7575559999

Response

Returns: Array of UnsubscribedNumberResult objects

Code Samples

You can use any programming language you want with our API, as long as it can make a REST or SOAP call. Here are examples for some of the most common platforms.

C#

// https://messaging.esendex.us/Messaging.svc?wsdl was added as a Service Reference and given the name WSDL

using WSDL;

var client = new MessagingClient(MessagingClient.EndpointConfiguration.mms2wsHttpBindingSecure);
var numbers = new string[] { "7575559999" };
var unsubscribedNumbers = await client.AddUnsubscribedNumbersAsync(YOUR_LICENSE_KEY, numbers);

foreach (var number in unsubscribedNumbers)
{
    Console.WriteLine(
        "Phone Number: " + number.PhoneNumber + Environment.NewLine +
        "Error: " + number.Error + Environment.NewLine +
        "Success: " + number.IsSuccess + Environment.NewLine);
}

JSON Response

[
	{
		"Error": "String content",
		"IsSuccess": true,
		"PhoneNumber": "String content"
	}
]

XML Response

<ArrayOfUnsubscribedNumberResult xmlns="http://sms2.cdyne.com">
  <UnsubscribedNumberResult>
    <Error>String content</Error>
    <IsSuccess>true</IsSuccess>
    <PhoneNumber>String content</PhoneNumber>
  </UnsubscribedNumberResult>
  <UnsubscribedNumberResult>
    <Error>String content</Error>
    <IsSuccess>true</IsSuccess>
    <PhoneNumber>String content</PhoneNumber>
  </UnsubscribedNumberResult>
</ArrayOfUnsubscribedNumberResult>

Let’s get your business buzzing

Spark customer connections in minutes. Discover the full power of our mobile messaging platform—no hidden fees, just real results.