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.

Contacts CSV Export showing 'State/Province (Other)' instead of 'State/Province (US/Canada)'

Occasional Participant

Contacts CSV Export showing 'State/Province (Other)' instead of 'State/Province (US/Canada)'

When I try to create contacts CSV export using following request, I am getting 'Other State/Province' instead of 'State/Province (US/Canada)'

Request:
activityType=EXPORT_CONTACTS&fileType=CSV&exportOptDate=true&exportOptSource=true&exportListName=true&sortBy=DATE_DESC&columns=FIRST%20NAME&columns=LAST%20NAME&columns=EMAIL%20ADDRESS&columns=ADDRESS%20LINE%201&columns=ADDRESS%20LINE%202&columns=ADDRESS%20LINE%203&columns=CITY&columns=STATE&columns=COUNTRY&columns=POSTAL%20CODE&listId=http%3A%2F%2Fapi.constantcontact.com%2Fws%2Fcustomers%2Fali.salman%2Flists%2F1

Response:
Email Address,List: General Interest,Date Added,Added By,First Name,Last Name,,Address Line 1,Address Line 2,Address Line 3,City,Other State/Province,Country,Zip/Postal Code
"t3@techno-soft.com",2/25/09 4:21 AM EST,Site owner,"aa","bb",,"ad1","ad1","ad1","city1",,"United States","12345"

Also second header column in response 'List: General Interest' should not be there and one empty header column between Last Name and Address Line 1 is misplaced.
8 REPLIES 8
Highlighted
Moderator

RE: Contacts CSV Export showing 'State/Province (Other)' instead

Thanks Technosoft folks, I see the field exporting just as you are. Since we don't have options to differentiate the US State/Province and the Other State/Province, this definitely looks like a defect. We'll take a look at this and get back to you soon.
Dave Berard
Senior Product Manager, Constant Contact
New Member

Update

Any update on this?
Bill Mild
www.Mild.net
Moderator

Hi Bill, We actually updated

Hi Bill,

We actually updated the Bulk Activity to fix this issue in a recent software release. The updated documentation on the field names is here. You can now decide whether you want to export US/Canada State, Other State/Province or both.
Dave Berard
Senior Product Manager, Constant Contact
Participant

export throuh Activity collection (400 bad request error)

Hi ,

I am using bulk activities collection.
I want to export the contacts under a contact list. I am using the following code for that.
But I am getting 400 Bad request error. Please help me out to find where could be the error.
The following is the method I am using.

Regards
Pradeep.
private string Export()
{
string sUserName = "USERNAME";
string sPassWord = "PASSWORD";
string sUri = "http://api.constantcontact.com/ws/customers/" + sUserName + "/activities";
string sAPIKey = "CCAPIKEY";
string sListUri = "http://api.constantcontact.com/ws/customers/" + sUserName + "/lists/2";
Uri address = new Uri(sUri);
HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
request.Credentials = new NetworkCredential((sAPIKey + "%" + sUserName), sPassWord);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded ";
StringBuilder data = new StringBuilder();
data.Append("activityType=" + HttpUtility.UrlEncode("EXPORT_CONTACTS", Encoding.UTF8));
data.Append("&fileType=" + HttpUtility.UrlEncode("CSV", Encoding.UTF8));
data.Append("&exportOptDate=" + HttpUtility.UrlEncode("true", Encoding.UTF8));
data.Append("&exportOptSource=" + HttpUtility.UrlEncode("true", Encoding.UTF8));
data.Append("&exportListName=" + HttpUtility.UrlEncode("true", Encoding.UTF8));
data.Append("&sortBy=" + HttpUtility.UrlEncode("true", Encoding.UTF8));
data.Append("&columns=" + HttpUtility.UrlEncode("Email Address" , Encoding.UTF8));
data.Append("&columns=" + HttpUtility.UrlEncode("First Name", Encoding.UTF8));
data.Append("&columns=" + HttpUtility.UrlEncode("Last Name", Encoding.UTF8));
data.Append("&lists=" + HttpUtility.UrlEncode(sListUri));
byte[] byteData = UTF8Encoding.UTF8.GetBytes(data.ToString());
string st = String.Empty;
request.ContentLength = byteData.Length;
using (Stream postStream = request.GetRequestStream())
{
postStream.Write(byteData, 0, byteData.Length);
}
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
st = reader.ReadToEnd();
}
return st;

}

___and please tell me how could i access the CSV file created.
Valued Developer

re: Export through Activity Collection

Hello,

I see at least two problems with the data provided in this request and each of those problems provided both a 400 error and a reasonable error message when I tried them from the REST Client unit testing tool we discuss here.


First, the column name is "EMAIL ADDRESS", not "Email Address". Second, the value for the sortBy parameter must be EMAIL_ADDRESS or DATE_DESC. It is not a true/false value.

When you successfully POST an activity, your response body will include a reference to the specific submitted ACTIVITY (batch job). You must retrieve that Activity to 1) Check Batch job completion status and 2) Retrieve the CSV file (which will be referenced in the Activity response).

I hope this helps.

Thanks,
Tom M
Group Product Manager – Content Editing
Constant Contact
Participant

Thank you very much Tom

Dear Tom,
i got the response like this




EXPORT_CONTACTS
PENDING
0

2009-05-18T13:52:44.031Z



http://api.constantcontact.com/ws/customers/amanaman/activities/a07e2ipl2rgfuv8k8hr
EXPORT_CONTACTS: Unnamed
2009-05-18T13:52:44.031Z

Constant Contact




but the status is pending. why is it so? will the status be "COMPLETE" after some time?
if so how can I Check batch job completion status?
sorry to disturb in your busy schedule.

please be kind enough to have a quick response, I am waiting.

Thanks in advance,
Pradeep.
Valued Developer

re: Checking Activities Job Completion Status

The Activities resource launches a batch job which is put into a queue of batch jobs. In general, these batch 'Activites' will be be in queue for a matter of minutes (not hours, but also not seconds).

In order to determine whether a specific Activity is completed, you use the URI reference returned in the http response body as you have done above. Your Activity shows 'PENDING' (ie. in queue). You should re-check the activity status (using the same URI) periodically. When the job is completed, the status will show 'COMPLETED' and will contain a reference to the output CSV. For a brief period between 'PENDING' and 'COMPLETED' the Activity will be in status "RUNNING".

Thanks,
Tom M
Group Product Manager – Content Editing
Constant Contact
Participant

Thanks a lot Tom

Thanks, let me go forward.

Regards,
pradeep