Recipe composition

Here is the explanation of meta data information that can and should be associated with each Recipe. There is also similar information associated with a ckbk file. A ckbk file can hold 1 or more Recipes.


name


    "recipes": [
        {
            "name": "This is the name of the 1st recipe.",

Description The name attribute is required for both the Cookbook and every Recipe within a Cookbook. It is simply the name of the object that is only used by human users, and not by the logic processor.

Links

Parameters Any String value.

collection role

"recipes": [
        {
            "name": "This is the name of the 1st recipe.",
"collectionRole": "Describes what a recipe does in the context of the activity"

Description

The collection role should describe what a recipe does in the context of the activity. For example, a recipe whose name is 'Check if the message contains the keyword' could have collectionRole set to 'KeywordChecker'. When the source template for an activity is updated, the collection role will be used to identify the existing recipes that need to replaced with the new ones.

Because of the role the collection role plays in activity updates, you should not change the collectionRole of a recipe when you tweak the functionality. Recipe processing queue entries that are targeted at the original recipe will not trigger the new recipe if the collectionRole is changed. The collection role is a required field and must be added to each recipe created in an activity.

Links

Parameters Any String value.

description


{
    "name": "The name of the whole Cookbook.",
"collectionRole": "Describes what a recipe does in the context of the activity",
"description": "A helpful description of the Cookbook setting out what the set of Recipe(s) does.",

Description The description attribute is required for both the Cookbook and every Recipe within a Cookbook. It is a written explanation of the object that is only used by human users, and not by the logic processor.

Links

Parameters Any String value.

author


{
    "author": "Mister Chef",

Description Sets the Author of the Cookbook. There is no author field for individual Recipes.

Links

Parameters Any String value.

version


{
    "version": "1.5.0",

Description This sets the version number of the ckbk format. This represents the version of the Recipe ‘engine’ that exported the Recipes. This should not be changed as it allows importing processes to understand the version of each function as it was created/exported.

Links

Parameters Any String value.

id


    "recipes": [
        {
            "name": "This is what the recipe is called!",
            "id": 11,

Description The id of a recipe is used for when other recipes reference it. A recipe may reference another recipe when it triggers it, or is triggered by it.

Links

Parameters Any String value.

enabled


        {
            "enabled": true,

Description This reflects the state of the recipe and whether or not it should trigger when a matching trigger interaction or time occurs. A disabled recipe will not trigger or execute any Actions if enabled is set to ‘false’.

Links

Parameters Any Boolean value.

recipes

    "recipes": [
        {
            "name": "Recipe 1",
            "id": 11,
            "enabled": true,
            "description": "Description of recipe 1",
        },
        {
            "name": "Recipe 2",
            "id": 245,
            "enabled": false,
            "description": "Description of recipe 2 is here",
        }
    ]

Description A cookbook stores an array of Recipes that hold all of its recipe data. The array is a JSON array of object.

Links

Parameters An array of Recipes in JSON array format.

triggers

    "triggers": [
        {
            "type": "TEXT_MESSAGE"
        },
        {
            "type": "MISSED_CALL"
        },
        {
            "type": "TIME",
            "data": {
                "scheduleType": "WEEKLY",
                "repeatFrequency": 1,
                "dayOfWeek": "MONDAY",
                "hourOfDay": 9,
                "minuteOfHour": 0
            }
        }
    ]

Description A Recipe stores an array of Triggers that hold all of the triggers that are associated with the Recipe. The array is a JSON array of object.

Links

Parameters An array of Triggers in JSON array format.

conditions

    "conditions": [
        {
            "type": "MessageTextContainsRule",
            "data": {
                "messageContainsText": "Keyword"
            }
        },
        {
            "type": "MessageTextStartsWithRule",
            "data": {
                "prefixText": "StartWord"
            }
        }
    ]

Description A Recipe stores an array of Conditions that hold all of the conditions that are associated with the Recipe. The array is a JSON array of object.

Links

Parameters An array of Conditions in JSON array format.

actions

    "actions": [
        {
            "type": "AddTagAction",
            "data": {
                "tagName": "Friendly texter"
            }
        },
        {
            "type": "AddToGroupAction",
            "data": {
                "groupName": "Friends"
            }
        }
    ]

Description A Recipe stores an array of Actions that hold all of the actions that are associated with the Recipe. A set of Actions in a Recipe are executed when all of the Conditions are passed. The array is a JSON array of object.

Links

Parameters An array of Actions in JSON array format.

Fallback Actions (also known as elseActions)

    "elseActions": [
        {
            "type": "AddTagAction",
            "data": {
                "tagName": "!Friendly texter"
            }
        },
        {
            "type": "AddToGroupAction",
            "data": {
                "groupName": "Enemies"
            }
        }
    ]

Description A Recipe stores an array of Fallback Actions that hold all of the fallback actions that are associated with the Recipe. A set of Fallback Actions are executed when one of more of the Conditions of the Recipe fail or prove False. The array is a JSON array of object.

Links

Parameters An array of Actions in JSON array format.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.