API field - Get allowed values

Hello, because I didn’t figured out from the docs what the title states, I was wondering if there’s any way to get the allowed values of a field.
In my example, I have a tags field with a set of defaults, and I would extract them (with GraphQL would be awesome) in order to dynamically populate some parts of a front-end:

{
  fields {
{
            "name": "tags",
            "properties": {
                "isRequired": true,
                "fieldType": "Tags",
                "editor": "Tags",
                "allowedValues": [
                    "foo",
                    "bar",
                    // etc.
                ],
                "label": "Tags"
            },
            "partitioning": "invariant"
        },}
}

Is this possible?

Thanks in advance.

Only with the schema endpoint:

https://cloud.squidex.io/api/docs#operation/Schemas_GetSchema

1 Like

Awesome. I’ll going to try it for sure.

Many thanks

1 Like

Just a question, I’m receiving a 401 on schema GET. I’m using the same auth token for the content operations. Am I wrong?

That should work. Can you test to change the permissions to Editor for your client?

Nothing. Still 401 both with Developer than Editor permissions.
Of course I’m including the required options:

[...]

const resTags = await fetch('https://cloud.squidex.io/api/apps/lc-blog-backend/schemas/article', {
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'Content-Type': 'application/json'
    }
  });

[...]

I tested with editor permissions and it works:

1 Like

You’re right. I tested mine again on Postman too and works correctly.
I’ve just found a bad snippet on my front-end code, which was truncating for some reason my access_token.

Thanks again.

1 Like