Updating landing page content: system error | Community
Skip to main content
Feb 7, 2018 12:49 AM UTC
Solved

Updating landing page content: system error

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
everlyAccepted solution
Employee
Mar 1, 2018 6:10 AM UTC

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"):

11 replies

Mar 1, 2018 11:58 PM UTC

Hello,

Thanks for the response.   Is there a way to send the body for the query without using a file (just sending the text directly), since it would be more difficult for a driver to support getting files through a stored procedure?

Translate
SanfordWhiteman
Level 10
Mar 2, 2018 12:25 AM UTC

In Postman, the form-data option is the same as the raw option with the appropriate headers and message-body.

Translate
everlyAccepted solution
Employee
Mar 1, 2018 6:10 AM UTC

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"):

Translate
SanfordWhiteman
Level 10
Mar 1, 2018 6:23 AM UTC

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.

Translate
Feb 21, 2018 7:03 PM UTC

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.

Translate
SanfordWhiteman
Level 10
Feb 21, 2018 7:23 PM UTC

Please post your exact request payload, syntax-highlighted as Plain.

Translate
Feb 23, 2018 12:41 AM UTC

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

Translate
SanfordWhiteman
Level 10
Feb 7, 2018 1:49 AM UTC

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?

Translate
Feb 7, 2018 9:46 PM UTC

Translate