Uploading assets via the API

Greetings everyone,

Very nice software by the way. I love it so far. Keep it up!

I am trying to migrate some data from another CMS and have images I need to migrate. I am using the REST api for now and have been doing it just fine without images. However, I can’t seem to upload images using the /api/assets endpoint. Is there something I am missing on uploading assets?

Thanks,
Jon

Hi, you can use this endpoint: https://cloud.squidex.io/api/docs#operation/Assets_PostAsset

You have to provide the file in the body as multipart encoded content.

Here is some sample code in C#: https://github.com/Squidex/squidex-samples/blob/master/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/SquidexAssetClient.cs

It is also available in nuget btw.

Ah! I missed that. /api/apps/<APP>/assets Thanks for pointing that out. That looks like it will work. Solves the issue.

Would be great to get a confirmation that it works for you, so that I can close this topic.

Yep, lets close it. Good to go.