php Mautic运动

Posted

tags:

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

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

//get campaign
$campaign = $campaignApi->get($id);

//LIST CAMPAIGNS
$campaigns = $campaignApi->getList($searchFilter, $start, $limit, $orderBy, $orderByDir, $publishedOnly, $minimal);

//Create a new campaign
$data = array(
    'name'        => 'Campaign A',
    'description' => 'This is my first campaign created via API.',
    'isPublished' => 1
);

$campaign = $campaignApi->create($data);

//Edit a new campaign
$id   = 1;
$data = array(
    'name'        => 'New campaign name',
    'isPublished' => 0
);

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

$campaign = $campaignApi->edit($id, $data, $createIfNotFound);

//Delete a campaign.
$campaign = $campaignApi->delete($id);

/**
 * Contact
*/
//LIST CAMPAIGN CONTACTS
$response = $campaignApi->getContacts($campaignId, $start, $limit, $order, $where);

//add a contact to a specific campaign.
$response = $campaignApi->addContact($campaignId, $contactId);
if (!isset($response['success'])) {
    // handle error
}

//remove a contact from a specific campaign.
$response = $listApi->removeContact($contactId, $listId);
if (!isset($response['success'])) {
    // handle error
}

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

php mautic短信

php mautic chanel营销信息

php mautic动态内容

php mautic类别

php mautic API - 联系

PHP:使用 OAuth1a 调用 Mautic API