SOLVED

Updating landing page content: system error

Go to solution
Anonymous
Not applicable

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
David_Everly
Marketo Employee

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
Anonymous
Not applicable

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?

SanfordWhiteman
Level 10 - Community Moderator

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

David_Everly
Marketo Employee

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

SanfordWhiteman
Level 10 - Community Moderator

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.

Anonymous
Not applicable

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.

SanfordWhiteman
Level 10 - Community Moderator

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

Anonymous
Not applicable

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

SanfordWhiteman
Level 10 - Community Moderator

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

Anonymous
Not applicable

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

SanfordWhiteman
Level 10 - Community Moderator

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?

Anonymous
Not applicable

pastedImage_0.png