cancel
Showing results for 
Search instead for 
Did you mean: 

Using the https://api.cc.email/v3/contact_exports/ api

Occasional Participant

Using the https://api.cc.email/v3/contact_exports/ api

I am using the href generated from the activity status once the status is completed.

Making a get request, the response status code is OK, content-type is text/csv but content-length is 0. 

What am I missing to get the csv file returned in the responseexport.png?

 

Tags (3)
3 REPLIES 3
Moderator

Re: Using the https://api.cc.email/v3/contact_exports/ api

Hello @JohnD16884,

 

Thank you for reaching out to Constant Contact's API Support.

 

It appears there are some differences in our documentation. The documentation says you need to add the word "activities" before the word "contact_exports" in the endpoint URL. Let me test this and reach out to our developers to see which one is the correct way and get this taken care of.


Regards,
Jimmy D.
Tier II API Support Engineer
Occasional Participant

Re: Using the https://api.cc.email/v3/contact_exports/ api

I agree, there is conflicting documentation and examples. A curl example of how to GET the text-csv file would be a great resource. I cannot find anything in the docs or community. Thanks for looking at this, Jimmy.

Moderator

Re: Using the https://api.cc.email/v3/contact_exports/ api

Hi @JohnD16884,

 

We are working on getting everything updated. I did some testing and here is what is needed to do an export.

 

- POST: https://api.cc.email/v3/activities/contact_exports

-- This requires the correct body to be included.

-- You will receive results shown below. note: the link labeled self = activity ID and link labeled results = filed ID

{
  "activity_id": "9da45782-bee4-11e9-96cf-d4ae52843aae",
  "state": "initialized",
  "started_at": "completed",
  "completed_at": "2016-01-23T13:48:44.108Z",
  "created_at": "2016-01-23T13:48:44.108Z",
  "updated_at": "2016-01-23T13:48:44.108Z",
  "percent_done": 75,
  "activity_errors": [
    "Message describing the error condition."
  ],
  "status": {
    "items_total_count": 8751,
    "items_completed_count": 351
  },
  "_links": {
    "self": {
      "href": "/v3/activities/9da45782-bee4-11e9-96cf-d4ae52843aae"
    },
    "results": {
      "href": "/v3/contacts_exports/9da2b17a-bee4-11e9-96cf-d4ae52843aae"
    }
  }
}

- GET: https://api.cc.email/v3/activities/{activity_id)

-- You will get a results page that looks similar. Specifically look for "percent_done" and make sure it says 100

{
  "activity_id": "9da45782-bee4-11e9-96cf-d4ae52843aae",
  "state": "initialized",
  "started_at": "completed",
  "completed_at": "2016-01-23T13:48:44.108Z",
  "created_at": "2016-01-23T13:48:44.108Z",
  "updated_at": "2016-01-23T13:48:44.108Z",
  "source_file_name": "2016-21-04-contact_import.csv",
  "percent_done": 100,
  "activity_errors": [
    "Message describing the error condition."
  ],
  "status": {
    "items_total_count": 2200,
    "items_completed_count": 2100,
    "person_count": 8750,
    "error_count": 0,
    "correctable_count": 0,
    "cannot_add_to_list_count": 0,
    "list_count": 3
  },
  "_links": {
    "self": {
      "href": "/v3/activities/9da45782-bee4-11e9-96cf-d4ae52843aae"
    },
    "results": {
      "href": "/v3/contacts_exports/9da2b17a-bee4-11e9-96cf-d4ae52843aae"
    }
  }
}

- GET: https://api.cc.email/v3/contact_exports/9da2b17a-bee4-11e9-96cf-d4ae52843aae

-- This should give you a result of the email addresses you requested.

 

 

 

 


Regards,
Jimmy D.
Tier II API Support Engineer