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.

What is $SubID?

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

6 REPLIES 6
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
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
Occasional Contributor

Re: What is $SubID?

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

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)
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