Creating and Updating Tokens Via API
Tokens in Marketo make program and asset builds more efficient. However, manually updating tokens can be time-consuming, especially in program templates. Fortunately, Marketo’s Create Token API endpoint allows for easy creation and updating of tokens through API calls, saving you from repetitive tasks.
Create Token Endpoint
This endpoint requires four key pieces of information:
- ID of the Folder or Program (remember programs are also folders in Marketo)
- Token Type
- Token Name
- Token Value
Token Types
Here are the main token types you can use:
- Text: Unformatted plain text that can be styled with CSS on a landing page
- Rich Text: Includes HTML for specific styling
- Date: Requires the format yyyy-mm-dd
- Number: For numerical values
- Score: Allows setting a score with =, +, or -
- SFDC Campaign: The name of the SFDC campaign
Create a Spreadsheet
To streamline data entry, create a spreadsheet for token values with columns for Folder ID, Token Name, Token Type, and Token Value. Once populated, save this file as a CSV for easy upload to Postman.
Using Postman Runner
In Postman, click the "Run" button on your Marketo collection, deselect all endpoints except the create token endpoint, and upload your CSV file. Click "Run" to update all tokens without manual entry.