The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Resource not found when trying to delete email campaign schedule object with Java API


Resource not found when trying to delete email campaign schedule object with Java API

Hi There,


When requesting the deletion of an eMail campaign schedule using dthe following code: 


public void unschedule(Campaign camp) throws ConstantContactServiceException {
cc.deleteEmailCampaignSchedule(camp.getId(), camp.getScheduleId());


and campaign and schedule id values recently obtained through the Java api, I get the following error:


CUrlRequestError [errorKey=http.status.not_found, errorMessage=No matching resource was found for the supplied URL.], 

CUrlRequestError [errorKey=url, errorMessage=]]


Note that the id is identical in both cases. I have run the code on the debugger and these ids are both definitely supplied from the Java API, I haven't mistakenly put the campaign Id into the scheduleId. 


If appreciate any thoughts on how to fix this.


Many thanks,


James Hamilton

Honored Contributor

Re: Resource not found when trying to delete email campaign schedule object with Java API

Hello James,


I have been looking into this issue you're experiencing and found two specific things that should help you to resolve the problem:

  1. From the URL provided, your code is using the same ID for both the campaign and the schedule (1119918593485). Each of these two items will have a unique ID. Campaign schedules are handled as a collection, and you can do a GET on that collection to get the schedule ID by calling cc.getEmailCampaignSchedules(String campaignId)
  2. After reviewing the code, I did not see a method named 'getScheduleId' that was part of any of the email campaign classes. Is this a custom method that you have implemented? If so, you would need to change this to function as mentioned in item #1 so that it is fetching the schedule ID and not the campaign ID


If you have any questions about this, please let us know!



Elijah G.
API Support Engineer
Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More