What is $SubID?

SOLVED
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
CTCT 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
CTCT 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
CTCT 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
CTCT 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.

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured