

It should be the same as you entered when you were creating your Mautic API credentials.Gas Liquids Engineering Ltd. 'callback' => '', // Change this to your app callback. Make sure it starts with http/https and doesn't end with '/' $mauticBaseUrl = $_POST When the user for your app hits Save & Authorize, this is how you will handle the request: // check if the request is sent from user with admin rights // check if Base URL, Consumer/Client Key and Consumer/Client secret are not empty // load this array from database or config file $accessTokenData = array( You can find it in the /apitester directory of Mautic API Library. Note: You can test authorization and API requests in build-in API Tester. This form should not be accessible for public. If you don't want to hard-code authorization details then you can create a form with the following text inputs: Mautic Base URL, Consumer Key and Consumer Secret with Save & Authorize button.

How to Authorize Your Mautic API Application Extract the package to some temporary location.ģ.

(the dot at the end means current folder) Go to your project folder where you want to place Mautic API library to be.Let's look quickly at those two methods and how you would go about using them. If your project doesn't use Composer yet, don't worry! You can either clone it from GitHub or download the ZIP package and copy the library folder to your project. Composer will also automatically include the library to your project. So simple composer require mautic/api-library command will installation of the library to your project for you. Install the Mautic API with ComposerĪPI library is at Packagist. Here are the basic steps to getting started with the Mautic API. You can simply create a lead or move a lead to a smart list when the lead does something within your app. In case you're unaware, these REST API calls are great for integration with your current system(s). This Mautic API requires oAuth (1a or 2) authentication. There is a powerful PHP REST API library for faster integration with PHP projects. Mautic has a great API to interact with other systems.
