We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

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=https://api.constantcontact.com/v2/emailmarketing/campaigns/1119918593485/schedules/1119918593485]]


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


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