agentejo / cockpit

Add content management functionality to any site - plug & play / headless / api-first CMS
http://getcockpit.com
MIT License
5.4k stars 524 forks source link

How to link an asset when creating an item via API #1509

Open weareexquisite opened 1 month ago

weareexquisite commented 1 month ago

Hey,

I seem to be having an issue when create a new item for a model using the API.

All of my fields are adding correctly except my assetlink field.

In short I have an asset in my assets list already that I want to link to all posts - I know the ID and the assetlink URL etc for this asset but I have no idea how to format my request so that my field actually links the asset..

In my JSON I have tried adding the asset ID, the Asset link URL but so far nothing works... Does anyone have an example of how that json needs to be formatted? What do I use to link it?

Any help much appreciated.