Hello,
I'm trying to update landing page content using the same body as the one provided on the website here:
http://developers.marketo.com/rest-api/assets/landing-page-templates/#create_and_update
This is the query I'm sending:
I've tried both with and without the header:
Content-Type: multipart/form-data; boundary=---------------------------9051914041544843365972754266
in the header section
But I'm getting system error either way.
The landing page template with Id 5 is in draft mode and has just been created.
Any feedback will be appreciated,
Thanks.
Solved! Go to Solution.
The issue was that the example request body was incorrect. You need to specify name="content" (instead of name="text"). Also need to specify filename="name_of_file". Something like this:
content-type: multipart/form-data; boundary=--------------------------435851813185237176536801
----------------------------435851813185237176536801
Content-Disposition: form-data; name="content"; filename="content.txt"
Content-Type: text/plain
<html>
<head>
</head>
<body>
<div>Placeholder Content</div>
</body>
</html>
----------------------------435851813185237176536801--
And here is Postman screenshot using "form-data" (instead of "raw"):
The outer Content-Type certainly needs to be in the HTTP header (and only there) not in the body of the request (otherwise, there's nothing describing the body).
What's the output when you GET the current content?
Hello,
does anyone have any insights on why this results in a system error? I tried the constant prefix -- and adding line breaks after the header, but unfortunately still got system error.
Thanks.
Please post your exact request payload, syntax-highlighted as Plain.
Body:
-----------------------------9051914041544843365972754266
Content-Disposition: form-data; name="text"
Content-Type: text/html<html>
<head>
</head>
<body>
<div>Placeholder Content</div>
</body>
</html>
-------------------------------9051914041544843365972754266--
Header:
Content-Type: multipart/form-data; boundary=---------------------------905191404154484336597275426
Url:
rest/asset/v1/landingPageTemplate/{id}/content.json
The boundary you declare in the header is missing a trailing "6".
Oops, I missed the last 6 when I was copying it over to this webpage. The trailing 6 was present on my postman request.
The issue was that the example request body was incorrect. You need to specify name="content" (instead of name="text"). Also need to specify filename="name_of_file". Something like this:
content-type: multipart/form-data; boundary=--------------------------435851813185237176536801
----------------------------435851813185237176536801
Content-Disposition: form-data; name="content"; filename="content.txt"
Content-Type: text/plain
<html>
<head>
</head>
<body>
<div>Placeholder Content</div>
</body>
</html>
----------------------------435851813185237176536801--
And here is Postman screenshot using "form-data" (instead of "raw"):
The sample should really separate the HTTP header from the message body, IMO... it makes it seem like you should just put the header in the body.