I have created an email in marketo using rails api.Now I need to update the content of an email.I can update the content of an email whose type is text but I cannot able to update the Content of email whose content type is Image.I have base64 Image that I try to update in marketo.
I try to update the Base64 Image like:
image = params[:content]
binary_image = Base64.decode64(image)
params = {
access_token: @access_token,
content_type: 'image/jpeg',
type: "Image",
value: binary_image
}
@data = RestClient.post("#{host}/rest/asset/v1/email/#{id}/content/#{mid}.json", params)
Here mid is htmlid and I am getting this error {"errors"=>[{"code"=>"611", "message"=>"Error processing Image: Cannot find an image with this id"}]} Also Tried using
params = {
access_token: @access_token,
content_type: 'application/x-www-form-urlencoded',
type: "Text",
value: binary_image
}
and getting error: "errors"=>[{"code"=>"702", "message"=>"htmlID specified is not valid"}]