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.

excel file to add multiple contacts using classic asp

Highlighted
New Member

excel file to add multiple contacts using classic asp

Can anyone help me to add multiple records from my excel file using classic asp.


Thank you for your help

6 REPLIES 6
Highlighted
Employee

Re: Classic ASP

Hello,



The functionality to add multiple records in a bulk upload can be done through our API's using the Bulk Activities API.  Using our Bulk Activities does require you to be uploading 25 or more contacts at a time.  If you are uploading less than 25 contacts at a time we recommend using our Contact Collection API.



While it is possible to use our API's in Classic ASP, we do not currently have any examples for this. It is possible to also upload an excel file through our user interface, by logging into your account and going to the Contacts tab, and then clicking Add/Import.



If you have any further questions please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
New Member

Classic asp

 Thank you for your reply.. this is the code to upload txt file with more than 25  records.. It returns error code 400. Please tell where i am going wrong.


I am taking my file from html <input> control from the previous page.


 I think the problem might be with highlighted line in the code.. Please check and reply...


 


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Untitled Document</title>

</head>



<body>

<%



UN = "ABC"

PW = "ABC"

OptInSource="ACTION_BY_CUSTOMER"

API_Key = "ABC"

List_ID = "2"

filename = request.Form("contact")

response.write(PostDataToURL(List_ID, "POST", UN,PW,API_Key, filename))



Function PostDataToURL(List_ID,strMethod, UN,PW,API_Key, filename)

Dim lngTimeout

Dim strUserAgentString

Dim intSslErrorIgnoreFlags

Dim blnEnableRedirects

Dim blnEnableHttpsToHttpRedirects

Dim strHostOverride

Dim strLogin

Dim strPassword

Dim strResponseText

Dim objWinHttp

Dim entry

Dim Base_URL

Dim UpdateTimeStamp





lngTimeout = 59000

strUserAgentString = "http_requester/0.1"

intSslErrorIgnoreFlags = 0

blnEnableRedirects = True

blnEnableHttpsToHttpRedirects = True

strHostOverride = ""

strLogin = API_Key & "%" & UN

strPassword = PW

UpdateTimeStamp = date()



strPostData="activityType=SV_ADD&dataFile=" & filename &"&lists=http%3A%2F%2Fapi.constantcontact.com%2Fws%2Fcustomers%2FABC%2Flists%2F2"

Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")

objWinHttp.SetTimeouts lngTimeout, lngTimeout, lngTimeout, lngTimeout

objWinHttp.Open strMethod,"https://api.constantcontact.com/ws/customers/ABC/activities"

If strMethod = "POST" Then

objWinHttp.setRequestHeader "Content-type", "multipart/form-data"

End If

If strHostOverride <> "" Then

objWinHttp.SetRequestHeader "Host", strHostOverride

End If

objWinHttp.Option(0) = strUserAgentString

objWinHttp.Option(4) = intSslErrorIgnoreFlags

objWinHttp.Option(6) = blnEnableRedirects

objWinHttp.Option(12) = blnEnableHttpsToHttpRedirects

If (strLogin <> "") And (strPassword <> "") Then

objWinHttp.SetCredentials strLogin, strPassword, 0

End If

On Error Resume Next

objWinHttp.Send(strPostData)

If Err.Number = 0 Then

If objWinHttp.Status = "200" Then

PostDataToURL = objWinHttp.ResponseText

Else



select case objWinHttp.Status

case "409"

PostDataToURL="2"&vbtab&"Already Exists"



case "201"

PostDataToURL="1"&vbtab&"Added successfully"



case "400"

PostDataToURL="0"&vbtab&":Bad Request. Check Submitted Data"

case else

PostDataToURL = "0"&vbtab&":" & objWinHttp.Status & " " &objWinHttp.StatusText

end select

End If

Else

PostDataToURL = "Error " & Err.Number & " " & Err.Source & " " & _

Err.Description

End If

On Error GoTo 0

Set objWinHttp = Nothing

End Function



%>

</body>

</html>


 


Regards,


Ali

 

Highlighted
Employee

Classic asp

Hi Ali,


I just wanted to let you know that we have recieved your post and are looking at it to see what we can do to resolve this. I will update this thread as soon as I have any updates. Thank you.

David J

Highlighted
Employee

Re: Classic asp

Unfortunately we do not have anyone here that is familiar with classic ASP to assist in troubleshooting this. I have done a fair amount of research on this and found that most people recommend using a component to assist in the file upload process. These are typically much faster and easier than attempting to modify an existing script to do this. One of the more useful articles I found on this is located at http://classicasp.aspfaq.com/forms/how-do-i-upload-files-from-the-client-to-the-server.html. This contains links to a number of free and paid components that can assist with this.


 


I hope that this helps and apologize for any inconvenience that this issue has caused. Please let us know if you have any other questions or concerns and we will be happy to help.

David J

Highlighted
New Member

Hi, i have made an excel

Hi, i have made an excel document with a table in it so i can type in some numbers and it will do calculations on it. I was just wondering if there was anyway to kind of turn this excel file into some sort of exe or flash file, something to make it full screen or just to have all the editing tools blacked out so its just the table with my inputs? I want to be able to click an icon on my desktop and it will just load up my table. If anyone knows the type of thing i want i would be very grateful. Thanks orange county web designer

Highlighted
Employee

Re: Hi, i have made an excel

Unfortunately this is really more of a general question not really related to Constant Contact. If you have questions about using any of that data within Constant Contact, I would be more than happy to assist with that. I am also not really to direct you to a more relevant website as I am not sure what programming languages are familiar with or which you would prefer to use. I apologize for any inconvenience this causes. If you have any other questions or concerns regarding Constant Contact, please let me know and I will be happy to help.

David J

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