Tokens

Token Endpoint Reference

Tokens in Marketo are special strings similar to shortcodes which are replaced by a separate piece of data at run time.  There are several types of tokens available in Marketo, but only My Tokens can be edited via the API.  My Tokens are child tokens which are local to a particular folder or program.  Tokens can be read, created, and deleted via the API.

Data Type

Tokens can be created with the following data types:

Type Description
date Date value of the form “yyyy-MM-dd”
number An integer or floating point number
rich text An HTML string
score A signed 32-bit integer
sfdc campaign Used in Salesforce campaign management integration
text A text string

Note that these are the only data types that can used when creating a token via API.

Query

Get Tokens by Folder Id takes an id as a path parameter of either a Program or Folder type.  This type is specified by the folderType parameter.

Create and Update

The Create Token endpoint will create new tokens, or if they already exist update them with submitted values.  Tokens are created in the context of a folder or a program.  The required id path parameter is the id of the folder to which the token will be associated with.  The name, type, value, and folderType are all required parameters of the token.  Data is passed as POST x-www-form-urlencoded, not as JSON.  The name field of the token may not exceed 50 characters.

Delete

Delete Token by Name takes an id as a path parameter of either a Program or Folder type.  This type is specified by the folderType parameter.  Tokens are deleted based on their parent folder, the name, and the type of the token, each of which are required.  Data is passed as POST x-www-form-urlencoded, not as JSON.