Re: Program Tokens & Rest API's Create / Delete Token

Anonymous
Not applicable

Program Tokens & Rest API's Create / Delete Token

Question. When I create a new program, I select from one of the following types:

  • Default
  • Engagement
  • Email
  • Event

Are these programs "folders" in the context of the API?

I'm trying to run a script outside Marketo that will create or delete a token within a specific program and want to know whether the four digit number (https://app-ab08.marketo.com/#AAADDDDAD) associated with the program, the one that's represented by the {{program.id}} token, is the same one represented by {id} in the following operations associated with creating or deleting tokens:

  • /rest/asset/v1/folder/{id}/tokens.json (See here.)
  • /rest/asset/v1/folder/{id}/tokens/delete.json (See here.)

I'm trying to create or delete tokens based on a series of conditions evaluated outside Marketo.

6 REPLIES 6
Ben_Griffith1
Level 3

Re: Program Tokens & Rest API's Create / Delete Token

tokens can be setup for a folder or a program.  The calls you referenced can include a parameter, specifying what the id is for (program or folder): ?folderType=Program

Anonymous
Not applicable

Re: Program Tokens & Rest API's Create / Delete Token

Thanks, Ben!

Just to clarify, I want the calls to be triggered by a webhook run from the program itself, and am looking for the simplest way to pass all the information about which program the webhook was called from each time. Assuming I clone a template program each time, that parameter (?folderType=Program) could be the same each time. When paired with the four digit ID provided by using {{program.id}}, and assuming the names of the tokens to be deleted or created are known, is that sufficient information for the call to target the program and create/delete tokens within that program?

One more question. Is the four digit {{program.id}} absolutely unique within our instance? I had assumed yes, since that's all that appeared as part of the {{program.id}} when I tested, but I noticed that the program ID that appears in the URL when I'm viewing an asset also includes some sort of short code communicating the type of asset and two characters that follow the number, which I don't know the significance of: #ME4293A1.

  • ME = Event?
  • A1= ?
Anonymous
Not applicable

Re: Program Tokens & Rest API's Create / Delete Token

Suffix is

A1=1st Tab

B2=2nd Tab

C3=3rd Tab

D4=4th Tab

Anonymous
Not applicable

Re: Program Tokens & Rest API's Create / Delete Token

Ah. Very cool. That's that part answered. Just a cue to control the user interface... so I'll assume that's in no way important in the context of API calls.

Much appreciated, Takehiro Masaki​!

Ben_Griffith1
Level 3

Re: Program Tokens & Rest API's Create / Delete Token

this is a bit late and I imagine you already figured it out and know the answer. but yes, the program id token in the webhook should be all you need in combination with the hard coded programType in your api calls.

program id is unique in your instance yes. and the other two parts are the type of asset I suppose you could say (smart campaign vs. certain type of program and so on) and as takehiro said the part after the program id controls the tab that is displayed for the particular asset.

Anonymous
Not applicable

Re: Program Tokens & Rest API's Create / Delete Token

I was almost certain that was the case but wanted to verify. Thanks, Ben!

I'll be building out the template programs in Marketo, but one of our developers will be working on those API calls, and I just wanted to verify that my proposed solution is workable.

Thanks again! (Takehiro Masaki​, you too!)