Identify schema in variable schema reference

Hi,

I have a reference field that allows several schemas. Is there a way of knowing what kind of schemas these references are? When I request the content I only get the alphanumeric id value, and wouldn’t know how to do the query URL since it needs the schema name.

https://cloud.squidex.io/api/content/planetword-prod/introA?$filter=data/id/iv

Or is there a way of getting content without specifying the schema?

chapter
intro(accepts 3 kinds of intros)
introB
introA

For this example, there are only 3 possible schemas, the 3 intro variations.

Thank you very much for your time, Sebastian.

Hey,

each content item has an app name and schema name. See the following test that demonstrates that:

Hi Sebastian,

Is this the case also for the rest API?

I only get ids on the json.

“multichoiceArray”: {
“iv”: [
{
“multichoiceMultMedia”: [
“26a9ab85-e42f-4dc4-bb91-a5a0481223e4”,
“6a3471b2-b239-4f73-8475-b32dbf898356”
]
}
]
}

I mean you can use the described endpoint to query all referenced items and from these items you get the schema names.

Hi Sebastian,
Hope you are doing well.
Will be possible to get the Schema Name along with Reference Field id.
Eg:
“iv”: [
{
“multichoiceMultMedia”: [
{
“id”:“26a9ab85-e42f-4dc4-bb91-a5a0481223e4”,
“schema”:“IntroA”
},
{
“id”:“6a3471b2-b239-4f73-8475-b32dbf898356”,
“schema”:“introB”
}
]
}

Whi makes dev life easy to call the relevant API based on the schema.

Thanks in advance.

Regards
Venkata Phani kumar R

Why? You can just use the endpoint described above and then group by schema name

1 Like

If there is no such option then will hit endpoint.
However, In my case I don’t have clarity on what schema is going to be part of the Reference. If I know the schema name I can call related schema endpoint to get the information/content related to Reference.
In you approach i need to call
api/content/{app-Name}/?ids=d3dca83e-dcef-4efd-a6df-bad193e726d0,66ef4771-13f9-44a9-898d-462a678566f6

based on the response I need a group-by schema name to hit the relevant schema endpoint.

I want to avoid the multiple calls to know the schema of the reference filed.

Regards
Venkata Phani kumar R

You see that the endpoint above does not require a schema id or schema name. You can fetch contents across schemas.