The REST API serves as a powerful gateway to the Campaign Studio system. It supports an ample amount of calls allowing users to programmatically create, read, delete, and update different components within Campaign Studio. Use the API to:
Build meaningful integrations with in-house systems such as CRM, ERP, and social
Batch update Campaign Studio components
Create advanced triggers and alerts
Achieve the valuable use case you envision
This guide enables you to communicate with the Campaign Studio API. For full API documentation, see Mautic developer documentation.
Authenticating API requests
Campaign Studio supports three options for authentication: Basic Authentication, OAuth1a, and OAuth2. This example uses Basic Authentication where your credentials are your Campaign Studio username and password.
To enable Basic Authentication:
Navigate to Settings > Configuration > API Settings.
Set API enabled to Yes.
Select the toggle for Enable HTTP basic auth to Yes.
Copy your Username and Password.
The base format for the http request URL is:
https://[[your-mautic.com]]/api/[[request-extension]]
Campaign Studio supports most GET
, POST
, DELETE
, PATCH
, and
PUT
requests. See the API documentation for full details. Successful
requests return responses in JSON format.
GET a contact’s profile data using the API
This query returns the profile data of an individual Campaign Studio contact:
GET https://[[your-mautic.com]]/api/contacts/[[contact-id]]
Choose your preferred environment and use the code snippets as guides for sending your first Campaign Studio query.
Change the
[[contact-id]]
to the ID of the Campaign Studio contact you want to view.Update your
[[username]]
,[[password]]
, and[[your-mautic.com]]
.
Note
For assistance with implementing APIs for your instance, contact your account manager.