Adding Tags To an Existing Marketo Program | Community
Skip to main content
April 7, 2017
Solved

Adding Tags To an Existing Marketo Program

  • April 7, 2017
  • 3 replies
  • 4825 views

I am trying to add new tags to an already existing Marketo Program. I am using http://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Programs/updateProgramUsingPOST as reference. But when I make the REST call, the response is a success (200 OK) along with the Program details, and the new Tags, which I added, DO NOT reflect on the program. Following is my request json:

{

     "Tags" : [

          {

               "tagType" : "newType",

               "tagValue" : "newValue"

          }

     ]

}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sean_McCombs

Hello Thread,

   This question was recently answered in a Support case, where the below notes were provided as guidance to resolve the issue.

1) The Tag Type and Value must exist in the Admin > Tags for the update to be successful. 

2) The 'Content-Type' should be set to "application/x-www-form-urlencoded" 

3) You may run the call with no tags parameter to return existing tags. 

4) The Update Program Metadata call is "destructive" in that if you do not include existing non-required tags then those tags will be deleted in the successful call. 

Example Call: 

POST /rest/asset/v1/program/1091.json?access_token=xxx HTTP/1.1 

Host: xxx-xxx-123.mktorest.com 

Content-Type: application/x-www-form-urlencoded 

Cache-Control: no-cache 

Postman-Token: xxx 

tags=%5B%7B%22tagType%22+%3A+%22newType%22%2C%22tagValue%22+%3A+%22newValue%22%7D%2C%7B%22tagType%22+%3A+%22TestTag%22%2C%22tagValue%22+%3A+%22TestValue0%22%7D%5D 

(tags Decoded:"[{"tagType" : "newType","tagValue" : "newValue"},{"tagType" : "TestTag","tagValue" : "TestValue0"}]")

I hope this was helpful. Thanks!

3 replies

SanfordWhiteman
Level 10
April 7, 2017

You have to use tags that already exist as options.

April 18, 2017

hey Sanford,

have made an api call to fetch tag types using rest/asset/v1/tagTypes.json and below is the result :

"result": [

    {

      "tagType": "ProgramCreator",

      "applicableProgramTypes": "[program,email_batch,nurture,event,webinar]",

      "required": false

    },

    {

      "tagType": "Region",

      "applicableProgramTypes": "[webinar]",

      "required": false

    },

    {

      "tagType": "Region Test Tag",

      "applicableProgramTypes": "[program,email_batch,event]",

      "required": true

    },

    {

      "tagType": "Test Tag",

      "applicableProgramTypes": "[email_batch,program,nurture,event,webinar]",

      "required": false

    }

  ]

Now if I make a call to Update Program using /rest/asset/v1/program/1743.json where 1743 is Program Id.

with Body :

{

  "Tags": [

    {

      "tagType": "Region Test Tag",

      "tagValue": "Central N"

    }

  ]

}

I am not getting any error. however, still tags are not getting updated. this is the response I am receiving for above call.

{

  "success": true,

  "warnings": [],

  "errors": [],

  "requestId": "14b4c#15b7fba7b34",

  "result": [

    {

      "id": 1743,

      "name": "Test",

      "description": "Test Program",

      "createdAt": "2017-04-05T10:39:03Z+0000",

      "updatedAt": "2017-04-05T10:39:03Z+0000",

      "url": "https://app-ab11.marketo.com/#PG1743A1",

      "type": "Default",

      "channel": "Email Blast",

      "folder": {

        "type": "Folder",

        "value": 1416,

        "folderName": "pughosh"

      },

      "status": "",

      "workspace": "Default",

      "tags": [],

      "costs": []

    }

  ]

}

tags is still an empty array. please let me know what I am missing here.

SanfordWhiteman
Level 10
April 18, 2017

Good news!  I mean, not the good news you were hoping for.   But the good news that I'll stop pushing back, since you're sending a reasonable payload now and this is strange behavior.

Never having used this API in production, I assumed it worked. But maybe it's broken?  Even a "name" update doesn't work for me. I'll open a Support case myself and let you know.

Sean_McCombs
Sean_McCombsAccepted solution
Level 3
May 10, 2017

Hello Thread,

   This question was recently answered in a Support case, where the below notes were provided as guidance to resolve the issue.

1) The Tag Type and Value must exist in the Admin > Tags for the update to be successful. 

2) The 'Content-Type' should be set to "application/x-www-form-urlencoded" 

3) You may run the call with no tags parameter to return existing tags. 

4) The Update Program Metadata call is "destructive" in that if you do not include existing non-required tags then those tags will be deleted in the successful call. 

Example Call: 

POST /rest/asset/v1/program/1091.json?access_token=xxx HTTP/1.1 

Host: xxx-xxx-123.mktorest.com 

Content-Type: application/x-www-form-urlencoded 

Cache-Control: no-cache 

Postman-Token: xxx 

tags=%5B%7B%22tagType%22+%3A+%22newType%22%2C%22tagValue%22+%3A+%22newValue%22%7D%2C%7B%22tagType%22+%3A+%22TestTag%22%2C%22tagValue%22+%3A+%22TestValue0%22%7D%5D 

(tags Decoded:"[{"tagType" : "newType","tagValue" : "newValue"},{"tagType" : "TestTag","tagValue" : "TestValue0"}]")

I hope this was helpful. Thanks!

Chris_Johnston
Level 6
May 10, 2017

If you check out @LaunchPoint Partners​ you will find our team at Salytics did the hard work for you. We built a product  Salytics Tag Manager – Marketo LaunchPoint that is currently free for anyone to use. At it's core, it is a mass program tag updater, that allows you to download your programs names into a csv file and assign them with (existing) Program Tags and then upload the csv file back into Marketo. All of the API calls are already setup for you.