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:

  • 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.

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 name, type, value, and folderType are all required parameters of the token.  Data is passed as POST x-www-form-urlencoded, not as JSON.

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.