Programs

Programs Endpoint Reference

Programs are a core organizational component of Marketo Marketing Activities. They can be a parent to most types of assets, and allow for tracking of membership and success of leads within the context of individual marketing initiatives. Programs can be parents to all type of records except for LP, Email Templates, and Files.

Program Types

There are five core types of programs within Marketo:

  • Default
  • Event
  • Event with Webinar
  • Engagement
  • Email

Engagement programs may be parents to each other type of program, while Default, Event and Event with Webinar may only be parents to Email programs.

Programs always have a channel, They derive the possible set up Program Member Statuses from the channel which they were created with, which can be retrieved with the Get Channels API. A program may also have a set of associated tags. Tags are customizable fields which can be configured to be optional or required for any given type of program, which will have a value selected from a list configured in Marketo Admin.

Query

Programs follow the standard pattern for asset queries with an additional option to query by tag type and values. Available tags and values can be retrieved with Get Tag Types.

By Id

The Get Program by Id endpoint requires an id path parameter.

The Program Id can be obtained from the URL of the program in the UI, where the URL will resemble https://app-\*\*\*.marketo.com/#PG1001A1. In this URL, the id is 1001. It will always be between the first set of letters in the URL and the second set of letters.

GET /rest/asset/v1/program/{id}.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "948f#14db037ec71",
    "result": [
        {
            "id": 1107,
            "name": "AAA2QueryProgramName",
            "description": "AssetAPI: getProgram tests",
            "createdAt": "2015-05-21T22:45:13Z+0000",
            "updatedAt": "2015-05-21T22:45:13Z+0000",
            "url": "https://app-devlocal1.marketo.com/#PG1107A1",
            "type": "Default",
            "channel": "Online Advertising",
            "folder": {
                "type": "Folder",
                "value": 1910,
                "folderName": "ProgramQueryTestFolder"
            },
            "status": "",
            "workspace": "Default",
            "tags": [
                {
                    "tagType": "AAA1 Required Tag Type",
                    "tagValue": "AAA1 RT1"
                }
            ],
            "costs": null,
            "headStart": false
        }
    ]
}

By Name

The Get Program by Name endpoint requires a name query parameter. Optional boolean query parameters are includeTags and includeCosts which are used to return program tags and program costs respectively.

GET /rest/asset/v1/program/byName.json?name=TestProgramName&includeTags=true
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "16026#14db03e070c",
    "result": [
        {
            "id": 1107,
            "name": "AAA2QueryProgramName",
            "description": "AssetAPI: getProgram tests",
            "createdAt": "2015-05-21T22:45:13Z+0000",
            "updatedAt": "2015-05-21T22:45:13Z+0000",
            "url": "https://app-devlocal1.marketo.com/#PG1107A1",
            "type": "Default",
            "channel": "Online Advertising",
            "folder": {
                "type": "Folder",
                "value": 1910,
                "folderName": "ProgramQueryTestFolder"
            },
            "status": "",
            "workspace": "Default",
            "tags": [
                {
                    "tagType": "AAA1 Required Tag Type",
                    "tagValue": "AAA1 RT1"
                }
            ],
            "costs": null,
            "headStart": false
        }
    ]
}

Browse

The Get Programs endpoint allows you to browse for programs.

The optional status parameter allows you to filter on program status. This parameter only applies to Engagement and Email programs. The possible values are “on” and “off” for Engagement programs, and “unlocked” for Email programs.

The optional maxReturn parameter controls the number of programs to return (maximum is 200, default is 20). The optional offset parameter used for paging results (default is 0).

Note that tags associated with a program are not returned by this endpoint. Program tags can be retrieved by using either Get Programs by Id or Get Programs by Name.

GET /rest/asset/v1/programs.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "7a39#1511bf8a41c",
    "result": [
        {
            "id": 1035,
            "name": "clone it",
            "description": "",
            "createdAt": "2015-11-18T15:25:35Z+0000",
            "updatedAt": "2015-11-18T15:25:46Z+0000",
            "url": "https://app-devlocal1.marketo.com/#NP1035A1",
            "type": "Engagement",
            "channel": "Nurture",
            "folder": {
                "type": "Folder",
                "value": 28,
                "folderName": "Nurturing"
            },
            "status": "on",
            "workspace": "Default",
            "headStart": false
        },
        {
            "id": 1032,
            "name": "email prog",
            "description": "",
            "createdAt": "2015-11-18T14:56:28Z+0000",
            "updatedAt": "2015-11-18T14:56:28Z+0000",
            "url": "https://app-devlocal1.marketo.com/#EBP1032A1",
            "type": "Email",
            "channel": "Email Send",
            "folder": {
                "type": "Folder",
                "value": 26,
                "folderName": "Data Management"
            },
            "status": "unlocked",
            "workspace": "Default",
            "headStart": false
        }
    ]
}

By Date Range

The earliestUpdatedAt and latestUpdatedAt parameters to our Get Programs endpoint allow you to set low and high datetime watermarks for returning programs which were either updated or initially created within the given range.

GET /rest/asset/v1/programs.json?earliestUpdatedAt=2017-01-01T00:00:00-05:00&latestUpdatedAt=2017-01-30T00:00:00-05:00
{
    "success": true,
    "errors": [],
    "requestId": "1225a#15f82a83875",
    "warnings": [],
    "result": [
        {
            "id": 1070,
            "name": "Bulk Import - Test",
            "description": "",
            "createdAt": "2017-01-13T19:34:17Z+0000",
            "updatedAt": "2017-01-13T19:34:18Z+0000",
            "url": "https://app-abm.marketo.com/#PG1070A1",
            "type": "Default",
            "channel": "Content",
            "folder": {
                "type": "Folder",
                "value": 637,
                "folderName": "Avention"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
        },
        {
            "id": 1069,
            "name": "Program With Email",
            "description": "",
            "createdAt": "2017-01-03T22:53:14Z+0000",
            "updatedAt": "2017-01-03T22:53:15Z+0000",
            "url": "https://app-abm.marketo.com/#EBP1069A1",
            "type": "Email",
            "channel": "Email Send",
            "folder": {
                "type": "Folder",
                "value": 621,
                "folderName": "Smartling"
            },
            "status": "unlocked",
            "workspace": "Default",
            "headStart": false
        },
        {
            "id": 1071,
            "name": "Program with Guided Landing Page Template",
            "description": "",
            "createdAt": "2017-01-24T22:59:21Z+0000",
            "updatedAt": "2017-01-24T22:59:22Z+0000",
            "url": "https://app-abm.marketo.com/#PG1071A1",
            "type": "Default",
            "channel": "Content",
            "folder": {
                "type": "Folder",
                "value": 621,
                "folderName": "Smartling"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
        },
        {
            "id": 1047,
            "name": "ReachForce List Update",
            "description": "",
            "createdAt": "2016-05-24T19:38:35Z+0000",
            "updatedAt": "2017-01-13T19:28:09Z+0000",
            "url": "https://app-abm.marketo.com/#PG1047A1",
            "type": "Default",
            "channel": "Content",
            "folder": {
                "type": "Folder",
                "value": 407,
                "folderName": "Everly Tests"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
        }
    ]
}

By Tag Type

The Get Programs by Tag endpoint retrieves a list of list of programs matching the tag type and tag values provided.

There are two required parameters, tagType which is the type of tag to filter on, and tagValue which is the tag value to filter on.  There is an optional integer maxReturn parameter that controls the number of programs to return (maximum is 200, default is 20), and an optional integer offset parameter used for paging results (default is 0).  Results are returned in random order.

GET /rest/asset/v1/program/byTag.json?tagType=Presenter&tagValue=Dennis
{
    "success" : true,
    "warnings" : [],
    "errors" : [],
    "requestId" : "13b6d#152b38d5be4",
    "result" : [{
            "id" : 1004,
            "name" : "It's a Program",
            "description" : "",
            "createdAt" : "2013-02-26T00:37:37Z+0000",
            "updatedAt" : "2013-03-11T15:32:02Z+0000",
            "url" : "https://app-sjst.marketo.com/#PG1004A1",
            "type" : "Default",
            "channel" : "Email Blast",
            "folder" : {
                "type" : "Folder",
                "value" : 38,
                "folderName" : "Test"
            },
            "status" : "",
            "workspace" : "Default",
            "tags" : [{
                    "tagType" : "Presenter",
                    "tagValue" : "Dennis"
                }
            ],
                        "headStart": false
    ]
}

Create and Update

[Creating]https://developer.adobe.com/marketo-apis/api/asset/#tag/Programs/operation/createProgramUsingPOST) and updating programs follows the standard asset pattern and has folder, name, type and channel as required parameters, with description, costs and tags being optional. Channel and type may only be set at program creation. Only description, name, tags and costs may be updated after creation, with an additional costsDestructiveUpdate parameter allowed. Passing costsDestructiveUpdate as true will cause all existing costs to be cleared and replaced with any costs included in the call. Note that tags may be required for some program types in some subscriptions, but this is configuration-dependent and should first be checked with Get Tags to see if there are instance-specific requirements.

When creating or updating an Email Program, a startDate and endDate may also be passed.

Create

POST /rest/asset/v1/programs.json
Content-Type: application/x-www-form-urlencoded
name=API Test Program&folder={"id":1035,"type":"Folder"}&description=Sample API Program&type=Default&channel=Email Blast&costs=[{"startDate":"2015-01-01","cost":2000}]
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "d505#14d9bd96352",
    "result": [
        {
            "id": 1207,
            "name": "newProgram",
            "description": "This is a test",
            "createdAt": "2015-05-28T18:47:15Z+0000",
            "updatedAt": "2015-05-28T18:47:15Z+0000",
            "url": "https://app-devlocal1.marketo.com/#ME1207A1",
            "type": "Event",
            "channel": "channelOne",
            "folder": {
                "type": "Folder",
                "value": 59,
                "folderName": "blah blah"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
            "tags": null,
            "costs": [
                {
                    "startDate":"2015-01-01",
                    "cost":2000
                }
            ]
        }
    ]
}

Update

When updating program costs, to append new costs, simply add them to your costs array. To perform a destructive update, pass your new costs, along with the parameter costsDestructiveUpdate set to true. To clear all costs from a program, do not pass a costs parameter, and just pass costsDestructiveUpdate set to true.

POST /rest/asset/v1/program/{id}.json
Content-Type: application/x-www-form-urlencoded
description=This is an updated description&name=Updated Program Name&costs=[{"startDate":"2016-01-01","cost":200,"note":"Google Adwords"}]
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "5c37#14db05608aa",
    "result": [
        {
            "id": 1110,
            "name": "Updated Program Name",
            "description": "This is a updated description",
            "createdAt": "2015-05-21T22:45:14Z+0000",
            "updatedAt": "2015-06-01T18:13:58Z+0000",
            "url": "https://app-devlocal1.marketo.com/#NP1110A1",
            "type": "Engagement",
            "channel": "Nurture",
            "folder": {
                "type": "Folder",
                "value": 1910,
                "folderName": "ProgramQueryTestFolder"
            },
            "status": "on",
            "workspace": "Default",
            "headStart": false,
            "tags": [
                {
                    "tagType": "AAA1 Required Tag Type",
                    "tagValue": "AAA1 RT1"
                },
                {
                    "tagType": "tagTypeOne",
                    "tagValue": "tagTypeValue1"
                }
            ],
            "costs": [
                {
                    "startDate": "2016-01-01",
                    "cost": 200,
                    "note": "Google Adwords"
                }
            ]
        }
    ]
}

Approval

Email Programs may be approved or unapproved remotely, which will cause the program to run at the given startDate and conclude at the given endDate. Both of these must be set to approve the program, as well as having a valid and approved email and smart list configured via the UI.

Approve

POST /rest/asset/v1/program/{id}/approve.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "16026#150b5bf7692",
    "result": [
        {
            "id": 11062
        }
    ]
}

Unapprove

POST /rest/asset/v1/program/{id}/unapprove.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "16026#150b5bf7692",
    "result": [
        {
            "id": 11062
        }
    ]
}

Clone

Cloning programs follows the standard asset pattern the new name and folder as required parameters and an optional description.  The name parameter must be globally unique and cannot exceed 255 characters.  The folder parameter is the parent folder.  The folder parameter type attribute must be set to “Folder”, and the target folder must be in same workspace as program that is being cloned.

Programs containing certain types of assets may not be cloned via this API, including Push Notifications, In-App Messages, Reports, and Social Assets. In-App programs may not be cloned via this API.

POST /rest/asset/v1/program/{id}/clone.json
Content-Type: application/x-www-form-urlencoded
name=Cloned Program - PHP&folder={"id":5562,"type":"Folder"}&description=Description
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "3a7f#14db06990cc",
    "result": [
        {
            "id": 1221,
            "name": "cloneProgram",
            "description": "This is a description for the cloned program",
            "createdAt": "2015-06-01T18:36:57Z+0000",
            "updatedAt": "2015-06-01T18:36:57Z+0000",
            "url": "https://app-devlocal1.marketo.com/#PG1221A1",
            "type": "Default",
            "channel": "Blog",
            "folder": {
                "type": "Folder",
                "value": 59,
                "folderName": "blah blah"
            },
            "status": "",
            "workspace": "Default",
            "headStart": false
            "tags": null,
            "costs": null
        }
    ]
}

Delete Program

Deleting programs follows the standard asset deletion pattern.

POST /rest/asset/v1/program/{id}/delete.json
{
    "success": true,
    "warnings": [],
    "errors": [],
    "requestId": "16501#14db042c6b7",
    "result": [
        {
            "id": 1109
        }
    ]
}
recommendation-more-help
bb269a6d-047a-4bf7-9acd-23ad9a63dc59