php mautic webhook

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php mautic webhook相关的知识,希望对你有一定的参考价值。

<?php
$webhookApi      = $api->newApi("webhooks", $auth, $apiUrl);

//Get an individual webhook by ID.
$webhook = $webhookApi->get($id);

//LIST WEBHOOKS
$webhooks = $webhookApi->getList($searchFilter, $start, $limit, $orderBy, $orderByDir, $publishedOnly, $minimal);

//Create a new webhook.
$data = array(
    'name' => 'test',
    'description' => 'Created via API',
    'webhookUrl' => 'http://some.url',
    'eventsOrderbyDir' => "ASC",
    'triggers' => array(
        'mautic.lead_post_save_update',
        'mautic.lead_post_save_new',
    )
);

$webhook = $webhookApi->create($data);

//## Edit a new webhook
$id   = 1;
$data = array(
    'name' => 'Rename webhook 1 to this',
);

// Create new a webhook of ID 1 is not found?
$createIfNotFound = true;

$webhook = $webhookApi->edit($id, $data, $createIfNotFound);

//## Delete a webhook
$webhook = $webhookApi->delete($id);

//List webhook triggers
$webhook = $webhookApi->getTriggers();

以上是关于php mautic webhook的主要内容,如果未能解决你的问题,请参考以下文章

php mautic chanel营销信息

php mautic动态内容

php mautic类别

php Mautic运动

php mautic API - 联系

PHP:使用 OAuth1a 调用 Mautic API