2017 © Pedro Peláez
 

library laravel-mautic-api

Free and Open Source Marketing Automation API

image

princealikhan/laravel-mautic-api

Free and Open Source Marketing Automation API

  • Friday, February 16, 2018
  • by princealikhan
  • Repository
  • 1 Watchers
  • 5 Stars
  • 480 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 6 Open issues
  • 6 Versions
  • 35 % Grown

The README.md

Looking for maintainers for this project

Mautic API in Laravel/Lumen.

Free and Open Source Marketing Automation API, (*1)

Requirements

  • PHP 5.5.* or newer
  • cURL support

Mautic Setup

The API must be enabled in Mautic. Within Mautic, go to the Configuration page (located in the Settings menu) and under API Settings enable Mautic's API. You can also choose which OAuth2 protocol to use here. After saving the configuration, go to the API Credentials page (located in the Settings menu) and create a new client. Enter the callback/redirect URI that the request will be sent from. Click Apply then copy the Client ID and Client Secret to the application that will be using the API., (*2)

Installation

First, you'll need to require the package with Composer:, (*3)

composer require princealikhan/laravel-mautic-api

Aftwards, run composer update from your command line., (*4)

Then, update config/app.php by adding an entry for the service provider., (*5)

'providers' => [
    // ...
    'Princealikhan\Mautic\MauticServiceProvider',
],

Then, register class alias by adding an entry in aliases section, (*6)

'aliases' => [
    //.....
    'Mautic' => 'Princealikhan\Mautic\Facades\Mautic',
],

Finally, from the command line run php artisan vendor:publish to publish the default configuration file. This will publish a configuration file name mautic.php ,consumer migration and consumer model., (*7)

Run php artisan migrate migration command to create consumer table in your database., (*8)

Configuration

You need to add your client id, client secret and callback url in mautic.php file that is found in your applications config directory., (*9)

Authorization

This Library only support OAuth2 Authorization you must need to create a OAuth2 client in order to use api., (*10)

Registering Application

In order to register you application with mautic ping this url this is one time registration., (*11)

http://your-app/mautic/application/register

Usage

Add Mautic Facade in your controller., (*12)

use Mautic;

Send a request to mautic ( Example )

Create a new contact in mautic., (*13)

$params = array(
    'firstname' => 'Prince',
    'lastname'=> 'Ali Khan',
    'email' => 'princealikhan08@gmail.com'
);

Mautic::request('POST','contacts/new',$params);

Get List of all contacts, (*14)

Mautic::request('GET','contacts');

Get a unique contact, (*15)

Mautic::request('GET','contacts/1');
//where 1 is unique id for a contact.

Delete a contact, (*16)

Mautic::request('Delete','contacts/1/delete');
And many more endpoints support by mautic.

List of Endpoints supported by Mautic.

Contacts

[
    "contacts",
    "contacts/{id}",
    "contacts/list/fields",
    "contacts/list/owners",
    "contacts/new",
    "contacts/{id}/edit",
    "contacts/{id}/delete",
    "contacts/{id}/notes",
    "contacts/{id}/segments",
    "contacts/{id}/campaigns"
]

Assets

[
    "assets",
    "assets/{id}"
]

Campaigns

[
    "campaigns",
    "campaigns/{id}",
    "campaigns/contact/{id}/add/{leadId}",
    "campaigns/contact/{id}/remove/{leadId}"
]

Data

[
    "data",
    "data/{type}",
]

Emails

[
    "emails",
    "emails/{id}",
    "emails/{id}/send",
    "emails/{id}/send/lead/{leadId}"
]

Forms

[
    "forms",
    "forms/{id}"
]

Pages

[
    "pages",
    "pages/{id}"
]

Points

[
    "points",
    "points/{id}",
    "points/triggers",
    "points/triggers/{id}"
]

Reports

[
    "reports",
    "reports/{id}"
]

Segments

[
    "segments",
    "segments/contact/{id}/add/{leadId}",
    "segments/contact/{id}/remove/{leadId}"
]

Users

[
    "roles",
    "roles/{id}",
    "users",
    "users/{id}",
    "users/list/roles",
    "users/self",
    "users/{id}/permissioncheck",
]

Please refer to Documentation. for all customizable parameters., (*17)

The Versions

16/02 2018

dev-master

9999999-dev

Free and Open Source Marketing Automation API

  Sources   Download

MIT

The Requires

 

by Prince Ali Khan

laravel api email marketing lumen automation sync mautic princealikhan

15/02 2018

v1.2.2

1.2.2.0

Free and Open Source Marketing Automation API

  Sources   Download

MIT

The Requires

 

by Prince Ali Khan

laravel api email marketing lumen automation sync mautic princealikhan

11/11 2017

v1.2.1

1.2.1.0

Free and Open Source Marketing Automation API

  Sources   Download

MIT

The Requires

 

by Prince Ali Khan

laravel api email marketing lumen automation sync mautic princealikhan

13/12 2016

v1.0.2

1.0.2.0

Free and Open Source Marketing Automation API

  Sources   Download

MIT

The Requires

 

by Prince Ali Khan

laravel api email marketing lumen automation sync mautic princealikhan

27/11 2016

v1.0.1

1.0.1.0

Free and Open Source Marketing Automation API

  Sources   Download

MIT

The Requires

 

by Prince Ali Khan

laravel api email marketing lumen automation sync mautic princealikhan

27/11 2016

v1.0

1.0.0.0

Free and Open Source Marketing Automation API

  Sources   Download

MIT

The Requires

 

by Prince Ali Khan

laravel api email marketing lumen automation sync mautic princealikhan