Löschen eines Abschnittes - DeleteSection

RequestParameter: DeleteSectionRequest
ResponseParameter: DeleteSectionResponse

Mit Hilfe dieser Methode können Sie einen bestehenden Abschnitt einer Kampagne löschen.

Das Request-Objekt besitzt folgende Felder zur Steuerung der Abfrage:

Campaign Die Kampagne, welche den zu löschenden Abschnitt enthält
Section Der zu löschende Abschnitt

Das Response-Objekt enthält keine Information.

 

Codebeispiel
//Create an instance of the service agent 
ServiceAgent agent = new ServiceAgent(); 
TemplateRequest request = new TemplateRequest(); 
request.SecurityContext = GetSecurityContext(); 
//Get the templates from mailworx 
TemplateResponse response = agent.GetTemplates(request); 
 //get the campaigns in work 
CampaignsRequest campaignRequest = new CampaignsRequest(); 
campaignRequest.SecurityContext = GetSecurityContext(); 
campaignRequest.Language = "DE"; 
campaignRequest.Type = CampaignType.InWork; 
campaignRequest.ResponseDetail =  
    CampaignResponseDetailInfo.BasicInformation | 
    CampaignResponseDetailInfo.Sections; 
CampaignsResponse campaignResponse = 
    agent.GetCampaigns(campaignRequest);
 //select a campaign 
Campaign campaign = campaignResponse.Campaigns[0]; 
//find the template of the campaign 
Template template =  
    templateResponse.Templates.First(t =>  
                               t.Guid == campaign.TemplateGuid);

//get all section definitions SectionDefinitionRequest secDefRequest =     new SectionDefinitionRequest(); secDefRequest.SecurityContext = GetSecurityContext(); secDefRequest.Template = template; SectionDefinitionResponse secDefResponse =     agent.GetSectionDefinitions(secDefRequest); //select SectionDefinition SectionDefinition secDef = secResponse.SectionDefinitions[0]; //create new Section Section newSection = new Section(); newSection.Created = DateTime.Now; newSection.SectionDefinitionName = secDef.Name; newSection.Fields = secDef.Fields; newSection.StatisticName = "my new section"; foreach (Field field in newSection.Fields) {     field.UntypedValue = "set some usefull value"; } //create request CreateSectionRequest secRequest =     new CreateSectionRequest(); secRequest.SecurityContext = GetSecurityContext(); secRequest.Campaign = campaign; secRequest.Section = newSection; //create the section CreateSectionResponse secResponse =     agent.CreateSection(secRequest);