Skip to content
Menu
SilktideDevelopers

Get a section's metadata, and the properties it can have

GET/v1/websites/{websiteId}/sections/{sectionId}/meta
View as Markdown

Returns a section's metadata values, and every metadata property the account defines, so you can show the empty ones too. Section 0 is the whole website. See Metadata for what properties are.

values names only the properties that have been given a value. When none have, it is an empty array ([]) rather than an empty object, so check for both before you read it by name.

isRequired, min, max, choices and allowOther describe what a value is meant to be, for your own forms. Silktide does not enforce them; see Set a section's metadata.

Request
curl "https://api.eu.silktide.com/v1/websites/3/sections/2/meta" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY"
Response: A section with three values
{
  "values": {
    "region": "US",
    "author": "Jane Doe",
    "year": 2023
  },
  "properties": [
    {
      "name": "region",
      "label": "Region",
      "propertyType": "string",
      "isRequired": true,
      "min": null,
      "max": null,
      "choices": [
        "UK",
        "US",
        "Europe",
        "AU"
      ],
      "allowOther": false
    },
    {
      "name": "author",
      "label": "Author",
      "propertyType": "string",
      "isRequired": false,
      "min": null,
      "max": null,
      "choices": [
        "John Smith",
        "Jane Doe",
        "Joe Bloggs"
      ],
      "allowOther": true
    },
    {
      "name": "year",
      "label": "Year created",
      "propertyType": "int",
      "isRequired": false,
      "min": 1995,
      "max": 3000,
      "choices": null,
      "allowOther": false
    }
  ]
}

Request

Path parameters

  • websiteIdintegerrequiredat least 1

    The website.

  • sectionIdintegerrequired

    The section. 0 is the whole website.

Response

200JSON.

  • valuesmap of strings or numbers or booleans or empty listrequired

    The section's values, by property name. Only properties that have been given a value are here. An empty array ([]), not an object, when none have.

  • propertieslist of objectsrequired

    Every metadata property the account defines for sections, in the account's order.

    Show 8 fields
    • namestringrequired

      The property's name: the key of its value in values.

    • labelstringrequired

      Its name as people see it.

    • propertyTypestringrequired

      The type of value it holds.

      One ofstringintfloatboolurl

    • isRequiredbooleanrequired

      Whether every section is meant to have a value for it.

    • minintegerrequiredcan be null

      The smallest value (int, float) or shortest length (string, url) it is meant to take. Null for no limit.

    • maxintegerrequiredcan be null

      The largest value or longest length it is meant to take. Null for no limit.

    • choiceslist of stringsrequiredcan be null

      The values to pick from. Null when it has no list.

    • allowOtherbooleanrequired

      With choices, whether a value not in the list is meant to be allowed.

Errors

StatusTypeWhen
404ModelNotFoundNo website or section with those ids exists in the account, or the API key's user cannot see it.
403AccessDeniedThe API key's user cannot see this section.
401NotLoggedInNo API key was sent, or it is not a key for this region.(any operation)
429TooManyRequestsToo many requests to this path in five seconds. Retry after the number of seconds in the Retry-After header, which properties.retryAfter repeats.(any operation)
503-Silktide is busy. Retry after the number of seconds in the Retry-After header.(any operation)

Every error has the same body. See Errors.

Access

Permission
Can see section
Plan feature
None
Edition
Silktide 4 and Silktide 5
Cost
Free
Available since
v1.0.0

Try it

Sends a real request to your account from this browser. Your key stays in this tab and goes only to the Silktide API.