PHPackages                             unikrn/mautic-api-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. unikrn/mautic-api-library

ActiveLibrary[API Development](/categories/api)

unikrn/mautic-api-library
=========================

Mautic API Connector Library

3.0.1(5y ago)02.8k1MITPHPPHP &gt;=7.2.0

Since Jun 23Pushed 2y agoCompare

[ Source](https://github.com/unikrn/mautic-api-library)[ Packagist](https://packagist.org/packages/unikrn/mautic-api-library)[ RSS](/packages/unikrn-mautic-api-library/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (27)Used By (0)

Using the Mautic API Library
============================

[](#using-the-mautic-api-library)

Requirements
------------

[](#requirements)

- PHP 5.3.7 or newer
- cURL support

Mautic Setup
------------

[](#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. If you intend on using Basic Authentication, ensure you enable it. 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
-------------

[](#authorization)

### Obtaining an access token

[](#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.

```
