This method retrieves all the members (contacts) in a given list.
Syntax
LM_GetListMembersByListID(ListID, Licensekey)
Request Parameters
Parameter Name | Description | Data Type | Required | Sample Value |
---|---|---|---|---|
ListID | The ID of the list you want to get. | Integer | True | 1234 |
Licensekey | Your license key. | String | True | 00000000-0000-0000-0000-000000000000 |
Response
Returns: LM_GetListMembersByListIDResponse
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#
- Python
- GET Request
- POST Request
- SOAP 1.1 Request
- SOAP 1.1 Response
- SOAP 1.2 Request
- SOAP 1.2 Response
- XML Response
C#
/* https://ws.esendex.us/notifyws/phonenotify.asmx?wsdl was added as a Service Reference and given the name WSDL */
using WSDL;
var client = new PhoneNotifySoapClient(PhoneNotifySoapClient.EndpointConfiguration.PhoneNotifySoap);
var listId = 1234;
var listMembers = await client.LM_GetListMembersByListIDAsync(listId, YOUR_LICENSE_KEY);
var listLength = listMembers.LM_GetListMembersByListIDResult.Length;
Console.WriteLine($"The list {listId} has {listLength} members.");
foreach (var member in listMembers.LM_GetListMembersByListIDResult)
{
Console.WriteLine(Environment.NewLine +
"List Member ID: " + member.ListMemberID + Environment.NewLine +
"Phone Number: " + member.PhoneNumber + Environment.NewLine +
"Client ID: " + member.ClientID + Environment.NewLine +
"First Name: " + member.FirstName + Environment.NewLine +
"Last Name: " + member.LastName);
}
Python
import zeep
client = zeep.Client(wsdl="https://ws.esendex.us/notifyws/phonenotify.asmx?wsdl")
list_id = 1234
license_key = "00000000-0000-0000-0000-000000000000"
result = client.service.LM_GetListMembersByListID(list_id, license_key)
print(result)
GET Request
GET /NotifyWS/PhoneNotify.asmx/LM_GetListMembersByListID?ListID=string&Licensekey=string HTTP/1.1
Host: ws.esendex.us
POST Request
POST /NotifyWS/PhoneNotify.asmx/LM_GetListMembersByListID HTTP/1.1
Host: ws.esendex.us
Content-Type: application/x-www-form-urlencoded
Content-Length: length
ListID=string&Licensekey=string
SOAP 1.1 Request
POST /NotifyWS/PhoneNotify.asmx HTTP/1.1
Host: ws.esendex.us
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ws.esendex.us/NotifyWS/LM_GetListMembersByListID"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<LM_GetListMembersByListID xmlns="https://ws.esendex.us/NotifyWS/">
<ListID>int</ListID>
<Licensekey>string</Licensekey>
</LM_GetListMembersByListID>
</soap:Body>
</soap:Envelope>
SOAP 1.1 Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<LM_GetListMembersByListIDResponse xmlns="https://ws.esendex.us/NotifyWS/">
<LM_GetListMembersByListIDResult>
<LM_ListMembers>
<ListMemberID>int</ListMemberID>
<PhoneNumber>string</PhoneNumber>
<ClientID>string</ClientID>
<FirstName>string</FirstName>
<LastName>string</LastName>
</LM_ListMembers>
<LM_ListMembers>
<ListMemberID>int</ListMemberID>
<PhoneNumber>string</PhoneNumber>
<ClientID>string</ClientID>
<FirstName>string</FirstName>
<LastName>string</LastName>
</LM_ListMembers>
</LM_GetListMembersByListIDResult>
</LM_GetListMembersByListIDResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2 Request
POST /NotifyWS/PhoneNotify.asmx HTTP/1.1
Host: ws.esendex.us
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<LM_GetListMembersByListID xmlns="https://ws.esendex.us/NotifyWS/">
<ListID>int</ListID>
<Licensekey>string</Licensekey>
</LM_GetListMembersByListID>
</soap12:Body>
</soap12:Envelope>
SOAP 1.2 Response
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<LM_GetListMembersByListIDResponse xmlns="https://ws.esendex.us/NotifyWS/">
<LM_GetListMembersByListIDResult>
<LM_ListMembers>
<ListMemberID>int</ListMemberID>
<PhoneNumber>string</PhoneNumber>
<ClientID>string</ClientID>
<FirstName>string</FirstName>
<LastName>string</LastName>
</LM_ListMembers>
<LM_ListMembers>
<ListMemberID>int</ListMemberID>
<PhoneNumber>string</PhoneNumber>
<ClientID>string</ClientID>
<FirstName>string</FirstName>
<LastName>string</LastName>
</LM_ListMembers>
</LM_GetListMembersByListIDResult>
</LM_GetListMembersByListIDResponse>
</soap12:Body>
</soap12:Envelope>
XML Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfLM_ListMembers xmlns="https://ws.esendex.us/NotifyWS/">
<LM_ListMembers>
<ListMemberID>int</ListMemberID>
<PhoneNumber>string</PhoneNumber>
<ClientID>string</ClientID>
<FirstName>string</FirstName>
<LastName>string</LastName>
</LM_ListMembers>
<LM_ListMembers>
<ListMemberID>int</ListMemberID>
<PhoneNumber>string</PhoneNumber>
<ClientID>string</ClientID>
<FirstName>string</FirstName>
<LastName>string</LastName>
</LM_ListMembers>
</ArrayOfLM_ListMembers>