I can retrieve a data extension from exact traget using something like this:
SoapClient client = new SoapClient();
using (new OperationContextScope(client.InnerChannel))
{
MessageHeader<string> header = new MessageHeader<string>(ExactTargetToken);
var untyped = header.GetUntypedHeader("fueloauth ", "http://exacttarget.com");
OperationContext.Current.OutgoingMessageHeaders.Add(untyped);
RetrieveRequest req = new RetrieveRequest();
req.Properties = new string[] { "TheKeyIUse", "Email" };
req.ObjectType = "DataExtensionObject[TheDataExtensionName]";
req.Filter = new SimpleFilterPart() { Property = "TheKeyIUse", SimpleOperator = SimpleOperators.equals, Value = new[] { "someValue" } };
string msg;
APIObject[] apiObj;
client.Retrieve(req, out msg, out apiObj);
}
Now I need to receive the content of a "publication list". Is that possible through the Soap Api?
Edit:
The request that gets the PublicationList is
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<fueloauth xmlns="http://exacttarget.com">mykey</fueloauth >
<a:MessageID>urn:uuid:985300a9-409b-45e7-ad8f-b756bd10de9c</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<RetrieveRequest>
<ObjectType>List</ObjectType>
<Properties>ListName</Properties>
<Properties>ListClassification</Properties>
</RetrieveRequest>
</RetrieveRequestMsg>
</s:Body>
</s:Envelope>
Best Answer
The API Object for a Publication List is simply a
List
, with aListClassification
property value ofPublicationList
.Object details: List
Some code samples: Retrieving a List from an Account
Here's the C# snippet from the page: