How do I poll activity status through the Partner Pass-Through API

I am using the partner pass-through endpoint for all operations:

POST https://api.cc.email/v3/partner/accounts/{encodedAccountId}/account_operations/sync

This works successfully for:

- GET /contact_lists

- POST /activities/remove_list_memberships

- POST /activities/contacts_json_import

All three return a 200/201 with an activity_id in the response.

 The response from remove_list_memberships includes:

{

  "activity_id": "trimmed",

  "state": "initialized",

  "_links": {

    "self": {

      "href": "/v3/activities/activity_id"

    }

  }

}

I need to poll the activity status before proceeding to the import step.

I have tried the following and all return errors:

 1. Pass-through with /v3/activities/{id}

Body:

{

  "account_operation_url": "/v3/activities/{activityId}",

  "account_operation_method": "GET",

  "account_operation_headers": []

}

Result: 400 - invalid_account_operation_url

 2. Pass-through with /activities/{id}

Body:

{

  "account_operation_url": "/activities/{activityId}",

  "account_operation_method": "GET",

  "account_operation_headers": []

}

Result: 400 - invalid_account_operation_url

3. Direct call to

https://api.cc.email/v3/activities/{activityId}

Headers: Authorization Bearer {partnerJWT}, x-api-key

Result: 401 Unauthorized

Questions:

1. Is polling activity status supported through the partner pass-through endpoint?

2. If not, how do I obtain an account-level access token to make direct calls?

3. Is there a recommended pattern for waiting for activity completion when using the Partner API?

Thank you

1 reply
Best reply by John B

Hello ShanT,

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

It looks like we've already followed up with you directly via email, but here is the information provided for visibility on the forum:

For the GET request to obtain an activity status, the "account_operation_url" in the request body should be "/activities/{activity_id}" rather than "/v3/activities/{activityId}".

The request body also requires a value for “account_operation_path_parameters” containing an array with the “query_param_key” and “quary_param_value”.

I’m including an example of a correctly formatted request body below:

{

"account_operation_url": "/activities/{activity_id}",

"account_operation_method": "GET",

"account_operation_path_parameters": [{

"path_param_key": "activity_id",

"path_param_value": "<the activity id>"

}]

}

Please have a look and let us know if you have any other questions!

Regards,

John B.

Tier II API Support Engineer

View original
4 Text Marketing Misses (and Their Fixes)

Join us for this free, 60-minute webinar as we break down the biggest mistakes that alienate customers and hold your business back.