REST API - Get multiple campaigns

Anonymous
Not applicable

REST API - Get multiple campaigns

Hello,

Thanks in advance. We have pulled in campaign data via get multiple campaigns REST api.

However, we have multiple campaigns with the same name under different programs but REST API does not return 'program'. Documentation below shows 'program' returning in sample data.

Get Multiple Campaigns » Marketo Developers

Is this expected and is there a fix/work around?

Thanks,

Longfei

4 REPLIES 4
Anonymous
Not applicable

Re: REST API - Get multiple campaigns

Hi Longfei

I tried in same campaign name under different programs, it seems that the API works fine.

Response

{"requestId":"3fa7#14d9f3e5bc5","result":[

{"id":1432,"name":"Campaign Name","type":"batch","programName":"My Program 2","workspaceName":"Default","createdAt":"2015-05-29T10:24:45Z","updatedAt":"2015-05-29T10:35:00Z","active":false},

{"id":1434,"name":"Campaign Name","type":"batch","programName":"My Program 1","workspaceName":"Default","createdAt":"2015-05-29T10:25:20Z","updatedAt":"2015-05-29T10:36:09Z","active":false}

],"success":true}

Anonymous
Not applicable

Re: REST API - Get multiple campaigns

Thanks, Takehiro,

what are you passing as parameter in the REST call? I'm passing in Workspace name and the response i receive is:

{u'requestId': u'11edf#14dd9fca9c0', u'success': True, u'result':[

{u'name': u'name', u'workspaceName': u'workspaceName', u'updatedAt': u'2013-06-04T06:25:35Z', u'active': False, u'type': u'batch', u'id': 1039, u'createdAt': u'2011-01-18T18:46:49Z'}]}

What are you doing differently to get that result?

Thanks again,

Longfei

Anonymous
Not applicable

Re: REST API - Get multiple campaigns

Hi Longfei

MY REQUEST

https://999-XXX-999mktorest.com/rest/v1/campaigns.json?name=MyCampaign&access_token=zzzzzzzzzzzzzzzz...

My RESPONSE

{"requestId":"14d2d#14eaf05e34e","result":[

{"id":1535,"name":"MyCampaign","type":"batch","programName":"TEST1","workspaceName":"Default","createdAt":"2015-07-21T04:55:30Z","updatedAt":"2015-07-21T05:10:58Z","active":false},

{"id":1536,"name":"MyCampaign","type":"batch","programName":"TEST2","workspaceName":"Default","createdAt":"2015-07-21T04:55:45Z","updatedAt":"2015-07-21T05:11:06Z","active":false}

],"success":true}

And I tried with the workspace name "Default". it worked fine too.

Kenny_Elkington
Marketo Employee

Re: REST API - Get multiple campaigns

Hi Longfei,

What does your request look like?