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.

What is $SubID?

SOLVED
Go to solution
Highlighted
Occasional Contributor

What is $SubID?

Can anybody explain what value i have to assign for $SubID?

From my php code I am trying to send the request:

 

https://api.constantcontact.com/ws/customers/".$UN."/contacts/".$SubID

 

which shows 404 error.

 

I am trying to add a new email to my contactlist.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Employee

Re: What is $SubID?

What are you trying to do with this URI?  Are you doing a post, put, get, or delete?  A 415 error usually means you are making an invalid type of HTTPS call to the uri.  Such as trying to do a POST to a contacts ID.

 

If you are trying to add a contact to your account, you would do a POST to the https://api.constantcontact.com/ws/customers/username/contacts URI.

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact

View solution in original post

6 REPLIES 6
Highlighted
Employee

Re: What is $SubID?

Hello,

 

This depends on what you are doing.  Are you trying to add a new contact?  If you are, then the URI you would be sending to would be "https://api.constantcontact.com/ws/customers/username/contacts" and you would not have anything after contacts.

 

If you are updating or retreiving information on a specific contact, then the variable would be the contacts ID.

 

If you have any questions please let me know.

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
Occasional Contributor

Re: What is $SubID?

I modified url, but now getting Error 415 Unsupported media type. I am using <content type="application/vnd.ctct+xml"> in my code.

Highlighted
Employee

Re: What is $SubID?

What are you trying to do with this URI?  Are you doing a post, put, get, or delete?  A 415 error usually means you are making an invalid type of HTTPS call to the uri.  Such as trying to do a POST to a contacts ID.

 

If you are trying to add a contact to your account, you would do a POST to the https://api.constantcontact.com/ws/customers/username/contacts URI.

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact

View solution in original post

Highlighted
Occasional Contributor

Re: What is $SubID?

ok. after i used curl_setopt($session, CURLOPT_POST, 1); the problem is resolved. Thanks for the help.

Highlighted
Occasional Contributor

"Error 400: You must have content for your letter400

hello.... When we create a campaign we used '.$html.' for adding dynamic html content from the fckeditor for sending email. But it cause an error "Error 400: You must have content for your letter400" and the mail sending function failed. $html contains the data .If we hardcoded html in tags it works.

 

Thanks in advance

Tags (2)
Highlighted
Employee

Re: "Error 400: You must have content for your letter400

Hello,

 

Are you HTML encoding the HTML inside of the variable?  If you are not that is probably why it is failing.

 

If you are, then I would need to see your code to figure out exactly what is wrong.  You could send it here and we will review it.

 

Thanks,

Benjamin Soder
NOC Analyst
Constant Contact
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
Featured