Update Email Content API | Community
Skip to main content
API_Dev
New Participant
May 15, 2018
Question

Update Email Content API

  • May 15, 2018
  • 1 reply
  • 4823 views

So I see in the http://developers.marketo.com/rest-api/assets/emails/#update_editable_section part where it is mentioned that the data is passed as x-www-form-urlencoded and not JSON. I tried to pass HTTP headers as:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));


but I'm always getting the following error:

"success":false,"errors":[{"code":"611","message":"Content Type specified is not valid for the component"}

Anyone else got this same error while using this API endpoint? I've tried to add 'accept' in the header as well with value 'application/json', but I still get the same error. Any suggestions would help. Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
New Participant
May 16, 2018

No problem here.

I imagine you're putting something wrong on the wire.

Note providing PHP/php_curl code isn't narrowing down the problem enough. We don't all use your programming language, but many of us know what needs to be sent to the API at the HTTP level. So you should use Postman or cURL (command line) or another language-agnostic tool to build up to using your language.

API_Dev
API_DevAuthor
New Participant
May 16, 2018

Now, here's the weird thing. The email I'm trying to update via API is in a program that is cloned from another program (also via API), and I get this error. If I take any other email in a program manually cloned from the other program or any email with editable sections, I get success as 'true', and no error. It is just weird why I get error with API cloned emails and not with any other email (they are also of same template).

SanfordWhiteman
New Participant
May 16, 2018

There's occasional weirdness with API-cloned assets that require them to be (interactively) unapproved, then reapproved.  Try that and see.  I know some of these bugs have been cleared up but some remain. In any case I don't think this is really a Content-Type issue.