younifyd
Menu

Get Campaign Templates

List campaign templates

GET/v1/campaign_templates

Use it in a workflow

  1. Add a step and choose the Talon.One connector.
  2. Pick the Get Campaign Templates action (under management).
  3. Fill in the fields below, then reference the result from later steps as {{getCampaignTemplates.response.data}}.

Request

Query parameters

pageSizeinteger (int64)

The number of items in the response.

Default 1000

skipinteger (int64)

The number of items to skip when paging through large result sets.

sortstring

The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You may not be able to use all fields for sorting. This is due to performance limitations.

statestring

Filter results by the state of the campaign template.

One ofdraftenableddisabled

namestring

Filter results performing case-insensitive matching against the name of the campaign template.

tagsstring

Filter results performing case-insensitive matching against the tags of the campaign template. When used in conjunction with the "name" query parameter, a logical OR will be performed to search both tags and name for the provided values.

userIdinteger (int64)

Filter results by user ID.

Response

Returns 200 with an object. Read it in later steps with {{getCampaignTemplates.response.data.<field>}}.

hasMoreboolean
dataarray<object>
idinteger (int64)required

The internal ID of this entity.

createdstring (date-time)required

The time this entity was created.

accountIdinteger (int64)required

The ID of the account that owns this entity.

userIdinteger (int64)required

The ID of the user associated with this entity.

namestringrequired

The campaign template name.

descriptionstringrequired

Customer-facing text that explains the objective of the template.

instructionsstringrequired

Customer-facing text that explains how to use the template. For example, you can use this property to explain the available attributes of this template, and how they can be modified when a user uses this template to create a new campaign.

campaignAttributesobject

The campaign attributes that campaigns created from this template will have by default.

couponAttributesobject

The campaign attributes that coupons created from this template will have by default.

statestringrequired

Only campaign templates in 'available' state may be used to create campaigns.

One ofdraftenableddisabled

activeRulesetIdinteger (int64)

The ID of the ruleset this campaign template will use.

tagsarray<string>

A list of tags for the campaign template.

reevaluateOnReturnbooleanrequired

Indicates whether campaigns created from this template should be reevaluated when a customer returns an item.

featuresarray<string>

A list of features for the campaign template.

couponSettingsobject2 fields
couponReservationSettingsobject2 fields
referralSettingsobject2 fields
limitsarray<object>4 fields

The set of limits that operate for this campaign template.

templateParamsarray<object>4 fields

Fields which can be used to replace values in a rule.

applicationsIdsarray<integer (int64)>required

A list of IDs of the Applications that are subscribed to this campaign template.

campaignCollectionsarray<object>2 fields

The campaign collections from the blueprint campaign for the template.

defaultCampaignGroupIdinteger (int64)

The default campaign group ID.

campaignTypestringrequired

The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items.

One ofcartItemadvancedDefault "advanced"

campaignsCountinteger (int64)

The number of Campaigns created from this template.

updatedstring (date-time)

Timestamp of the most recent update to the campaign template or any of its elements.

updatedBystring

Name of the user who last updated this campaign template, if available.

validApplicationIdsarray<integer (int64)>required

The IDs of the Applications that are related to this entity.

isUserFavoriteboolean

A flag indicating whether the user marked the template as a favorite.

Default false

json
{
  "hasMore": true,
  "data": [
    {
      "instructions": "Use this template for discount campaigns. Set the campaign properties according to the campaign goals, and don't forget to set an end date.",
      "campaignCollections": [
        {
          "name": "My collection",
          "description": "My collection of SKUs"
        },
        {
          "name": "My collection",
          "description": "My collection of SKUs"
        }
      ],
      "campaignsCount": 3,
      "defaultCampaignGroupId": 42,
      "description": "This is a template for a discount campaign.",
      "features": [
        "coupons",
        "coupons"
      ],
      "couponReservationSettings": {
        "reservationLimit": 45,
        "isReservationMandatory": false
      },
      "couponSettings": {
        "couponPattern": "SUMMER-####-####",
        "validCharacters": [
          "A",
          "B",
          "C",
          "D",
          "E",
          "F",
          "G",
          "H",
          "I",
          "J",
          "K",
          "L",
          "M",
          "N",
          "O",
          "P",
          "Q",
          "R",
          "S",
          "T",
          "U",
          "V",
          "W",
          "X",
          "Y",
          "Z",
          "0",
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9"
        ]
      },
      "templateParams": [
        {
          "attributeId": 42,
          "name": "discount_value",
          "description": "This is a template parameter of type `number`.",
          "type": "number"
        },
        {
          "attributeId": 42,
          "name": "discount_value",
          "description": "This is a template parameter of type `number`.",
          "type": "number"
        }
      ],
      "id": 6,
      "couponAttributes": "{}",
      "state": "draft",
      "limits": [
        {
          "period": "yearly",
          "entities": [
            "Coupon"
          ],
          "limit": 1000,
          "action": "createCoupon"
        },
        {
          "period": "yearly",
          "entities": [
            "Coupon"
          ],
          "limit": 1000,
          "action": "createCoupon"
        }
      ],
      "activeRulesetId": 5,
      "campaignAttributes": "{}",
      "applicationsIds": [
        1,
        2,
        3,
        1,
        2,
        3
      ],
      "campaignType": "advanced",
      "updatedBy": "Jane Doe",
      "created": {},
      "isUserFavorite": false,
      "reevaluateOnReturn": true,
      "userId": 388,
      "tags": [
        "discount"
      ],
      "accountId": 3886,
      "validApplicationIds": [
        1,
        2,
        3
      ],
      "name": "Discount campaign",
      "referralSettings": {
        "couponPattern": "SUMMER-####-####",
        "validCharacters": [
          "A",
          "B",
          "C",
          "D",
          "E",
          "F",
          "G",
          "H",
          "I",
          "J",
          "K",
          "L",
          "M",
          "N",
          "O",
          "P",
          "Q",
          "R",
          "S",
          "T",
          "U",
          "V",
          "W",
          "X",
          "Y",
          "Z",
          "0",
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9"
        ]
      },
      "updated": {}
    }
  ]
}

Need more? See the Talon.One guide for connection setup and behaviour shared by every action.