You are here

public function MailchimpLists::addWebhook in Mailchimp 8

Same name in this branch
  1. 8 lib/mailchimp-api-php/src/MailchimpLists.php \Mailchimp\MailchimpLists::addWebhook()
  2. 8 lib/mailchimp-api-php/tests/src/MailchimpLists.php \Mailchimp\Tests\MailchimpLists::addWebhook()

Adds a new webhook to a list.

Parameters

string $list_id: The ID of the list.

string $url: The callback URL the webhook should notify of events.

array $parameters: Associative array of optional request parameters.

bool $batch: TRUE to create a new pending batch operation.

Return value

object

1 call to MailchimpLists::addWebhook()
MailchimpLists::addWebhook in lib/mailchimp-api-php/tests/src/MailchimpLists.php
@inheritdoc
1 method overrides MailchimpLists::addWebhook()
MailchimpLists::addWebhook in lib/mailchimp-api-php/tests/src/MailchimpLists.php
@inheritdoc

File

lib/mailchimp-api-php/src/MailchimpLists.php, line 549

Class

MailchimpLists
Mailchimp Lists/Audiences library.

Namespace

Mailchimp

Code

public function addWebhook($list_id, $url, $parameters = [], $batch = FALSE) {
  $tokens = [
    'list_id' => $list_id,
  ];
  $parameters += [
    'url' => $url,
  ];
  return $this
    ->request('POST', '/lists/{list_id}/webhooks', $tokens, $parameters, $batch);
}