Choose your language:
    List all fieldsets
    Returns
    Returns an array of fieldset objects.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const modelIdOrApiKey = 'blog_post';
    client.fieldsets.all(modelIdOrApiKey)
    .then((fieldsets) => {
    fieldsets.forEach((fieldset) => {
    console.log(fieldset);
    });
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "124",
    "title": "SEO-related fields",
    "hint": "Please fill in these fields!",
    "collapsible": true,
    "startCollapsed": false,
    "position": 1,
    "itemType": "44"
    }