Create messages

Messages are organized into categories in the API designer.  The following short video shows how we can create a new message category and a message within that:

After you are done you should have a message defined something like this:

You can make messages with nested data structures by creating what we call General types and re-using them in your definitions.  Think of these as complex types:

We should end with a message definition like this:

We can download the grammar we have defined in JSON:

The JSON grammar is an easy to read format:

{
   "Created": 1507137733,
   "ApiId": "C518D559100111B8F00F7D7267D321C9",
   "Description": "My first API with the API designer.",
   "Modified": 1507138542,
   "UserId": "1A06D559200098504B99C790E2240167",
   "Name": "Hello world",
   "IsPublic": 0,
   "SchemaVersion": 3,
   "Data": {
      "Categories": [
         {
            "Name": "World",
            "Doc": "My first category of messages in the API designer."
         }
      ],
      "Types": [
         {
            "Name": "Hello",
            "Category": "World",
            "Doc": "My first message - something trivial.",
            "HasResponse": true,
            "Members": [
               {
                  "IsRequired": true,
                  "Name": "Name",
                  "Doc": "",
                  "MemberType": {
                     "Name": "String",
                     "NodeType": "Primitive"
                  },
                  "IsArray": false
               }
            ],
            "NodeType": "Message"
         },
         {
            "Name": "Hello",
            "Category": "World",
            "Doc": "",
            "Members": [
               {
                  "IsRequired": false,
                  "Name": "Greeting",
                  "Doc": "",
                  "MemberType": {
                     "Name": "String",
                     "NodeType": "Primitive"
                  },
                  "IsArray": false
               },
               {
                  "IsRequired": false,
                  "Name": "Person",
                  "Doc": "",
                  "MemberType": {
                     "Name": "Person",
                     "NodeType": "General"
                  },
                  "IsArray": false
               }
            ],
            "NodeType": "Response"
         },
         {
            "Doc": "A person object.",
            "Name": "Person",
            "Members": [
               {
                  "IsRequired": false,
                  "Name": "LastName",
                  "Doc": "",
                  "MemberType": {
                     "Name": "String",
                     "NodeType": "Primitive"
                  },
                  "IsArray": false
               },
               {
                  "IsRequired": false,
                  "Name": "GivenName",
                  "Doc": "",
                  "MemberType": {
                     "Name": "String",
                     "NodeType": "Primitive"
                  },
                  "IsArray": false
               },
               {
                  "IsRequired": false,
                  "Name": "Title",
                  "Doc": "",
                  "MemberType": {
                     "Name": "String",
                     "NodeType": "Primitive"
                  },
                  "IsArray": false
               }
            ],
            "NodeType": "General"
         }
      ]
   }
}

The data model of this schema is very simple.

Leave A Comment?