Constant
Contact
API Guide
Technology Partner WebhooksSubscribe (PUT) to a Partner Webhook

Subscribe (PUT) to a Partner Webhook

To subscribe your application to a webhook (by topic_id) or to update the callback URI (hook_uri) for an existing subscription, make a PUT call to the partner/webhooks/subscriptions/{topic_id} endpoint. In the request body include the callback URI (hook_uri) you want Constant Contact to use to notify you about POST requests for a topic.

After you subscribe your application, Constant Contact automatically starts sending POST notifications for your chosen topic to your application's callback URI.

JSON Schema

The following describes the JSON schema that is returned in the response body:

  • topic_id: The ID that identifies the type of topic. Supported types include:

    • 1: Billing Tier Upgrade
    • 2: Bill Tier Downgrade
    • 3: Account Cancelled
    • 4: Account Disabled
  • hook_uri: The webhook callback URI that Constant Contact uses to notify you about a topic. The URI must begin with https:// and be no more than 512 characters in length.

    For example: https://www.examplename.com/webhooks/billingTier

Example PUT Webhooks Request

PUT
https://api.cc.email/v3/partner/webhooks/subscriptions/{topic_id}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"hook_uri\":\"https://my.host.com/mywebhooks\"\n}\n");
Request request = new Request.Builder()
  .url("https://api.cc.email/v3/partner/webhooks/subscriptions/2")
  .method("PUT", body)
  .addHeader("x-api-key", "40a0b12-342b-436d-97c3-000000000000")
  .addHeader("Authorization", "{access_token}")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

JSON Response

[
  {
    "topic_id":"2",
    "hook_uri":"https://my.host.com/mywebhooks"
  }
]
View it!

Although technology partner endpoints cannot be tested using our API Reference Tester, response samples and schema are available to view for this endpoint.

On this page