Prevent base url on image path save through API request

Since Cockpit doesn’t easily support saving image files through an api call, I thought of saving images on an external API. So i tried the following:

Post http://otherimageurl.com/image.jpg to
http:mycockpitcmsurl.com/api/collections/save/collectionname

in the field
{

image: {
path: “SAVE IMAGE URL HERE.”
}

}

But cockpit saves its own base url in front of my external image url.
Is there a possibility to prevent cockpit CMS to automatically save the base-url of cockpit when accessing through an API post call, for example in a custom API call?

there is an add assets api entry point:

/api/cockpit/addAssets

I never tried it before and tested it now. It works well. Make sure, to name your key files[].

Javascript example: https://github.com/agentejo/cockpit/issues/763#issuecomment-434509812

Postman example:

2 Likes