cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

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

All Star

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

1 REPLY 1
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!

 

Sincerely,

Elijah G.
API Support Engineer