Collections and feeds

Docs API reference

Collections and feeds

Collections hold the records templates fill from; a feed (RSS, Atom, JSON Feed or a news website) keeps one up to date. Each feed item is a record with title, summary, image, date, time, author, category, link and feed_title. Write records yourself under Records.

List collections

GET /collections data

Parameters

  • limit integer query

    Page size, 1–200.

    1–200. Default 50

  • cursor string query

    The next_cursor of the previous page.

Responses

  • 200 A page of collections.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
Response fields (200)
  • items object[] required
    8 fields in items
    • id string required
    • name string required
    • prefix string required

      Its records’ refs start with this.

    • fields string[]
    • field_types map of string

      Per field: text, date (YYYY-MM-DD), time (HH:MM), image (asset:<id> or https://…), presenters (write <name>_ids = presenter ids; <name>, <name>_title, <name>_organization and <name>_photo are derived) or record (write <name>_ref = refs of records in the linked collection; <name> = their titles and <name>_<field> for each field of that collection are derived, and kept current).

    • field_links map of string

      A record field → the id of the collection it links to.

    • title_field string or null
    • template_id string or null
  • next_cursor string or null required

    Pass as cursor for the next page; null on the last page.

curl "https://www.wunderframe.com/api/v1/collections?limit=50" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY"
Response 200
{
  "items": [
    {
      "id": "col_news",
      "name": "News",
      "prefix": "news/",
      "fields": [
        "title",
        "summary",
        "image"
      ],
      "template_id": "scn_headline"
    }
  ],
  "next_cursor": null
}
Error example
Response 401
{
  "error": {
    "code": "unauthorized",
    "message": "Missing or invalid API key."
  }
}

Create a collection

POST /collections data

Request body required

  • name string required
  • prefix string
  • fields object[]

    The field list, in order, with types. Optional; fields also grow as records arrive.

    5 fields in fields
    • name string required
    • label string
    • type string

      One of text, date, time, image, presenters, record

    • hidden boolean
    • collection string

      type record: the id of the collection it links to. A record field named sponsor owns every sponsor_… value; no other field may start with sponsor_.

  • title_field string

    The field that names a record.

Responses

  • 201 The collection.
  • 400 The request is invalid — details.field names the field when there is one.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
Response fields (201)
  • id string required
  • name string required
  • prefix string required

    Its records’ refs start with this.

  • fields string[]
  • field_types map of string

    Per field: text, date (YYYY-MM-DD), time (HH:MM), image (asset:<id> or https://…), presenters (write <name>_ids = presenter ids; <name>, <name>_title, <name>_organization and <name>_photo are derived) or record (write <name>_ref = refs of records in the linked collection; <name> = their titles and <name>_<field> for each field of that collection are derived, and kept current).

  • field_links map of string

    A record field → the id of the collection it links to.

  • title_field string or null
  • template_id string or null
curl -X POST "https://www.wunderframe.com/api/v1/collections" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "News"
}'
Response 201
{
  "id": "col_news",
  "name": "News",
  "prefix": "news/",
  "fields": [
    "title",
    "summary",
    "image"
  ],
  "template_id": "scn_headline"
}
Error example
Response 400
{
  "error": {
    "code": "invalid",
    "message": "The request is invalid — `details.field` names the field when there is one."
  }
}

Feed a collection

POST /collections/{id}/feeds data

Read at once, then on schedule (off, 5m, 15m default, 1h, 1d).

Parameters

  • id string required path

    The collection id.

Request body required

  • url string required
  • name string
  • schedule string

Responses

  • 201 The source, and how many items it read.
  • 400 The request is invalid — details.field names the field when there is one.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
Response fields (201)
  • source_id string
  • items integer
  • error string or null
curl -X POST "https://www.wunderframe.com/api/v1/collections/wkFRBzMq6POZ_qYJHvgQf/feeds" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://www.srf.ch/news/bnf/rss/1646",
  "schedule": "15m"
}'
Response 201
{
  "source_id": "string",
  "items": 0,
  "error": "string"
}
Error example
Response 400
{
  "error": {
    "code": "invalid",
    "message": "The request is invalid — `details.field` names the field when there is one."
  }
}

Read a source again now

POST /sources/{id}/sync data

Parameters

  • id string required path

    The source id.

Responses

  • 200 How it went.
  • 400 The request is invalid — details.field names the field when there is one.
  • 401 Missing or invalid API key.
  • 403 The key lacks the scope, or the role is read-only.
Response fields (200)
  • items integer
  • error string or null
curl -X POST "https://www.wunderframe.com/api/v1/sources/wkFRBzMq6POZ_qYJHvgQf/sync" \
  -H "Authorization: Bearer $WUNDERFRAME_API_KEY"
Response 200
{
  "items": 0,
  "error": "string"
}
Error example
Response 400
{
  "error": {
    "code": "invalid",
    "message": "The request is invalid — `details.field` names the field when there is one."
  }
}