Create a Personality Test

When building a personality test you can add:

Setting personalities

For each personality test build configuration you must define at least two personalities. This is done in the personalities property of the build object.

Properties

PropertyRequiredTypeDescriptionDefault
titlestringThe title of the personality
descriptionstringThe description of the personality
mediastringA media URL to an image to display as part of the personality

Example

For the example let's add a SingleChoice question (which is described further in the next section):

{
    "type": "Personality",
    "build": {
        "personalities": [
            {
                "title": "Introvert",
                "description": "Prefers solitary activities and quiet environments.",
                "media": "https://example.com/introvert.jpg"
            },
            {
                "title": "Extrovert",
                "description": "Enjoys socializing and being around others.",
                "media": "https://example.com/extrovert.jpg"
            }
        ],
        "blocks": [
            {
                "title": "Do you enjoy social gatherings?",
                "type": "SingleChoice",
                "items": {
                    "Yes": {
                        "scores": [0, 1]
                    },
                    "No": {
                        "scores": [1, 0]
                    }
                }
            }
        ]
    }
}

Add single/multiple choice questions

Properties

PropertyRequiredTypeDescriptionDefault
titlestringtitle of the question
typestringset to SingleChoice or MultipleChoice
itemsobjectkey-value array, consisting of the question as the key and the value is an object, see specification below
itemsShuffledbooleanIf set to true, the order of the items/choices will be shuffledfalse
layoutTypestringThe layout of the items, either Rows or ColumnsRows

Example object

{
    "title": "Do you enjoy social gatherings?",
    "type": "SingleChoice",
    "items": {
        "Yes": {
            "scores": [0, 1]
        },
        "No": {
            "scores": [1, 0]
        }
    }
}

Each item in the items object consists of:

PropertyRequiredTypeDescription
scoresinteger[]An array of integers representing the score for each personality. The order of the scores must match the order of the personalities defined in the personalities array.

Result page

In a personality test only one result page is allowed which is specified in build.result. Basic results have a title and description property.

Example in build.result:

{
    "title": "Thank you!",
    "description": "We are happy to have you here"
}

Tip: The "winning personality" and "other personalities" are available as blocks in the result page (also used in the full example below). Use them along text, images, etc to create a more engaging result experience. Learn more

Full example

{
    "type": "Personality",
    "build": {
        "title": "Personality example (Builder API)",
        "personalities": [
            {
                "title": "Pikachu",
                "description": "You are energetic and love to be around friends."
            },
            {
                "title": "Bulbasaur",
                "description": "You are calm and enjoy nature."
            }
        ],
        "blocks": [
            {
                "title": "Which vegetables do you like?",
                "type": "MultipleChoice",
                "items": {
                    "Carrot": {
                        "scores": [
                            0,
                            1
                        ]
                    },
                    "Broccoli": {
                        "scores": [
                            1,
                            0
                        ]
                    },
                    "Spinach": {
                        "scores": [
                            0,
                            1
                        ]
                    }
                }
            },
            {
                "title": "What is your favorite time of the day?",
                "type": "SingleChoice",
                "items": {
                    "Morning": {
                        "scores": [
                            1,
                            0
                        ]
                    },
                    "Afternoon": {
                        "scores": [
                            1,
                            0
                        ]
                    },
                    "Evening": {
                        "scores": [
                            0,
                            1
                        ]
                    }
                }
            }
        ],
        "result": {
            "blocks": [
                {
                    "type": "WinningPersonality"
                },
                {
                    "type": "Text",
                    "text": "<h2>Thank you for taking the test!</h2><p>We hope you enjoyed finding out which pokemon matches your personality.</p>"
                },
                {
                    "type": "OtherPersonalities"
                },
                {
                    "type": "Share",
                    "title": "Share this personality test!"
                }
            ]
        }
    }
}