Error 400 (The requested URL returned error: 400)

vali_sec
Regular Participant

Error 400 (The requested URL returned error: 400)

 I'm trying to add a campaign and i get error 400 message.


This is my xml:


 


<entry xmlns="http://www.w3.org/2005/Atom">


<link href="/ws/customers/vali_osf/campaigns" rel="edit" />


<id>http://api.constantcontact.com/ws/customers/vali_osf/campaigns</id>


<title type="text">127/2010-10-06</title>


<updated>2010-10-06T12:55:32+03:00</updated>


<author>


<name>Constant Contact</name>


</author>


<content type="application/vnd.ctct+xml">


<Campaign xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/vali_osf/campaigns/2">


<Name>127/2010-10-06</Name>


<Status>Sent</Status>


<Date>2010-10-06T12:55:32 03:00</Date>


<Subject>Campanie vali</Subject>


<FromName>vali_osf@yahoo.com</FromName>


<ViewAsWebpage>NO</ViewAsWebpage>


<ViewAsWebpageLinkText></ViewAsWebpageLinkText>


<ViewAsWebpageText></ViewAsWebpageText>


<PermissionReminder>NO</PermissionReminder>


<PermissionReminderText></PermissionReminderText>


<GreetingSalutation>Dear</GreetingSalutation>


<GreetingName>FirstName</GreetingName>


<GreetingString></GreetingString>


<OrganizationName>my_organization</OrganizationName>


<OrganizationAddress1>Bucuresti</OrganizationAddress1>


<OrganizationAddress2></OrganizationAddress2>


<OrganizationAddress3></OrganizationAddress3>


<OrganizationCity>Bucuresti</OrganizationCity>


<OrganizationState></OrganizationState>


<OrganizationInternationalState></OrganizationInternationalState>


<OrganizationCountry>Romania</OrganizationCountry>


<OrganizationPostalCode>123456</OrganizationPostalCode>


<IncludeForwardEmail>YES</IncludeForwardEmail>


<ForwardEmailLinkText>Daca vreti sa trimiteti acest mesaj mai departe</ForwardEmailLinkText>


<IncludeSubscribeLink>NO</IncludeSubscribeLink>


<SubscribeLinkText></SubscribeLinkText>


<EmailContentFormat>HTML</EmailContentFormat>


<EmailContent>&lt;html>&lt;body>body&lt;/body>&lt;/html>


</EmailContent>


<EmailTextContent>&lt;Text>&lt;/Text></EmailTextContent>


<StyleSheet></StyleSheet>


<ContactLists>


<ContactList id="http://api.constantcontact.com/ws/customers/vali_osf/lists/1">


<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/vali_osf/lists/1" rel="self" />


</ContactList>


</ContactLists>


<FromEmail>


<Email id="http://api.constantcontact.com/ws/customers/vali_osf/settings/emailaddresses/1">


<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/vali_osf/settings/emailaddresses/1" rel="self" />


</Email>


<EmailAddress>vali_osf@yahoo.com</EmailAddress>


</FromEmail>


<ReplyToEmail>


<Email id="http://api.constantcontact.com/ws/customers/vali_osf/settings/emailaddresses/1">


<link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/vali_osf/settings/emailaddresses/1" rel="self" />


</Email>


<EmailAddress>vali_osf@yahoo.com</EmailAddress>


</ReplyToEmail>


</Campaign>


</content>


<source>


<id>http://api.constantcontact.com/ws/customers/vali_osf/campaigns</id>


<title type="text">Campaigns for customer: vali_osf</title>


<link href="campaigns" />


<link href="campaigns" rel="self" />


<author>


<name>vali_osf</name>


</author>


<updated>2010-10-06T12:55:32+03:00</updated>


</source>


</entry> 


Can you please help me becouse i cant find wat's wrong with my xml. Thanks


 


 

4 REPLIES 4
DaveBerard
Moderator

I was able to use your XML against my account without any modifications and created the campaign.  My guess on what is wrong is that the account specific data, such as lists or emailaddresses, is incorrect or you are trying to create a campaign who's name is already used (which would return a 409 conflict error).  What is the exact error message you're receiving?

Dave Berard
Senior Product Manager, Constant Contact
vali_sec
Regular Participant

 yes.....you were right. Thanks.

vali_sec
Regular Participant

 if i send a campaign with "Sent" status, why it is changed to draft? i want to send it right away when i sent it to the server....

DaveBerard
Moderator

All campaigns created through this API are set as Draft status.  Scheduling a Campaign to send requires special access to our Scheduling API.  To request access, please send an email to our AppConnect team for approval.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page