1

My client has been successfully creating and scheduling Email Send Definitions via the SOAP API in what they call the standard version. Now they are Enterprise customers so I have been working to ensure the process that is already working continues to work. So far most of the changes have been to add the ClientID to the subscriber list, the email and the Send Definition since they now have multiple Business Units. Everything is working except when it comes time to schedule the Email Send Definition, then I get an Error Code 2

The Status Message is:

"Exception occurred during [ScheduleEmailSendDefinition] ErrorID: 1459951015"

The code I am using to create the Email Send Definition is this:

ClientID clientID = new ClientID();
clientID.ID = account_id;
clientID.IDSpecified = true;

String requestId = null;
String overallStatus = null;

//Define the EmailSendDefinition EmailSendDefinition
sendDef = new EmailSendDefinition();
sendDef.Name = "Test";
sendDef.CustomerKey = "Test";
sendDef.Description = "Used for automation";
sendDef.CategoryID = 819712;
sendDef.CategoryIDSpecified = true;
sendDef.Client = clientID;

//Specify Email
ExactTargetClient.Email email = new ExactTargetClient.Email();
email.ID = emailID;  //ID from validated email
email.IDSpecified = true;
email.Client = clientID;

//Specify SendClassification
SendClassification sc = new SendClassification();
sc.CustomerKey = "Default Commercial";
//Commercial
classification sc.Client = clientID;

//Specify the SendDefinitionList
SendDefinitionList[] defList = new SendDefinitionList[1];
defList[0] = new SendDefinitionList();
defList[0].SendDefinitionListTypeSpecified = true;
defList[0].SendDefinitionListType = SendDefinitionListTypeEnum.SourceList;
defList[0].DataSourceTypeID = DataSourceTypeEnum.List;
defList[0].DataSourceTypeIDSpecified = true;

List list = new List();
list.ID = listID;
list.IDSpecified = true;
list.Client = clientID;
defList[0].List = list;
defList[0].Client = clientID;

SenderProfile profile = new SenderProfile();
profile.CustomerKey = "Default";
profile.Client = clientID;
sendDef.SenderProfile = profile;

//Associate the email, the sendclassification, and SendDefinitionList
sendDef.Email = email;
sendDef.SendClassification = sc;
sendDef.SendDefinitionList = defList;

CreateResult[] results = etFramework.Create(new CreateOptions(), new APIObject[] { sendDef } , out requestId, out overallStatus);

And then the code to schedule the Email Send Definition:

String pRequestId = null;
String pOverAllStatus = null;
String statusMessage = null;

ClientID clientID = new ClientID();
clientID.ID = account_id;
clientID.IDSpecified = true;

ScheduleDefinition sd = new ScheduleDefinition();
sd.Occurrences = 1;
sd.OccurrencesSpecified = true;

DateTime time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, scheduledTime.Hour, scheduledTime.Minute, 0, DateTimeKind.Local);
sd.StartDateTime = time;
sd.StartDateTimeSpecified = true;
sd.Client = clientID;

//sendDef was created above
sendDef.CustomerKey = "Test";
sendDef.Client = clientID;
ScheduleResult[] perfResults = etFramework.Schedule(new ScheduleOptions(), "start", sd, new APIObject[] { sendDef }, out pOverAllStatus, out statusMessage, out pRequestId);
4
  • Are you creating the SendDefinition in a separate BU or is it being created in the Top Level BU? Are you able to see it created in the ExactTarget UI when logging into your account as well?
    – Jeremy
    Commented Aug 13, 2014 at 4:09
  • It is being created in a separate BU and I can see it created in the ExactTarget UI.
    – Mark Eaton
    Commented Aug 13, 2014 at 14:42
  • Is this the correct endpoint to use for Enterprise? webservice.exacttarget.com/Service.asmx
    – Mark Eaton
    Commented Aug 26, 2014 at 15:35
  • I am still not having any luck. Another possibility is that when I retrieve the Email Send Definition via the API, I am not retrieving all of the necessary fields. Here are the properties I am retrieving: request.Properties = new string[] { "Name", "ObjectID", "Description", "Email.ID", "CategoryID", "SendDefinitionList", "CustomerKey","Client.ID" }; Do I need more properties? This works fine in the non-Enterprise version.
    – Mark Eaton
    Commented Aug 27, 2014 at 15:39

2 Answers 2

1

The problem was the ScheduleOptions for the schedule message needed to specify a Client ID

1
  • 1
    Mark, the above was a semi automated message. But basicly the question would be if you could add some more explanation or a small code sample. That way the answer becomes more valueable to others running into this in the future. Commented Sep 3, 2014 at 21:36
0

Here's an example of what the soap should look like:

<ScheduleRequestMsg>
<Options>
    <Client><ClientID>12345678</ClientID></Client>
</Options></ScheduleRequestMsg>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .