Restoring an email content | Community
Skip to main content
Level 2
October 26, 2021
Solved

Restoring an email content

  • October 26, 2021
  • 1 reply
  • 2845 views

Hi,

I am trying to restoring an content of email so for that i am using this 

/rest/asset/v1/email/{id}/content/{htmlId}.json

 

this api where i pass an three parmas in form-data i.e value,type,overWrite but its still does't work can anyone  help me sort out this problem so that i wll be able to update an email content 

Thanks

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

Hi, can you please share the documentation link that will be very helpfull

Thanks


https://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Emails/updateEmailComponentContentUsingPOST

1 reply

SanfordWhiteman
Level 10
October 26, 2021

You need to provide the actual payload you’re POSTing, not just the URL.

 

Also, “doesn’t work” needs elaboration.

Level 2
October 27, 2021

Hi,

Below is request i am using

https://196-UQU-425.mktorest.com/rest/asset/v1/email/4251/content/body/access_token=859e615e-d87b-4a04-8ed5-b3f6450f9b11:los

Body Params

{"form":{ "value":"<div>Dear {{lead.First Name:default=Friend}},</div>\n<div><br /></div>\n<div>We are pleased to inform you that you have been accepted at Hogwarts School of Witchcraft and Wizardry. Please find enclosed a list of all necessary books and equipment. Term begins on September 1. We await your owl by no later than July 31.</div>\n<div><br /></div>\n<div>Yours sincerely,</div>\n<div>Minerva McGonagall</div>\n<div>Deputy Headmistress <a href=\"https://countingdownto.com/email-countdown/zPFg4AUEiPd0Vw\" target=\"_blank\" style=\"display: block; text-align: center;\"><img style=\"max-width: 346px; max-height: 203px; width: 100%;\" src=\"https://w3.countingdownto.com/g/zPFg4AUEiPd0Vw\" /></a></div>", "type":"Module", "overWrite":true }}


Please let me know what exactly i am doing wrong  in this request.

Thankyou




SanfordWhiteman
Level 10
October 27, 2021

Please use the Syntax Highlighter when posting snippets ("Insert/Edit Code Sample"). I edited your post this time.

 

Your URL is not valid. The access_token is a query param, not part of the path.

 

Your body isn’t a URL-encoded payload, it’s JSON. If you’re actually sending that, it’ll never work.

 

Module is not in the type enum.

 

I would urge you to go over the documentation and examples once again, as there are too many errors here.