1

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>
1

The API Object for a Publication List is simply a List, with a ListClassification property value of PublicationList.

Object details: List

Some code samples: Retrieving a List from an Account

Here's the C# snippet from the page:

RetrieveRequest rr = new RetrieveRequest();
rr.ObjectType = "List";

SimpleFilterPart sf = new SimpleFilterPart();
sf.SimpleOperator = SimpleOperators.equals;
sf.Property = "ListName";
sf.Value = new String[] { listName };

rr.Filter = sf;

rr.Properties = new string[] { "ID", "ListName", "ListClassification" };

status = framework.Retrieve(rr, out requestID, out result);

List l = (List)result[0];
  • This worked. It resulted in a request like i added to the question. I actually need to rceive the subscribers insde of a publicationList. I create a new question for that. – Mathias F May 31 '16 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.