I'm testing the Get Multiple Campaigns API (which we use with the optional programName parameter) with a program name that has special characters in it (like an ampersand or a comma). These characters are preventing campaigns from being returned. I attempted to encode the URL, but it looks like Marketo doesn't decode the URL on their end, because I'm still unable to retrieve campaigns.
Does anyone know a way around this? Is there something I'm missing here? Is the only solution simply that users of our integration should just not include special characters in their program names?
A comma doesn't to be encoded in a query string (or query string-like form payload). An ampersand, yes.
Can you provide the code you're using and the (plaintext) program name you're trying to access?
I'm pretty much following the example Ruby code here:
A sample URL I'm using, which returns campaigns accurately in all other cases, looks like this: /rest/v1/campaigns.json?programName=My Program Name
Let's say I'm trying to access the campaigns under a program named "ABC_12-34-56-Abc & Abc, Abc123." This is what's happening:
What's happening is the comma is used as in internal (non-HTTP) delimiter by Marketo, so it has a reserved internal use.
programName=me,mine,moo is searching for 3 program names.
While there should be a way of quoting the entire name "me,mine,moo" I don't know what syntax the API supports for that. URL-encoding the comma won't suffice because that just keeps the whole param on the wire to Marketo, it doesn't change the internal meaning within Marketo.