Re: Create smart campaign via API

Level 2

Create smart campaign via API

Hello Guys,

I want to create a smart campaign via API in Marketo. I am just trying to learn how Marketo APIs work.


Below are the endpoint and body I am using for this in POSTMAN, but it's giving me an error:



Below is the header and parameters:


Please guide me on what I missing or doing wrong.



Level 10 - Community Moderator

Re: Create smart campaign via API

It would be a lot easier to read your payloads and headers if you posted them using the syntax highlighter — “Insert/Edit Code Sample — instead of as screenshots. (Perhaps with Postman screenshots as an accompaniment.)


Thus far I can see you’re sending the wrong Content-Type. This endpoint takes a form-urlencoded payload with embedded JSON type params, not a JSON payload.


You also don’t need to send the literal query param createSmartCampaignRequest. That’s a placeholder in the docs that represents the schema, and yes, it is confusing! There’s also an error in the docs, as spaces in the payload must be encoded:



Finally, this isn’t a very good API endpoint to start learning Marketo with, since the APIs for manipulating flow steps, etc. aren’t finished.

Level 2

Re: Create smart campaign via API

Thank you @SanfordWhiteman. for your feedback, just trying to figure out the best way to learn Marketo API and how I can use the given endpoints.

 As per the doc, the content type should be as below. in this case what to use for 'x'? 

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