SOLVED

Updating landing page content: system error

Go to solution
Highlighted
Anonymous
Not applicable

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:

pastedImage_0.png

I've tried both with and without the header:

Content-Type: multipart/form-data; boundary=---------------------------9051914041544843365972754266

in the header section

pastedImage_3.png

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Marketo Employee

Re: Updating landing page content: system error

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

pastedImage_1.png

View solution in original post

11 REPLIES 11
Highlighted
Level 10 - Community Moderator

Re: Updating landing page content: system error

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?

Highlighted
Anonymous
Not applicable

Re: Updating landing page content: system error

pastedImage_0.png

Highlighted
Anonymous
Not applicable

Re: Updating landing page content: system error

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.

Highlighted
Level 10 - Community Moderator

Re: Updating landing page content: system error

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

Highlighted
Anonymous
Not applicable

Re: Updating landing page content: system error

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

Highlighted
Level 10 - Community Moderator

Re: Updating landing page content: system error

The boundary you declare in the header is missing a trailing "6".

Highlighted
Anonymous
Not applicable

Re: Updating landing page content: system error

Oops, I missed the last 6 when I was copying it over to this webpage.  The trailing 6 was present on my postman request.

Highlighted
Marketo Employee

Re: Updating landing page content: system error

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

pastedImage_1.png

View solution in original post

Highlighted
Level 10 - Community Moderator

Re: Updating landing page content: system error

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.