Featured image on blog post about how to use the Marketo create token API endpoint

Creating and Updating Tokens Via API

Tokens are one of the best things about using Marketo and can make your program and asset builds more efficient but they can also take a while to create or update manually. If your instance is using program templates (I sincerely hope you are) they are most likely tokenized with all of the variables that make that program unique. However, when you clone that program you now have to enter the values specific to the newly cloned program. If you have a lot of tokens, this can take quite some time.

Create Token Endpoint

Luckily, Marketo gave us the Create Token API endpoint which makes this a breeze. Although the name says “create” this endpoint will also update. It is also easy to implement. There are only four pieces of information needed:

Screenshot of a POST request in Postman to the Marketo create token endpoint https://{{munchkin}}.mktorest.com/rest/asset/v1/folder/{{program}}/tokens.json?folderType=Program&name={{name}}&type={{type}}&value={{value}}

Token Types

text: This is the most common token I have seen used. It is just unformatted, plain text and has a lot of uses because even if you are using it on a landing page, you can use the CSS from the page to style that text

rich text: you can also use rich text though and include html if you want a certain token to look a specific way.

date: has to be formatted yyyy-mm-dd

number: any number (most will use text tokens instead)

score: You can set a score token with an =,+, or –

sfdc campaign: The name of the SFDC campaign

Create a Spreadsheet

If you are like most teams, someone else not in MOps will actually be filling in the values to use in tokens. You can give them a spreadsheet with the folder id, token name, and token type headers already in place and then they just need to add the value column. Once you have that, export as a csv and we can go to Postman.

Postman Runner

When you click on your Marketo collection in Postman, you will see a ‘Run’ button in the top right that you need to click (similar video on how to do this). On the next screen, you can deselect every endpoint aside from the create token endpoint. Then you just need to select your csv file and click Run. You will now see all of your tokens updated with new values. And you didn’t have to copy and paste anything!

Similar Posts