Campaign.Create and HtmlUrl

Hi, all

I'm trying to send a Campaign.Create for a plain text campaign from a Rails environment, which currently results in a collection of errors (most notably "310: HTML Content URL Required" and "311: Invalid HTML Content").

<?xml version='1.0' encoding='UTF-8'?>
   <soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
      <soap:Body>
         <Campaign.Create xmlns='http://api.createsend.com/api/'>
            <ApiKey>XXXXXXX</ApiKey>
            <ClientID>XXXXXXX</ClientID>
            <CampaignName>XXXXXXX</CampaignName>
            <CampaignSubject>XXXXXXX</CampaignSubject>
            <FromName>XXXXXXX</FromName>
            <FromEmail>XXXXXXX</FromEmail>
            <ReplyTo>XXXXXXX</ReplyTo>
            <HtmlUrl>XXXXXXX</HtmlUrl>
            <TextUrl>XXXXXXX</TextUrl>
            <SubscriberListIDs>
               <string>XXXXXXX</string>
            </SubscriberListIDs>
         </Campaign.Create>
      </soap:Body>
    </soap:Envelope>

If I send it like this, with HtmlUrl pointing to some document, I get the 311 error.
If I leave out the HtmlUrl, since I want plain text, I get the 310 error.

So just to make sure I'm on the right page:
The HtmlUrl is the URL to an HTML document which will serve as the content of the html-version of the campaign.
The TextUrl is the same, just for the text version.
Is that correct?

If so, what properties are necessary for the HtmlUrl? And .html extension? An html-roottag?
Is it possible at all to create a text-only campaing via the API?

Thank you for reading
Daniela

Phil Phil, 7 years ago

Hi Daniela,

As it says in the documentation, Campaign.Create is used only for sending campaigns with both html and text content, so i'm afraid a text-only campaign won't be possible using the API.

In terms of what properties are necessary for the HtmlUrl, no it doesn't need to have a .html extension, it needs to be a valid Html document that you could import to our system using the web interface. If it doesn't work there, it won't work through the API either.

If you have any more specific information than that (ie a particular html URL which is failing), you might like to send us a support request and we'll take a peek there.

Phil

dannyKay, 7 years ago
Phil :

As it says in the documentation, Campaign.Create is used only for sending campaigns with both html and text content, so i'm afraid a text-only campaign won't be possible using the API.

Thank you for confirming what I suspected.
Is there any way of tricking the API into sending a text-only newsletter? By manually creating a text-only campaign and then editing and resending it via the API?

Phil :

In terms of what properties are necessary for the HtmlUrl, no it doesn't need to have a .html extension, it needs to be a valid Html document that you could import to our system using the web interface. If it doesn't work there, it won't work through the API either.

I'll keep that in mind.

Phil :

If you have any more specific information than that (ie a particular html URL which is failing), you might like to send us a support request and we'll take a peek there.

I think I'll muddle around for a while and get back to you if I have more specific questions.
Thank you for your help.

Daniela

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098