Stream: dev

Topic: Create Guestbook using API


view this post on Zulip Dimitri Szabo (May 24 2024 at 14:22):

Hi there,
We've recently noticed that there were no issues to create guestbook (or guestbook entries) via APIs, which will be needed for SPA implementation of guestbook.
But writing the issue, I was wondering about the technical needs/choices, mostly the json input file, would it be ok to let it be minimal as the one to create collections or should we intent on new API calls to have something more complete in order to allow validations like datasets ?

view this post on Zulip Philip Durbin ๐Ÿš€ (May 24 2024 at 14:28):

The SPA will definitely need an API endpoint to create a guestbook so we should get some feedback from @Ellen K and @Guillermo Portas when the time is right.

view this post on Zulip Philip Durbin ๐Ÿš€ (May 24 2024 at 14:32):

As for the JSON, I would probably start with whatever minimal JSON can successfully create a guestbook.

view this post on Zulip Dimitri Szabo (May 29 2024 at 13:39):

Here is a proposition,
we are wondering if the separation between default fields and custom question to reproduce the UI workflow is relevant or more confusing to API users.

{
  "name": "Name of the Guestbook",
  "data": {
    "requiredFields": {
      "name": false,
      "email": false,
      "institution ": false,
      "position ": false
    },
    "customQuestions": [
      {
        "type": "text",
        "text": "What is the answer to the Ultimate Question of Life, the Universe, and Everything?",
        "required": false
      },
      {
        "type": "textarea",
        "text": "What is the answer to the Ultimate Question of Life, the Universe, and Everything?",
        "required": false
      },
      {
        "type": "options",
        "text": "What is the answer to the Ultimate Question of Life, the Universe, and Everything?",
        "options": [
            "41",
            "42",
            "43"
          ],
        "required": false
      }
    ]
  }
}

I'd also add in the issue the db fields but that's for the issue writing

view this post on Zulip Philip Durbin ๐Ÿš€ (May 29 2024 at 13:50):

Hmm, overall looks good, but I would remove the requiredFields object. It's clear from each customQuestions item whether it is required or not. No need to duplicate.


Last updated: Nov 01 2025 at 14:11 UTC