Failed to schedule email campaign through the API

ZvikaZ
Participant

Failed to schedule email campaign through the API

Hi,
I have successfully created the email campaign through the API, however I fail to schedule it.
Here is my input for the schedule:
URL POST: https://api.constantcontact.com/ws/customers/zvikaz/campaigns/1112863780224/schedules
content type: application/xml; charset=UTF-8
Authorization header: correct
Body:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>http://api.constantcontact.com/ws/customers/zvikaz/campaigns/1112887167365/schedules/1</id>
<title>Schedule 'Earth-Day special event at Zvika's shop' to 2013-03-27T08:04:15.089</title>
<link href="/ws/customers/zvikaz/campaigns/1112887167365/schedules/1" rel="edit"/>
<content type="application/vnd.ctct+xml">
<Schedule xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/zvikaz/campaigns/1112887167365/schedules/1">
<ScheduledTime>2013-03-27T08:04:15.089</ScheduledTime>
</Schedule>
</content>
</entry>

 

But the response I get is:
Status: HTTP/1.1 403 Forbidden
Headers:
Connection close
Content-Length 1020
Content-Type text/html;charset=utf-8
Date Wed, 27 Mar 2013 06:07:42 GMT
Cache-Control private, no-cache, no-store, max-age=0, must-revalidate, no-cache="Set-Cookie"
Pragma no-cache
Server Apache
Vary Accept-Encoding,User-Agent
WWW-Authenticate Bearer error='insufficient_scope',
X-Powered-By
Set-Cookie BIGipServerProdAPI=205919242.6695.0000; path=/
Body:

<html><head><title>JBoss Web/2.1.1.SNAPSHOT - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - Access is denied</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Access is denied</u></p><p><b>description</b> <u>Access to the specified resource (Access is denied) has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.1.SNAPSHOT</h3></body></html>

 

Help is highly appreciated.

 

Thanks!

 

1 REPLY 1
Elijah_G
Member

Hello,

 

When you are scheduling a campaign, you will receive a 403 error if the API key which is being used for your application has not been granted access to our scheduling API. I have checked the API key associated with your account and it does currently have scheduling permissions. In order to be sure that it is working, I have re-set the scheduling permission to enabled.

 

If you are using an API key associated with a different account, you will need to send us an email to webservices@constantcontact.com with the username and API key so that we can enable scheduling for you.

 

P.S. I also tested your XML to ensure everything was in working order and there is a small piece missing from your code. Here are the default values:

<updated>2010-11-13T20:03:35.000Z</updated> 
<author> 
<name>Constant Contact</name> 
</author> 

 

These are placed inside of the <entry> and before <content>. You can see the article which lists the full XML for sending a campaign here: http://community.constantcontact.com/t5/Documentation/Scheduling-and-Sending-a-Campaign/ba-p/25113

 

Sincerely,

Elijah G.

Tier 2 Support

Elijah G.
API Support Engineer
Developer Portal

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

Visit Page