Skip to main content
Jul 22, 2014 12:17 AM UTC
Solved

URL Encoding

Hi 

In certain cases, I need to get a campaign based on its name.  I can use the "get multiple campaigns" call of course.  However, I am running into an issue that certain campaigns have a comma.  

To explain further, if I run the follow through the php function urlencode 

this string: FL-CC0863 Salt Lake City, UT

would become:

FL-CC0863+Salt+Lake+City%2C+UT

Of course I'd expect this to work just fine.  However, the call returns an empty array.  Is the url encoding different for marketo's api?

Thanks,

 

Dan

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Accepted solution
Jul 22, 2014 1:12 AM UTC
Please try passing the string via the API like this:
FL%2DCC0863%20Salt%20Lake%20City%2C%20UT
 
Let me know if that works?
 

5 replies

Accepted solution
Jul 22, 2014 1:12 AM UTC
Please try passing the string via the API like this:
FL%2DCC0863%20Salt%20Lake%20City%2C%20UT
 
Let me know if that works?
 
Translate
Josh_Hill13
Level 10
Jul 22, 2014 3:56 AM UTC
Generally avoid using anything other than a dash in your campaigns or programs. Periods and underscores are allowed, but then you get this kind of issue.
Translate
Jul 22, 2014 12:33 PM UTC

Thanks, Murtza.  That worked.  Is there a name of this style of urlencoding?  

Josh, I agree.  Unfortunately I just started at my current position, and they've been doing things in a certain way for some time.  That being said, I will definitley bring this issue up with my team.

Thanks!

 

Dan

Translate
Jul 22, 2014 1:24 PM UTC

Actually this is still not pulling certain names.  For example:

EM-CC0741 Columbus, OH would be encoded as:

EM%2DCC0741%20Columbus%2C%20OH

Yet no result turns up.

Any ideas?

Thanks,

 

Dan

Translate
Jul 22, 2014 5:16 PM UTC
Dan - No specific name. It's just called URL-encoding, as you said. 

That's the same way I would encode your Columbus example, so I am not sure why it is not working for you. 
Translate