GET /rest/asset/v1/email/1717/dynamicContent/RVMtc2luZ2xl.json
[
{
"createdAt": "2022-04-06T14:47:45Z+0000",
"updatedAt": "2022-04-06T14:47:45Z+0000",
"id": 1717,
"segmentation": 1011,
"content": [
{
"id": "MTMzMg**",
"segmentId": 1041,
"segmentName": "Default",
"content": "https://via.placeholder.com/1200x400",
"type": "Image",
"width": "600",
"altText": "MULTIPLE.PNG",
"linkUrl": "https://via.placeholder.com/1200x400",
"style": "-ms-interpolation-mode: bicubic; outline: none; border-right-width: 0; border-bottom-width: 0; border-left-width: 0; text-decoration: none; border-top-width: 0; display: block; max-width: 100%; line-height: 100%; height: auto; width: 600px"
},
...
]
}
]
POST /rest/asset/v1/email/1717/dynamicContent/RVMtc2luZ2xl.json
Body: segment=Default&type=Image&externalUrl=https://via.placeholder.com/1200x400&altText=updated-alt-text
{
"success": false,
"errors": [
{
"message": "Invalid URL",
"code": "701"
}
],
"requestId": "11ea3#18008f813ba",
"warnings": []
}
GET /rest/asset/v1/email/1717/dynamicContent/RVMtYXJ0aWNsZTQ=.json
[
{
"createdAt": "2022-04-08T11:53:10Z+0000",
"updatedAt": "2022-04-08T11:53:10Z+0000",
"id": 1717,
"segmentation": 1011,
"content": [
{
"id": "MTM0NQ**",
"segmentId": 1041,
"segmentName": "Default",
"content": "5396",
"type": "File",
"contentUrl": "http://063-RVK-838.mktoweb.com/rs/063-RVK-838/images/marketo-image-from-computer.png",
"height": "auto",
"width": "270",
"altText": "marketo-image-from-computer.png",
"style": ""
}
]
}
]
POST /rest/asset/v1/email/1717/dynamicContent/RVMtc2luZ2xl.json
Body: segment=Default&type=File&contentUrl=http://063-RVK-838.mktoweb.com/rs/063-RVK-838/images/marketo-image-from-computer.png&altText=updated-alt-text
{
"success": false,
"errors": [
{
"message": "Invalid data for Type.",
"code": "701"
}
],
"requestId": "4724#1800912a367",
"warnings": []
}
GET /rest/asset/v1/email/1717/dynamicContent/RVMtc2luZ2xl.json
[
{
"createdAt": "2022-04-06T14:47:45Z+0000",
"updatedAt": "2022-04-06T14:47:45Z+0000",
"id": 1717,
"segmentation": 1011,
"content": [
{
"id": "MTMzMg**",
"segmentId": 1041,
"segmentName": "Default",
"content": "https://via.placeholder.com/1200x400",
"type": "Image",
"width": "600",
"altText": "MULTIPLE.PNG",
"linkUrl": "https://via.placeholder.com/1200x400",
"style": "-ms-interpolation-mode: bicubic; outline: none; border-right-width: 0; border-bottom-width: 0; border-left-width: 0; text-decoration: none; border-top-width: 0; display: block; max-width: 100%; line-height: 100%; height: auto; width: 600px"
},
...
]
}
]
POST /rest/asset/v1/email/1717/dynamicContent/RVMtc2luZ2xl.json
Body: segment=Default&type=Image&externalUrl=https://placekitten.com/200/300&a&altText=updated-alt-text&width=600
{
"requestId": "4a3e#18009178a1c",
"success": false,
"warnings": [],
"errors": [
{
"code": "611",
"message": "Error processing Image: Image size is locked in email template. Cannot edit image size"
}
]
}
1. This is a known issue, and probably the difference b/w the images that load and doesn't load is the presence of CORS header in the once that do load - there's an old thread linked here FYR.
2. Can you try hitting the endpoint with the type = Image and value = <image asset-Id-in-DS> parameters along with the segment parameter? Guess this should do the trick!
3. The getcontent endpoint does return the isLocked Boolean attribute, but I'm not 100% sure if isLocked attribute's value for the image modules do mean the image dimensions are adjustable and un-locked at the template level.
Thank you for response.
2. I tried your solution and it did the trick. Thank you
3. I checked isLocked attribute in getcontent endpoint and the value seems to be independent of lock image size value. So there is probably no way how to get lock image size attribute value, except reading plain email template and parse the value from html.
Actually in our scenario we just need update altText of Image, but to modify it, it's necessary provide all other attributes in update request (POST /rest/asset/v1/email/{emailId}/dynamicContent/{dynamicContentId}.json). It is strange that it is not possible to use same values that were returned by read endpoint (GET /rest/asset/v1/email/{emailId}/dynamicContent/{dynamicContentId}.json). This makes all quite challenging. Do you think there is a chance this could be addressed sometimes in the future?
Thanks
3. I checked isLocked attribute in getcontent endpoint and the value seems to be independent of lock image size value. So there is probably no way how to get lock image size attribute value, except reading plain email template and parse the value from html.
That's what I inferred from my testing, 👍 I tried looking up in the documentation but couldn't find much!
Well, segment, type, and value are the mandatory attributes for the POST request - you can store these values locally and use it in-case if you just want to update the alt-text, I think that shouldn't cause any issues.
Well, segment, type, and value are the mandatory attributes for the POST request - you can store these values locally and use it in-case if you just want to update the alt-text, I think that shouldn't cause any issues.
Yes, I tried it and that's possible. But there is a problem that if e.g. style parameter is not in the request, the value in the email is not preserved. That's not a problem when the value is the same as in the email template, but if there are some changes, the value is overwritten by value from the template. Same also applies for other parameters: width, height ...
Thanks
Yeah - w/o the optional params the default values (in this case the template styles) would be applied on a POST call. TBH, it could be just me, but smh I feel that this EP is not that widely used.
Hi,
I am also trying to update the email image alt text using Dynamic Content API of Marketo, however, ran into an issue of the email image alt text updation breaking the email image itself. Sharing the steps I followed below. Any related experience sharing is much appreciated. Thanks!
I am trying to run an API call to retrieve and update the Dynamic content of the Email Image alt text.
I am running 2 API calls
(1) GET : GET /rest/asset/v1/email/{id}/dynamicContent/{contentId}.json to get the content id and the type of the email module (https://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Emails/getEma...). I am using the dynamic content GET call to extract: segmentation name, segmentation ID, content ID, content type, emailID, dynamic content type, dynamic content ID.
(2) POST : I am using the Dynamic Content POST to update the Dynamic email image alt text Dynamic Content after retrieving the emailID, Dynamic Content, Dynamic Content ID, segment name, segment ID.
However, when I try to update the image URL alt text using this POST API call, after adding the specific altText parameter under "$Params" for this specific dynamic section upload type, it updates the image URL alt text but it breaks the Marketo email image itself. Can you please advise a way that it should not break the email image module?
Any guidance you can provide is much appreciated.
Thanks
Please open a new thread for this, thanks. You can refer back to this one if necessary.
Also, instead of merely describing your payload, include the actual payload using the Syntax Highlighter (See Jo's blog post on how to do this here). This way we know what actually went on the wire.
Thanks very much - yes, have started a new thread here : https://nation.marketo.com/t5/product-discussions/update-dynamic-image-alt-text-content-by-api/m-p/3...
Thanks!