Assets and Tags


#1

Is it possible to get tags associate to a specific Asset ?
I mean using the REST API
Thanks
Fabio


#2

Of course. The syntax is:

https://cloud.squidex.io/api/apps/squidex-website/assets?$filter=tags eq 'image' and tags eq 'image/large'&$top=30&$skip=0

It is a normal filter.

You can also check the docs for contents for more examples: https://docs.squidex.io/guides/02-api#usdfilter

Check the asset structure in the API docs for all fields: https://cloud.squidex.io/api/docs#operation/Assets_GetAssets

BTW: Everything you can do in the UI can also be done with the API. (Except creating apps)


#3

Thanks for your answer, but probably I didn’t explain my request.
I have an asset (e.g. 6f0b0007-736a-4db5-beb9-34ea18416232) and I want to get its tags
Something like the following:

Request:
https://cloud.squidex.io/api/assets/6f0b0007-736a-4db5-beb9-34ea18416232?$filter=tags

Response:
{
“iv”: “6f0b0007-736a-4db5-beb9-34ea18416232”,
“tags”: [ “images”, “test”]
}

Fabio


#4

Sorry. This API does not exist yet, it was just not needed. But you can use the assets endpoint with:

 https://cloud.squidex.io/api/apps/MY_APP/assets?$filter=id eq 'MY_ID'