Event registration questions API

Add, update, and remove the registration questions on an event through the Heylo API, including multiple choice questions.

The API is included on the Business plan. See plans.

A registration question object is one question a person answers when they register for an event, such as a shirt size or an emergency contact. See registration questions for how members answer them. The registration questions of an existing event change one at a time, and a question keeps its ID and its answers when it changes. Every operation needs an API key with write access that covers the event's group.

Operations

  • Add a registration question: POST https://api.heylo.com/apiv1-create with type set to "eventRegistrationQuestion"
  • Update a registration question: POST https://api.heylo.com/apiv1-update with type set to "eventRegistrationQuestion"
  • Remove a registration question: POST https://api.heylo.com/apiv1-remove with type set to "eventRegistrationQuestion"

To set the registration questions of a new event, send registrationQuestions when you create the event. To read the answers, fetch event attendance.

Registration question object

Registration questions are returned inside an event object, in registrationQuestions. That field is an object keyed by registration question ID, so a registration question's ID is its key. Heylo assigns the ID, and it cannot be chosen. Attendance records key each person's answers by the same IDs.

Attributes

  • deleted (boolean): true for a question that was removed from the event. Registrants no longer see it, and its answers stay on the attendance records.
  • options (array): the choices of a multiple choice question. Each has a label (string) and an order (number).
  • order (number): the display position, lowest first.
  • required (boolean): whether a registrant must answer.
  • text (string): the question.
  • type (string): "text" or "multipleChoice".
  • visibility (string): "private" when only hosts and admins see the answers, or "visible".
json
{
  "HEYLO_REGISTRATION_QUESTION_ID": {
    "options": [
      {"label": "Easy", "order": 0},
      {"label": "Steady", "order": 1},
      {"label": "Fast", "order": 2}
    ],
    "order": 1,
    "required": true,
    "text": "Which pace group?",
    "type": "multipleChoice",
    "visibility": "visible"
  }
}

A request sends options as an array of strings. The event object returns each option with its label and its position.

Add a registration question

Adds one registration question to an event and returns the event. The event's other registration questions stay as they are, and Heylo does not notify members. An event can have up to 20 registration questions.

POST https://api.heylo.com/apiv1-create

Parameters

  • eventId (string, required): the event ID. The request takes no communityId.
  • registrationQuestion (object, required): the registration question to add. Do not send an id: Heylo assigns it.
    • text (string, required): the question, up to 120 characters.
    • options (array, optional): the choices of a multiple choice question, as 2 to 10 different strings of up to 100 characters each. Required for a multiple choice question, and not accepted for a text question.
    • order (number, optional): the display position, lowest first, from 0 to 1,000. A new question goes after the existing ones by default.
    • required (boolean, optional): whether a registrant must answer. false by default.
    • type (string, optional): "text" (the default) or "multipleChoice".
    • visibility (string, optional): "visible" (the default), or "private" so only hosts and admins see the answers.
  • type (string, required): "eventRegistrationQuestion".

One text question is available on all plans. More than one question, or a multiple choice question, needs Plus or higher. A request that asks for more than your group's plan includes returns a 400, and nothing is saved. Admins can change the plan in Admin Settings > Subscription.

Returns

  • event (object): the event object after the change.
  • registrationQuestionId (string): the ID Heylo assigned to the new registration question.
bash
curl -X POST https://api.heylo.com/apiv1-create \
  -H "Authorization: Bearer HEYLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "eventId": "HEYLO_EVENT_ID",
    "registrationQuestion": {
      "options": ["Easy", "Steady", "Fast"],
      "required": true,
      "text": "Which pace group?",
      "type": "multipleChoice"
    },
    "type": "eventRegistrationQuestion"
  }'
json
{
  "event": {
    "eventId": "HEYLO_EVENT_ID",
    "name": "Saturday long run",
    "registrationQuestions": {
      "HEYLO_REGISTRATION_QUESTION_ID": {
        "options": [
          {"label": "Easy", "order": 0},
          {"label": "Steady", "order": 1},
          {"label": "Fast", "order": 2}
        ],
        "order": 1,
        "required": true,
        "text": "Which pace group?",
        "type": "multipleChoice",
        "visibility": "visible"
      }
    }
  },
  "registrationQuestionId": "HEYLO_REGISTRATION_QUESTION_ID"
}

Update a registration question

Changes one registration question and returns the event. Only the fields you send change, and the question keeps its answers. Heylo does not notify members.

POST https://api.heylo.com/apiv1-update

Parameters

  • eventId (string, required): the event ID.
  • registrationQuestionId (string, required): the registration question's key in the event's registrationQuestions.
  • type (string, required): "eventRegistrationQuestion".
  • updates (object, required): the fields to change.
    • options (array): the choices of a multiple choice question, as 2 to 10 different strings. An update replaces the whole list.
    • order (number): the display position, lowest first, from 0 to 1,000.
    • required (boolean): whether a registrant must answer.
    • text (string): the question, up to 120 characters.
    • type (string): "text" or "multipleChoice". A change to "multipleChoice" needs options in the same request. A change to "text" drops the options.
    • visibility (string): "visible" or "private".

Returns

bash
curl -X POST https://api.heylo.com/apiv1-update \
  -H "Authorization: Bearer HEYLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "eventId": "HEYLO_EVENT_ID",
    "registrationQuestionId": "HEYLO_REGISTRATION_QUESTION_ID",
    "type": "eventRegistrationQuestion",
    "updates": {"required": false}
  }'

Remove a registration question

Removes one registration question from an event and returns the event. The event's other registration questions stay as they are, and Heylo does not notify members.

POST https://api.heylo.com/apiv1-remove

Parameters

  • eventId (string, required): the event ID.
  • registrationQuestionId (string, required): the registration question's key in the event's registrationQuestions.
  • type (string, required): "eventRegistrationQuestion".

Returns

bash
curl -X POST https://api.heylo.com/apiv1-remove \
  -H "Authorization: Bearer HEYLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "eventId": "HEYLO_EVENT_ID",
    "registrationQuestionId": "HEYLO_REGISTRATION_QUESTION_ID",
    "type": "eventRegistrationQuestion"
  }'

A removed question stays in the event object with "deleted": true, so the answers already given can still be matched to it. It cannot be updated or removed again.

Removing the last registration question on an event deletes every answer members gave to that event's questions.

Errors for registration questions

Registration question operations return the standard errors, with these cases:

  • 404: the event or the registration question does not exist, the question was already removed, or your key does not cover the event's group.
  • 400: the event is canceled. The registration questions of a canceled event cannot change.
  • 400: the change would give the event more than 20 registration questions.
  • 400: the change would give the event more than one question, or a multiple choice question, and your group's plan does not include them. Admins can change the plan in Admin Settings > Subscription.

Related articles

Still need help?

Contact us and we typically reply within one business day. Or message us in Heylo Support chat.