Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get campaign id by program name. #34

Open
alusvedejs opened this issue Oct 18, 2018 · 2 comments
Open

get campaign id by program name. #34

alusvedejs opened this issue Oct 18, 2018 · 2 comments

Comments

@alusvedejs
Copy link

Hi!
Thanks for sharing your work.
Technically this is not an issue. More like a suggestion for improvement.

I got a task to pythonize my bash script which is importing some data into Marketo using curl posts.
The script is cloning a program with a campaign and activating new campaign.
I am finding campaign id to activate by program name (since i know the name of a program i just cloned).
Here is my curl (in case you will want to implement something similar in your python client):
NewCampaignId=$(curl --silent -X GET "${baseUrl}rest/v1/campaigns.json?access_token=${AccessToken}&programName=${NewProgramName}" | jq '.result | .[].id')

@alusvedejs
Copy link
Author

and it appears activate campaign is also missing:

curl -X POST "${baseUrl}rest/asset/v1/smartCampaign/${NewCampaignId}/activate.json?access_token=${AccessToken}"

@jepcastelein
Copy link
Owner

get campaign by program name:
lead = mc.execute(method='get_multiple_campaigns', id=[1170,1262], name=None, programName=None, workspaceName=None, batchSize=None)

instead of scheduling a Campaign and passing in a Program Name, you could also clone the Program, then schedule the campaign:
program = mc.execute(method='clone_program', id=1207, name="Program Clone", folderId=28, folderType='Folder', description="this is a description")
That circumvents the limit of 20 calls per day for schedule campaign with cloneToProgramName.

Correct, Activate Campaign is not yet implemented, it's relatively new.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants