Loading...

API Credentials

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: 

The API also allows you to view resources you have access to but cannot create or manage:

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.

  1. Obtain the Campaign Factory API credentials.

    To have the credentials provisioned, create a Support ticket.

  2. Request an access token from the following token URL:

    https://maestro.mautic.com/oauth/token

  3. 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>
  4. 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 RootRequired Scopes
    /accountsmanage-accounts
    /brandingsmanage-brandings
    /instancesmanage-instances
    /ip-poolsview-ip-pools
    /locationsmanage-locations
    /templatesmanage-templates
    /usersmanage-users
    /rolesview-roles
    /whoamiapi-access

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation
Back to Site navigation