Getting the create contact API to work in classic ASP

Regular Participant

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="""">" & _
     "<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="""">" & _
      "<EmailAddress>" & email_address & "</EmailAddress>" & _
      "<OptInSource>ACTION_BY_CONTACT</OptInSource>" & _
         "<ContactLists>" & _
       "<ContactList id="""" />" & _
      "</ContactLists>" & _
      "</Contact>" & _
      "</content>" & _

 Set CC_http_request = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
 CC_http_request.Open "POST", "", 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,




Regular Participant

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. 

Hi Shane,


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



Ryan Davis
Quality Engineer
Developer Portal

View API documentation, code samples, get your API key.

Visit Page