cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR status when exporting contact lists - v1 API

Highlighted
Occasional Participant

ERROR status when exporting contact lists - v1 API

Lately our site has been experiencing issues when exporting contacts via the v1 API.  The export activity gets created with an initial status of PENDING then QUEUED and then finally ERROR.

 

Activity Creation

 

CURL Log:

 

* About to connect() to api.constantcontact.com port 443 (#0)
*   Trying 54.235.154.59...
* connected
* Connected to api.constantcontact.com (54.235.154.59) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using ECDHE-RSA-AES128-SHA
* Server certificate:
* 	 subject: C=US; ST=Massachusetts; L=Waltham; O=Constant Contact, Inc.; CN=api.constantcontact.com
* 	 start date: 2015-01
* 	 expire date: 2018-01
* 	 subjectAltName: api.constantcontact.com matched
* 	 issuer: C=BE; O
* 	 SSL certificate verify ok.
* Server auth using Basic with user 'REDACTED'
> POST /ws/customers/REDACTED/activities HTTP/1.1
Authorization: Basic REDACTED
User-Agent: justphp 3.0
Host: api.constantcontact.com
Accept: */*
Content-Type: application/x-www-form-urlencoded
Content-Length: 433

* upload completely sent off: 433 out of 433 bytes
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 201 Created
< Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, no-cache="Set-Cookie"
< Content-Location: /ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639
< Content-Type: application/atom+xml; type=entry;charset=UTF-8
< Date: Tue, 06 Oct 2015 16:58:26 GMT
< ETag: "c57185ec51960cc4ad1851e90a0a8511"
< Location: /ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639
< Pragma: no-cache
< Server: Apache
< Vary: Accept-Encoding,User-Agent
< X-Powered-By: 
< transfer-encoding: chunked
< Connection: keep-alive
< 
* Connection #0 to host api.constantcontact.com left intact

 

Here is the parameters (length of  433) that were sent with the post request.

activityType=EXPORT_CONTACTS&fileType=CSV&exportOptDate=true&exportOptSource=true&exportListName=false&sortBy=DATE_DESC&listId=http://api.constantcontact.com/ws/customers/REDACTED/lists/1569774267&columns=FIRST NAME&columns=LAST NAME&columns=ADDRESS LINE 1&columns=CITY&columns=STATE&columns=STATE/PROVINCE (US/CANADA)&columns=POSTAL CODE&columns=CUSTOM FIELD 1&columns=CUSTOM FIELD 2&columns=CUSTOM FIELD 3&

 

Response:

 

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <content type="application/xml">
    <Activity xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639">
      <Type>EXPORT_CONTACTS</Type>
      <Status>PENDING</Status>
      <FileName>upload_from_xml.csv</FileName>
      <TransactionCount>0</TransactionCount>
      <Errors>0</Errors>
    </Activity>
  </content>
  <link href="/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639" rel="edit"></link>
  <id>http://api.constantcontact.com/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639</id>
  <title type="text">EXPORT_CONTACTS: upload_from_xml.csv</title>
  <updated>2015-10-06T16:58:27.424Z</updated>
  <author>
    <name>Constant Contact</name>
  </author>
  <link href="/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639" rel="edit"></link>
</entry>

 

 

Checking on Activity Status (Queued)

CURL Log:

 

* About to connect() to api.constantcontact.com port 443 (#0)
*   Trying 54.235.154.59...
* connected
* Connected to api.constantcontact.com (54.235.154.59) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using ECDHE-RSA-AES128-SHA
* Server certificate:
* 	 subject: C=US; ST=Massachusetts; L=Waltham; O=Constant Contact, Inc.; CN=api.constantcontact.com
* 	 start date: 2015-01
* 	 expire date: 2018-01
* 	 subjectAltName: api.constantcontact.com matched
* 	 issuer: C=BE; O
* 	 SSL certificate verify ok.
* Server auth using Basic with user 'REDACTED'
> GET /ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639 HTTP/1.1
Authorization: Basic REDACTED
User-Agent: justphp 3.0
Host: api.constantcontact.com
Accept: */*
Content-Type: text/html

* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
< Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, no-cache="Set-Cookie"
< Content-Type: application/atom+xml; type=entry;charset=UTF-8
< Date: Tue, 06 Oct 2015 16:58:28 GMT
< ETag: "d7c24693a095e7b0e229173128f0fa5e"
< Pragma: no-cache
< Server: Apache
< Vary: Accept-Encoding,User-Agent
< X-Powered-By: 
< transfer-encoding: chunked
< Connection: keep-alive
< 
* Connection #0 to host api.constantcontact.com left intact

 

 

Response:

 

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <link href="/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639" rel="edit"></link>
  <id>http://api.constantcontact.com/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639</id>
  <title type="text">EXPORT_CONTACTS: Unnamed</title>
  <updated>2015-10-06T16:58:27.000Z</updated>
  <author>
    <name>Constant Contact</name>
  </author>
  <content type="application/vnd.ctct+xml">
    <Activity xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639">
      <Type>EXPORT_CONTACTS</Type>
      <Status>QUEUED</Status>
      <TransactionCount>0</TransactionCount>
      <Errors>0</Errors>
      <InsertTime>2015-10-06T16:58:27.000Z</InsertTime>
    </Activity>
  </content>
  <source>
    <id>http://api.constantcontact.com/ws/customers/REDACTED/activities</id>
    <title type="text">Activities for customer: REDACTED</title>
    <link href="activities"></link>
    <link href="activities" rel="self"></link>
    <author>
      <name>REDACTED</name>
    </author>
    <updated>2015-10-06T16:58:28.579Z</updated>
  </source>
</entry>

 

Checking on Activity Status (ERROR)

 

CURL Log:

* About to connect() to api.constantcontact.com port 443 (#0)
*   Trying 54.235.154.59...
* connected
* Connected to api.constantcontact.com (54.235.154.59) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using ECDHE-RSA-AES128-SHA
* Server certificate:
* 	 subject: C=US; ST=Massachusetts; L=Waltham; O=Constant Contact, Inc.; CN=api.constantcontact.com
* 	 start date: 2015-01
* 	 expire date: 2018-01
* 	 subjectAltName: api.constantcontact.com matched
* 	 issuer: C=BE; O
* 	 SSL certificate verify ok.
* Server auth using Basic with user 'REDACTED'
> GET /ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639 HTTP/1.1
Authorization: Basic REDACTED
User-Agent: justphp 3.0
Host: api.constantcontact.com
Accept: */*
Content-Type: text/html

* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
< Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, no-cache="Set-Cookie"
< Content-Type: application/atom+xml; type=entry;charset=UTF-8
< Date: Tue, 06 Oct 2015 17:11:32 GMT
< ETag: "f6e901401ec121ca9e8664b66a74022d"
< Pragma: no-cache
< Server: Apache
< Vary: Accept-Encoding,User-Agent
< X-Powered-By: 
< transfer-encoding: chunked
< Connection: keep-alive
< 
* Connection #0 to host api.constantcontact.com left intact

Response:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <link href="/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639" rel="edit"></link>
  <id>http://api.constantcontact.com/ws/customers/REDACTEDm/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639</id>
  <title type="text">EXPORT_CONTACTS: Unnamed</title>
  <updated>2015-10-06T16:58:31.000Z</updated>
  <author>
    <name>Constant Contact</name>
  </author>
  <content type="application/vnd.ctct+xml">
    <Activity xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/REDACTED/activities/76a48a70-6c4b-11e5-9e6f-d4ae529a8639">
      <Type>EXPORT_CONTACTS</Type>
      <Status>ERROR</Status>
      <TransactionCount>2879</TransactionCount>
      <Errors>0</Errors>
      <RunStartTime>2015-10-06T16:58:30.000Z</RunStartTime>
      <RunFinishTime>2015-10-06T16:58:31.000Z</RunFinishTime>
      <InsertTime>2015-10-06T16:58:27.000Z</InsertTime>
    </Activity>
  </content>
  <source>
    <id>http://api.constantcontact.com/ws/customers/REDACTED/activities</id>
    <title type="text">Activities for customer: REDACTED</title>
    <link href="activities"></link>
    <link href="activities" rel="self"></link>
    <author>
      <name>REDACTED</name>
    </author>
    <updated>2015-10-06T17:11:32.928Z</updated>
  </source>
</entry>

Thanks!!

 

7 REPLIES 7
Honored Contributor

Re: ERROR status when exporting contact lists - v1 API

Hello,

 

Thank you for the detailed information! After doing some digging in on this, it looks like the cause behind the export failure is some bad data that gets picked up when exporting based on list (which is how the API works). For the immediate term, you can work around this by manually exporting the contacts through the UI, as the approach is slightly different and avoids this problem.

 

For the long-term, I am working with the team on our side to clean up this data, and we should hopefully be able to have that done quickly.

 

If you have any questions, please let me know!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Participant

Re: ERROR status when exporting contact lists - v1 API

Elijah_G,

 

Thank you for the quick response.  Is there anything that can be done on our end to prevent bad data from coming into the system.  Most of the contacts and list additions/removals happen from within our application so if we can scrub the data to prevent this from happening in the future we'd like to do so.

 

If you could also let us know of any offending records that caused this please do so. 

 

Thanks!

Honored Contributor

Re: ERROR status when exporting contact lists - v1 API

Hello,

 

After a great deal of work last night by a number of people, we discovered that the issue was in fact a combination of two issues, with one being in our V1 API and one being in our platform for generating export files. The nature of these issues lead us to initially believe that there was some bad data involved, but it appears that is not the case.

 

While this is caused by an issue on our side that is actively being worked on by our developers, there is a workaround that I was able to get success with during my testing. The workaround is to add "&columns=EMAIL ADDRESS" to the body of your POST. While it should not be required to specify this column, that will allow you to work around the problem that causes the activities to end in ERROR status.

 

Here is an example of the body you would send after the change:

activityType=EXPORT_CONTACTS&fileType=CSV&exportOptDate=true&exportOptSource=true&exportListName=false&sortBy=DATE_DESC&listId=http://api.constantcontact.com/ws/customers/REDACTED/lists/1569774267&columns=EMAIL ADDRESS&columns=FIRST NAME&columns=LAST NAME&columns=ADDRESS LINE 1&columns=CITY&columns=STATE&columns=STATE/PROVINCE (US/CANADA)&columns=POSTAL CODE&columns=CUSTOM FIELD 1&columns=CUSTOM FIELD 2&columns=CUSTOM FIELD 3&

Please note that the username has been removed from the example payload and replaced with "REDACTED" to protect your account details.

 

If you have any questions, please let me know!

 

Sincerely,

 

 

Elijah G.
API Support Engineer
Occasional Participant

Re: ERROR status when exporting contact lists - v1 API

Thank you very much. That seems to have done the trick for the  meantime.

 

Is this something that I will need to remove at a later date?

Honored Contributor

Re: ERROR status when exporting contact lists - v1 API

You should not have to revert that change in the future. The work we are doing on our end will result in that always being included by default, but there will be no harm in including it explicitly.

 

Please let us know if you see any other unexpected behavior and we will be happy to investigate it.

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Participant

Re: ERROR status when exporting contact lists - v1 API

Thank you Elijah_G.

 

One final question: Is the V1 API going away at any point in the near future?  We rely on a Drupal Module for our base Constant Contact functionality that uses V1.  If this version is going away I'd like to at least let the community know that this is the case so we can work on upgrading the module for V2 at an accelerated rate.

 

Thanks!

Honored Contributor

Re: ERROR status when exporting contact lists - v1 API

While the V1 API is currently in a deprecated state(Meaning that we are only performing fixes that are considered critical), we do not currently have a specific timeline for when it will be sunset. when we do set a date, there will definitely be messages to people who own API keys that are using the V1 API, as well as being mentioned in our Developer Newsletter and Tech Blog (both of which can be found at techblog.constantcontact.com).

 

You should expect an absolute minimum of 6 months notice for the end-of-life for the V1 API, and it is likely that there will be at least 9 months of notice.

 

Even though we do not yet know the exact dates, I would suggest that now is a good time to start the process of moving towards using the V2 API so that you are not fighting against a deadline when the upgrade does happen.

 

Let me know if you have any questions!

 

Sincerely,

 

 

Elijah G.
API Support Engineer