2

I want to retrieve the Email object associated with the TriggeredSendDefinition in Exact Target. For this, I am trying to find the location of Email (i.e. Folder ID of the associated Email) for the triggeredSend. I tried retrieving the Email object but it said "Error: The Request Property(s) Email do not match with the fields of TriggeredSendDefinition retrieve". I am required to do this using code (API). Please help.

EDIT

I have tried the following 

String requestID;
String status;
APIObject[] results;
RetrieveRequest rr = new RetrieveRequest{
    ObjectType = "TriggeredSendDefinition",
    Properties =  new string[] { "CustomerKey", "Email.Folder", "Email.Name" }
};
SimpleFilterPart sfp = new SimpleFilterPart{
        Property = "CustomerKey",
        SimpleOperator = SimpleOperators.equals,
        Value = "expiry_notice"
};
rr.Filter = sfp;
soapClient.Retrieve(rr, out requestID, out results);
foreach (TriggeredSendDefinition df in results)
{
    Console.WriteLine(df.CustomerKey + " " + df.Email.Name+" " + df.Email.Folder);
}
  • Do you have any sample code of what you did try? – Kelly J Andrews Feb 17 '14 at 2:06
  • Have you tried removing the .folder and .name and just print out the email object? I don't write in C# typically, so trying to eliminate any obvious issues. I'm thinking tying to call the objects in this way is causing you headaches. – Kelly J Andrews Feb 19 '14 at 15:28
1

The call you are making is to retrieve an Email object, filtered on CustomerKey by the value expiry_notice. In it you are passing Properties = new string[] { "CustomerKey", "Email" } which isn't working. Email is not one of the listed properties on the email object. Also, when you specify properties, you only get those listed in the return.

Delete the line Properties = new string[] { "CustomerKey", "Email" } and it should return the folder information you are looking for.

  • I had mistake in the code I typed here. The ObjectType is supposed to be TriggeredSendDefinition. It has Email object defined inside. – user6872 Feb 18 '14 at 22:50
  • In a similar fashion - remove the properties, and see if you can get to it from there. I think it's the properties line that is causing you to not be able to get to the objects properly. – Kelly J Andrews Feb 19 '14 at 15:29

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.