From CDYNE Wiki
Revision as of 13:17, 20 November 2017 by imported>Bdriggers
Jump to navigation Jump to search

Retrieve a list of all recipient numbers who have opted out of your messaging campaign.

GetUnsubscribedNumbers Request

Parameter Name Data Type Sample Input Required
LicenseKey: Required to authenticate users invoking this Web Service.
Trial Key
Production Key
GUID f01d89fd-5155-5455-5585-e84ab8de8591 TRUE

GetUnsubscribedNumbers Response

Parameter Name Data Type Sample Output
EntryDate: UTC date and time recipient unsubscribed from campaign. DateTime 1999-05-31T11:20:00
PhoneNumber: Phone number removed from recipient list. String 15551234567

HTTP GET Request


require 'net/http' require 'URI'

puts URI.methods

url = URI.parse("")

res = Net::HTTP.get_response(url)

data = res.body

puts data gets data


/* was added as Service Reference and given the name WSDL*/

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GetUnsubscribedNumbers.WSDL;

namespace GetUnsubscribedNumbers {

   class Program
       static void Main(string[] args)
           MessagingClient client = new MessagingClient("mms2wsHttpBinding");
           UnsubscribedNumber[] resp = client.GetUnsubscribedNumbers(new Guid("f01d89fd-5155-5455-5585-e84ab8de8591"));
           foreach (var item in resp)
               Console.WriteLine("Phone Number: " + item.PhoneNumber + Environment.NewLine + 
                                 "Entry Date: "+ item.EntryDate + Environment.NewLine + Environment.NewLine);



' was added as Service Reference and given the name WSDL

Imports GetUnsubscribedNumbers.WSDL

Module Module1

   Sub Main()
       Dim client As WSDL.MessagingClient = New MessagingClient("mms2wsHttpBinding")
       Dim resp As GetUnsubscribedNumbers.WSDL.UnsubscribedNumber() = client.GetUnsubscribedNumbers(New Guid("f01d89fd-5155-5455-5585-e84ab8de8591"))
       For Each item In resp
           Console.WriteLine("Phone Number: " + item.PhoneNumber + Environment.NewLine +
                             "UTC Entry Date: " + item.EntryDate + Environment.NewLine)
   End Sub

End Module

PHP with cURL



$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_HTTPGET,true); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Accept: application/json'));

$response = curl_exec($ch); curl_close($ch);

$array = json_decode($response, true);




Dim oXMLHTTP Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP") Set oDoc = CreateObject("MSXML2.DOMDocument")

Call oXMLHttp.Open("GET", "", False) Call oXMLHttp.setRequestHeader("Content-Type", "text/xml") Call oXMLHttp.send

MsgBox oXMLHTTP.responseText

Const ForReading = 1, ForWriting = 2, ForAppending = 8 Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 Dim fso, MyFile, FileName, TextLine Set fso = CreateObject("Scripting.FileSystemObject") FileName = "c:\Users\Desktop\MMS.txt" Set MyFile = fso.OpenTextFile(FileName, ForWriting, True) MyFile.WriteLine oXMLHttp.responseText MyFile.Close Set MyFile = fso.OpenTextFile(FileName, ForReading) Do While MyFile.AtEndOfStream <> True TextLine = MyFile.ReadLine Loop


set request = nothing


import; import; import; import; import java.util.Properties; import javax.xml.transform.OutputKeys; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import; import;

public final class GetUnsubscribedNumbers {

   public static void main(String[] args) {
       try {
           URL url = new URL(""
                   + "LicenseKey=f01d89fd-5155-5455-5585-e84ab8de8591");
           try {
               InputStream in = url.openStream();
               StreamSource source = new StreamSource(in);
           } catch ( e) {
       } catch (MalformedURLException e) {
   private static void printResult(Source source) {
       try {
           ByteArrayOutputStream bos = new ByteArrayOutputStream();
           StreamResult sr = new StreamResult(bos);
           Transformer trans = TransformerFactory.newInstance().newTransformer();
           Properties oprops = new Properties();
           oprops.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
           trans.transform(source, sr);
           System.out.println("**** Response ******");
       } catch (Exception e) {