I have been trying to insert images and videos and attach files to contents, using API v3. But, I have not been able to do that. Here are some example JSON objects I am sending.
When I am sending the JSON object for inserting images and videos, the POST request seems to work fine. However, the images and videos that I had put into the JSON doesn't seem to be posted, while the content is posted. Example JSON for images and videos that I have been using -
{ "content":{ "text":"description","type":"text/html" }, "contentImages":[{ "ref":"https://www.lamborghini.com/en-en/sites/en-en/files/DAM/lamborghini/model/one-off/centenario/gallery/thumb/centenario-1-thumb.jpg", "height":201,"contentType":"image/jpeg", "type":"image" }], "authorship":"open", "subject":"Pushpak's test discussion 009", "contentVideos":[{ "height":201,"videoSource":"https://www.youtube.com/watch?v=708mjaHTwKc","width":251 }], "parent":"/api/core/v3/places/myPlaceId", "question":true, "type":"discussion" }
In the above JSON the text seems to go through, while the images and videos are not posted. I get 201 as the response to this request.
When I am trying to attach files from my computer or from web, I am either getting an error:- unable to fetch fie. Here is the JSON that I am sending for this request
{ "content":{ "text":"description","type":"text/html" }, "authorship":"open", "subject":"Pushpak's test discussion 009", "attachments": [ { "doUpload": true, "url":"https://i.ytimg.com/vi/3vPo1c2f1I8/maxresdefault.jpg" } ], "parent":"/api/core/v3/contents", "question":true, "type":"discussion" }