Download the PHP package livepixel/laravel-mautic-api without Composer
On this page you can find all versions of the php package livepixel/laravel-mautic-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download livepixel/laravel-mautic-api
More information about livepixel/laravel-mautic-api
Files in livepixel/laravel-mautic-api
Package laravel-mautic-api
Short Description Mautic API Connector Library for Laravel
License MIT
Informations about the package laravel-mautic-api
Using the Mautic API Library
Requirements
- PHP 5.3.7 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 OAuth 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.
Authorization
Obtaining an access token
The first step is to obtain authorization. Mautic supports OAuth 1.0a and OAuth 2 however it is up to the administrator to decide which is enabled. Thus it is best to have a configuration option within your project for the administrator to choose what method should be used by your code.
API Requests
Now that you have an access token and the auth object, you can make API requests. The API is broken down into contexts. Note that currently only the Lead context allows creating, editing and deleting items. The others are read only.
Get a context object
Supported contexts are currently:
- Assets - read only
- Campaigns - read only
- Emails - read only
- Forms - read only
- Leads - read and write
- Lists - read and write
- Pages - read only
- Points - read only
- PointTriggers - read only
- Reports - read only
Retrieving items
All of the above contexts support the following functions for retrieving items:
Creating an item
Currently, only Leads support this
Editing an item
Currently, only Leads support this
Deleting an item
Currently, only Leads support this