Receiving 310 error 'HTML Content URL Required' when creating campaign

Hi there,

I'm trying to create a campaign using the CM API and I'm receiving an error..

I receive an error from the API:
stdClass Object ( [Code] => 310 [Message] => HTML Content URL Required )

The URL I am passing is this (path is the path to the PHP file):
http://path/display.php?pt=mediarelease&type=html&id=3080


The PHP Code is:
$args = array(
                       'Subject' => $post->post_title,
                       'Name' => $post->post_title + time(),
                       'FromName' => get_option('cm_from_name'),
                       'FromEmail' =>  get_option('cm_from_email'),
                       'ReplyTo' =>  get_option('cm_reply_to'),
                       'HtmlUrl' => "http://path/display.php?pt=mediarelease&type=html&id=".$post->ID,
                       'TextUrl' => get_bloginfo("url") . "/path/display.php?pt=mediarelease&type=text&id=".$post->ID,
                       'ListIDs' => $subscribers
);

$campaign = $cm_campaign->create(get_option('cm_client_id'), $args);

return $campaign->response;


Can someone please help as I have a deadline to have this up and running for the client by the end of the week!

Thanks
Jami

Phil Phil, 4 years ago

Hi Jami,

It's hard to troubleshoot these things without precise details, so if my suggestions here don't help, i'd advise contacting support with more specific information.

But most likely you're receiving that error because the eventual value of HtmlUrl isn't accessible to our servers. You need to ensure that anything you put into HtmlUrl and TextUrl is visible to the web in general. Is it a public page, or something limited to just your intranet? For example, can you see it from home, or in a web proxy like kproxy?

Phil

Join 150,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