Associate Lead error: 612 Invalid Content Type

Anonymous
Not applicable

Associate Lead error: 612 Invalid Content Type

I'm attempting to complete an Associate Lead action using the REST API to help pass cookie information after a lead fills an external form, and I've repeatedly gotten the error response "612 - Invalid Content Type".

Here's the cURL I've been using (with some info anonymized):

curl -v -X POST https://XXX-YYY-ZZZ.mktorest.com/rest/v1/leads/1114190/associate.json?access_token=xxxxxxxxx-12ae-446b-839e-e0fd9417c36f:xx&cookie=id:XXX-YYY-ZZZ%26token:_mch-3scale.net-1423522466614-31802

It would be very helpful if someone could provide some guidance here:
  • It's not clear from the error response what content type is "invalid" in the string above. I reviewed the docs several times and can't find any meaningful difference between the two
  • Do we need further URL encoding besides the %26 in place of & in the "cookie" param?
  • Is the value that I'm capturing and attempting to POST for the cookie structurally correct? I've seen slight variations for _mkt_trk and when I inspect network on one of our web pages I can see a similar string being passed as part of a web event.
Anyone have suggestions?
 
Tags (1)
5 REPLIES 5
Anonymous
Not applicable

Re: Associate Lead error: 612 Invalid Content Type

Hi Amelia! Please try including -H "Content-Type: application/json" in your cURL request. Let me know if that works?

curl -v -X -H "Content-Type: application/json" POST https://XXX-YYY-ZZZ.mktorest.com/rest/v1/leads/1114190/associate.json?access_token=xxxxxxxxx-12ae-446b-839e-e0fd9417c36f:xx&cookie=id:XXX-YYY-ZZZ%26token:_mch-3scale.net-1423522466614-31802

Anonymous
Not applicable

Re: Associate Lead error: 612 Invalid Content Type

Ok, no longer getting the "invalid content type" error but instead I'm now getting "1002: missing value for required paramenter 'cookie' " error.

I tried changing around the order of the parameters and the response when I added the access token as the *second* param it returned an "Access token not specified" error. It seems like for some reason only the first value from the string is being accepted/read? 
Anonymous
Not applicable

Re: Associate Lead error: 612 Invalid Content Type

Just figured it out! It was a curl error. Please try this format:

curl -H "Content-Type: application/json" -d '' 'https://XXX-YYY-ZZZ.mktorest.com/rest/v1/leads/1114190/associate.json?access_token=xxxxxxxxx-12ae-446b-839e-e0fd9417c36f:xx&cookie=id:XXX-YYY-ZZZ%26token:_mch-3scale.net-1423522466614-31802'

Let me know if it works now?
Anonymous
Not applicable

Re: Associate Lead error: 612 Invalid Content Type

Great - this worked! Is there any chance you could add this guidance to the docs for people? Would've been great to have a sample curl to test from the get-go.
Anonymous
Not applicable

Re: Associate Lead error: 612 Invalid Content Type

Glad it's working! Good idea. I added this example (with a different cookie value) to the Associate Lead docs page.