SMS API
AddUnsubscribedNumbers
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 Name | Description | Data Type | Required | Sample Value |
---|---|---|---|---|
LicenseKey | Your license key. | GUID | True | 00000000-0000-0000-0000-000000000000 |
PhoneNumbers | The phone numbers you want to unsubscribe. | Array of String values | True | 7575559999 |
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 start sending, together.