Sitefinity REST to create image meta data

153 Views Asked by At

I am trying to create an entry in Sitefinity 10.1.6523.0 for an image that is already stored in Amazon S3 by another application. Using Postman and http://local.mycompany.com/api/default/images with the request...

{ "PublicationDate":"2017-04-26T09:02:51Z", "ExpirationDate":null, "Title":"Summer Day", "Description":"Summer day description", "Ordinal":26, "UrlName":"summer-day", "Author":"Mr Smith", "AlternativeText":"a summer day", "FolderId":null, "ParentId": "4e7e106a-71c7-453d-9fdf-d04c208d473f", "Url": "https://s3-eu-west-1.amazonaws.com/test.uat.images.mycompany/images/default-source/test-library/cloudfront-test-image.png?sfvrsn=fec7b25a_2", "ThumbnailUrl": "https://s3-eu-west-1.amazonaws.com/test.uat.images.mycompany/images/default-source/test-library/cloudfront-test-image.tmb-thumbnail.png?sfvrsn=fec7b25a_1" }

This gives me the error

"innererror": { "message": "Image objects cannot be created without uploading the image.", "type": "System.InvalidOperationException",

But I don't want to upload the image as its already there! Am I missing something from the request, making the wrong request??

I just want to make the image appear within Sitefinity so it can be found and used.

Any clues would be appreciated thanks!

1

There are 1 best solutions below

1
On

That's not possible - even though the image is there in the cloud, Sitefinity has no knowledge of it, so it always expects a file stream.

Basically you need to download the image and re-upload it via Sitefinity - this way it will update all the necessary DB tables, etc.