Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can use the API to get the questions within a survey form, i.e. the Changes, Indicators, Outcomes, Text fields, Attachment fields, Sections, Time fields and Date fields within a Story Category.

API Documentation

...

  • Endpoint: GET /api/v2/story_categories/:id

  • Authentication: Requires valid authentication token

  • Response

...

  • Format: JSON

  • Query Parameter

    • id (integer): The unique identifier for the story category.

      • story category must be viewable by the requesting user

...

Response Attributes

  • id (integer): The unique identifier for the story category.

  • name (string): The name of the story category.

  • color (string): The color code associated with the story category.

  • updated_at (string, ISO 8601 datetime): The timestamp when the story category was last updated.

  • created_at (string, ISO 8601 datetime): The timestamp when the story category was created.

  • is_stopped (boolean): Indicates whether the story category is stopped or active.

  • is_default (boolean): Indicates whether the story category is the default.

  • description (string): A description of the story category.

  • intro_message (string): An introductory message for the story category.

  • current_fields (array of objects): Details about the current fields in the story category.

    • id (integer): The unique identifier for the current field

    • field_id (integer): The ID of the field.

      • If the field class name is indicator, then field_id is an indicator id.

    • field_name (string): The name of the field.

    • field_class_name (string): The class name of the field.

    • priority (integer): The order of the question in the survey.

      • 1 is for 1st question, 2 for 2nd question and so on.

    • is_mandatory (boolean): Indicates whether the field is mandatory.

    • display_info (string): Information about how the field is displayed.

    • document_category_id (integer): The ID of the document category (if applicable).

    • outcome_id (integer): The ID of the outcome associated with the field.

    • indicator_type (string): The type of indicator for the field (if applicable).

    • change_type (string): The type of change for the field (if applicable).

  • scale_indicator_choices (array of objects): Choices available for scale indicator fields.

    • id (integer): The unique identifier for the choice.

    • indicator_id (integer): The ID of the associated scale indicator.

    • choice (string): The type of choice (e.g., "single_choice").

    • choice_value (string): The value associated with the choice.

Example

GET https://makerble.com/api/v2/story_categories/841header:
{“X-User-Token”: b7c+D5o0joNRXMVNycN696yJZkuWshy4Zw66qWSJ--tT63Ev/FYFl00rCr--WomZk6tiLoXtapKgB/EtZA==,
“X-User-Token”: “souleditor@makerble.com“}

...

Response

Code Block
{
    "id": 841,
    "name": "Example Survey",
    "color": "#f16e20",
    "updated_at": "2022-05-24T09:33:38.022+01:00",
    "created_at": "2022-05-24T09:33:38.022+01:00",
    "is_stopped": false,
    "is_default": false,
    "description": "",
    "intro_message": "",
    "current_fields": [
        {
            "id": 14397,
            "field_id": 177,
            "field_name": "Location",
            "field_class_name": "CustomField",
            "priority": 3,
            "is_mandatory": false,
            "display_info": "mouseover",
            "document_category_id": null
        },
        {
            "id": 14403,
            "field_id": 577,
            "field_name": "aa test indicator",
            "field_class_name": "Indicator",
            "priority": 9,
            "is_mandatory": false,
            "display_info": "mouseover",
            "document_category_id": null,
            "outcome_id": 528,
            "indicator_type": "scale"
        }
    ],
    "scale_indicator_choices": [
        {
            "id": 354,
            "indicator_id": 577,
            "choice": "single_choice",
            "choice_value": ""
        },
        {
            "id": 355,
            "indicator_id": 578,
            "choice": "single_choice",
            "choice_value": ""
        }
    ]
}