cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the create contact API to work in classic ASP

Occasional Contributor

Getting the create contact API to work in classic ASP

I'm working on getting our site connected and I can't get the API for creating a contact to work.  I think I'm missing the section that uses the API key but I can't find any useful documentation that relates to classic ASP.  Here is my code:

 

 xml_source = "<entry xmlns=""http://www.w3.org/2005/Atom"">" & _
     "<title type=""text""></title>" & _
     "<updated>" & timeStamp & "</updated>" & _
     "<author></author>" & _
     "<id>data:,none</id>" & _
     "<summary type=""text"">Contact</summary>" & _
     "<content type=""application/vnd.ctct+xml"">" & _
     "<Contact xmlns=""http://ws.constantcontact.com/ns/1.0/"">" & _
      "<EmailAddress>" & email_address & "</EmailAddress>" & _
      "<OptInSource>ACTION_BY_CONTACT</OptInSource>" & _
         "<ContactLists>" & _
       "<ContactList id=""http://api.constantcontact.com/ws/customers/RAWLINGSGEAR/lists/6"" />" & _
      "</ContactLists>" & _
      "</Contact>" & _
      "</content>" & _
      "</entry>"

 Set CC_http_request = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
 CC_http_request.Open "POST", "https://api.constantcontact.com/ws/customers/", True  'Open in Asynchronous
 CC_http_request.Send xml_source

 

I have the XML set up as it should be I think but I get no response at all when I send this.  Any help would be great.  Thanks,

 

Kris

 

2 REPLIES 2
Highlighted
Occasional Contributor

Re: Getting the create contact API to work in classic ASP

I have now added a couple lines just about the "Send":

 

CC_http_request.SetCredentials key, password, 0
 CC_http_request.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

 

to try to set the credentials.  This is still not getting any response from Constant Contact. 

Highlighted
CTCT Employee

Re: Getting the create contact API to work in classic ASP

Hi Shane,

 

I am not familiar with Classic ASP however I found this example in our forums.  Please let me know this helps.

 

Thanks,

Ryan Davis
Quality Engineer