Aimtell offers a service for push notifications to users who give permission. This package allows for interfacing with Aimtell's backend API to manage your account.
Aimtell REST API Documentation
You can install the package via composer:
composer require collinped/aimtell-php
$aimtell = new Collinped\Aimtell($apiKey, $defaultSiteId, $whiteLabelId);
$site = $aimtell->site()
->create([
'name' => 'Sample Website',
'url' => 'collinped.com'
]);
$campaigns = $aimtell->site($siteId)
->campaign()
->all();
$campaign = $aimtell->site($siteId)
->campaign()
->find($campaignId);
- Get API Key
- Set API Key
- Get Default Site ID
- Set Default Site ID
- Get White Label ID
- Set White Label ID
- Get All Websites
- Get Website
- Get Website Code
- Add Website
- Update Website Details
- Get Website Settings
- Update Website Settings
- Update Website Package (Safari)
- Delete Website
- Get Website Keys
- Upsert Website Keys
- Get All Subscribers
- Get Subscriber
- Track Subscriber Attributes
- Track Subscriber Event
- Opt-Out Subscriber
- Get All Segments
- Get Segment
- Create Segment
- Update Segment
- Delete Segment
- Get Segment Counts Over Time (By Day)
- Get Welcome Notification
- Get Welcome Notification Campaign Results (By Day)
- Update Welcome Notification (Upsert)
- Get All Manual Campaigns
- Get Manual Campaign
- Get Manual Campaign Clicks
- Get Manual Campaign Results (By Day)
- Create Manual Campaign
- Update Manual Campaign
- Delete Manual Campaign
- Get All Event Triggered Campaigns
- Get Event Triggered Campaign
- Get Event Triggered Campaign Results (By Day)
- Create Event Triggered Campaign
- Update Event Triggered Campaign
- Delete Event Triggered Campaign
- Get All RSS Campaigns
- Get RSS Campaign
- Create RSS Campaign
- Update RSS Campaign
- Delete RSS Campaign
- Get All API Campaigns
- Get API Campaign
- Get Event API Campaign Results (By Day)
- Send a Push Notification
$aimtell = $aimtell->getApiKey();
$aimtell = $aimtell->setApiKey($apiKey);
$aimtell = $aimtell->getDefaultSiteId();
$aimtell = $aimtell->setDefaultSiteId($defaultSiteId);
$aimtell = $aimtell->getWhiteLabelId();
$aimtell = $aimtell->setWhiteLabelId($whiteLabelId);
Get All Websites - Aimtell Docs
$websites = $aimtell->site()
->all();
Get Website - Aimtell Docs
$website = $aimtell->site()
->find($siteId);
Get Website Code - Aimtell Docs
$website = $aimtell->site($siteId)
->getCode();
Add Website - Aimtell Docs
$websites = $aimtell->site()
->create([
'name' => 'Website Name', // Required
'url' => 'facebook.com' // Required
]);
Update Website Details - Aimtell Docs
$websites = $aimtell->site($siteId)
->update([
'name' => 'Website Name',
'url' => 'facebook.com'
'icon' => 'imageUrl.jpg'
]);
Get Website Settings - Aimtell Docs
$websites = $aimtell->site($siteId)
->getSettings();
Update Website Settings - Aimtell Docs
$websites = $aimtell->site($siteId)
->updateSettings([
...
]);
Update Website Package (Safari) - Aimtell Docs
$websites = $aimtell->site($siteId)
->updatePackage();
Delete Website - Aimtell Docs
$websites = $aimtell->site($siteId)
->delete();
Get Website Keys - Aimtell Docs
$websites = $aimtell->site($siteId)
->getKeys();
Upsert Website Keys - Aimtell Docs
$websites = $aimtell->site($siteId)
->upsertKeys([
...
]);
Get All Subscribers - Aimtell Docs
$subscribers = $aimtell->site($siteId)
->subscriber()
->all();
Get Subscriber - Aimtell Docs
$subscriber = $aimtell->site($siteId)
->subscriber()
->find($subscriberId);
Track Subscriber Attribute - Aimtell Docs
$subscriber = $aimtell->site($siteId)
->subscriber($subscriberId)
->trackEvent([
'first_name' => 'jeff'
'gender' => 'male'
]);
Track Subscriber Event - Aimtell Docs
$subscriber = $aimtell->site($siteId)
->subscriber($subscriberId)
->trackEvent([
'category' => '' // Required
'action' => '', // Required
'label' => '',
'value' => 1.00
]);
Opt-Out Subscriber - Aimtell Docs
$subscriber = $aimtell->site($siteId)
->subscriber($subscriberId)
->optOut();
Get All Segments - Aimtell Docs
$segments = $aimtell->site($siteId)
->segment()
->all();
Get Segment - Aimtell Docs
$segment = $aimtell->site($siteId)
->segment()
->find($segmentId);
Create Segment - Aimtell Docs
$segment = $aimtell->site($siteId)
->segment()
->create([
'name' => 'Segment Name'
'definition' => 'city==Irvine' // See Aimtell Docs
]);
Update Segment - Aimtell Docs
$segment = $aimtell->site($siteId)
->segment($segmentId)
->update([
'name' => 'Segment Name'
'definition' => 'city==Irvine' // See Aimtell Docs
]);
Delete Segment - Aimtell Docs
$segment = $aimtell->site($siteId)
->segment($segmentId)
->delete();
Get Segment Counts Over Time (By Day) - Aimtell Docs
$results = $aimtell->site($siteId)
->segment($segmentId)
->getResultsByDate([
'startDate' => '1/1/2020',
'endDate' => '1/30/2020'
]);
Get Welcome Notification - Aimtell Docs
$welcomeNotification = $aimtell->site($siteId)
->welcomeNotification()
->get();
Get Welcome Notification Results (By Day) - Aimtell Docs
$results = $aimtell->site($siteId)
->welcomeNotification()
->getResultsByDate([
'startDate' => '1/1/2020',
'endDate' => '1/30/2020'
]);
Update Welcome Notification (Upsert) - Aimtell Docs
$welcomeNotification = $aimtell->site($siteId)
->welcomeNotification()
->update([
'title' => 'Welcome Title', // Required
'body' => 'Welcome body', // Required
'link' => 'http://facebook.com', // Required
'status' => '1' // Required - 0 = Draft, 1 = Active
]);
Get All Manual Campaigns - Aimtell Docs
$campaigns = $aimtell->site($siteId)
->campaign()
->all();
Get Manual Campaign - Aimtell Docs
$campaign = $aimtell->site($siteId)
->campaign()
->find($campaignId);
Get Manual Campaign Clicks - Aimtell Docs
$campaign = $aimtell->site($siteId)
->campaign($campaignId)
->getClicks();
Get Manual Campaign Results (By Day) - Aimtell Docs
$campaign = $aimtell->site($siteId)
->campaign($campaignId)
->getResultsByDate([
'startDate' => '01/01/2020',
'endDate' => '02/15/2020',
]);
Create Manual Campaign - Aimtell Docs
$campaign = $aimtell->site($siteId)
->campaign($campaignId)
->create([
'name' => 'Campaign Name', // Required
'title' => 'Campaign Title',
...
]);
Update Manual Campaign - Aimtell Docs
$campaign = $aimtell->site($siteId)
->campaign($campaignId)
->update([
'name' => 'New Campaign Name',
'title' => 'New Campaign Title',
...
]);
Delete Manual Campaign - Aimtell Docs
$campaign = $aimtell->site($siteId)
->campaign($campaignId)
->delete();
Send a Push Notification - Aimtell Docs
$notification = $aimtell->site($siteId)
->push()
->title('Sample Notification')
->message('Here is your sample message')
->link('https://www.laravel.com')
->toSubscriber($subscriberId)
->withButton([
'link' => 'sampleUrl',
'title' => 'Sample Title 1',
])
->withButton([
'link' => 'sampleUrl2',
'title' => 'Sample Title 2',
])
->send();
composer test
- A/B Tests for Manual Campaigns
- Create Manual Campaign (Batch)
- Update Manual Campaign (Batch)
- Delete Manual Campaign (Batch)
- Create Event Triggered Campaign (Batch)
- Update Event Triggered Campaign (Batch)
- Delete Event Triggered Campaign (Batch)
- Get Notification Logs
- Get Attributes Logs
- Get Pageview Logs
- Get Event Logs
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.