Closed joseorsini closed 4 years ago
This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.
Well, not even a comment from DotCMS creators. I have hard time uploading and fetching Content with File fields as well. But looking at this ticket, I won't even bother reporting my issue. I will just do it the DotCMS way - the hard way - invent some crazy workaround contraption nr. 55.
Our current REST API endpoint for retrieving and saving/updating contents with Image File fields is working in an inconsistent manner. As per our documentation:
https://dotcms.com/docs/latest/save-content-using-the-rest-api#headerFormats
an Image/File field needs to be set by passing in a string like the following
//demo.dotcms.com/images/photos/The-Gherkin-London-England.jpg
however, upon retrieving a content with this field type, the value we get is a content identifier:
https://demo.dotcms.com/api/content/query/+contentType:CalendarEvent%20+CalendarEvent.title:*Wealth*
Returns this
where the image field contains only its identifier:
By pulling the image via REST
https://demo.dotcms.com/api/content/query/+identifier:9e885f4d-1295-4167-975b-afdab2029025
We still lack the file's URI, and for generating the Site Info, we would need an additional REST API call for that:
https://demo.dotcms.com/api/content/query/+identifier:48190c8c-42c4-46af-8d1a-0cd5db894797
This is far from ideal when it comes to retrieving contents with this field type, because the content editor does not have a way to set this field properly and make changes to persist once the content is saved/updated.
Expected Behavior
There are a few ways to proceed here:
Or
Current Behavior
Content may get saved in an improper way if we do not pass in the file URL as stated in our documentation. Passing in the content identifier only does not work as well.
Known Workarounds
None.
Context
Reported by customer https://dotcms.zendesk.com/agent/tickets/95857
Your Environment