This document describes the capabilities of the Campaign Factory API and provides information about how to communicate with it. With this API, you can provision Campaign Studio instances and templates for efficient automation, scalability, and streamlined operations.
Capabilities¶
Campaign Factory API capabilities include creating and managing operations for the following:
- Accounts
- Instance branding
- Instances
- Roles
- Users
- Templates
The API also allows you to view resources you have access to but cannot create or manage:
- IP Pools
- Deployment locations
Accessing the API¶
Campaign Factory OpenAPI Description provides a visual interface for the Campaign Factory API. This interface helps you to create and manage Campaign Studio instances, and view available endpoints, parameters, and response formats. Developers and administrators can explore the API's capabilities, test API calls, and learn how to structure requests and interpret responses. This facilitates easier integration and use of the API for provisioning and managing instances and templates within Campaign Factory.
Obtain the Campaign Factory API credentials.
To have the credentials provisioned, create a Support ticket.
Request an access token from the following token URL:
https://maestro.mautic.com/oauth/token
To access the API, send a POST request to the token endpoint containing the appropriate fields in the request body.
The following example outlines the fields in the request body:
// REQUEST URL
https://maestro.mautic.com/oauth/token
// REQUEST HEADERS
Content-Type: application/json
// REQUEST body
{
"grant_type": "password",
"username": "<YOUR USERNAME>",
"password": "<YOUR PASSWORD>",
"scope": "api-access manage-accounts manage-instances",
"client_id": "<YOUR CLIENT ID>",
"client_secret": "<YOUR CLIENT SECRET>"
}
// This request will return a bearer access token which must be used for subsequent requests to the API.
{
"token_type": "Bearer",
"expires_in": 31536000,
"access_token": "<YOUR ACCESS TOKEN HERE>",
"refresh_token": "<REFRESH TOKEN>"
}
// REQUEST URL
https://maestro.mautic.com/openapi/instances
// REQUEST HEADERS
Authorization: Bearer <THE ACCESS TOKEN>
When requesting an access token, specify the scopes to grant the correct access to tokens.
A token can specify multiple scopes. Some endpoints require multiple scopes. For example, the /accounts/{accountUUID}/instances
endpoint requires both the manage-accounts
and manage-instances
scopes.
Endpoint Root | Required Scopes |
/accounts | manage-accounts |
/brandings | manage-brandings |
/instances | manage-instances |
/ip-pools | view-ip-pools |
/locations | manage-locations |
/templates | manage-templates |
/users | manage-users |
/roles | view-roles |
/whoami | api-access |