Requests and responses

See below commented examples for each recognition type, to help you understand the whole process. Note these examples are therefore not functional as is.

Text example

/*
* THE REQUEST SENDING INPUT AND PARAMETERS
* This is an example of input, used to transmit a recognition request for ink strokes,  
* forming the word "Go".
* textParameter is used to pass all parameters that you need or wish to use, depending on  
* what will be recognized and what the recognition result should give you in return.
* inputUnit is used to describe the form of the input and pass the XY array of strokes.
*/

/**
* Depending on your invoicing method, you may need to pass certain parameters that allow
* the server to keep a count of your traffic, e.g. the number of containers recognized,
* the number of user IDs passed, etc.
*/
	containerType=myContainerType  
	&containerId=myContainerId  
	&userId=myUserId
/**
* You must pass this key which identifies you as an authentic user.
*/
	&apiKey=whatever_your_key_is
/** 
* The server will process the recognition the Digital Inks (components).
* Additional recognition parameters (textParameter)are required.
*/
	&textInput=
	{  
	"textParameter":{  
    	 "textInputMode":"CURSIVE",
    	 "resultDetail":"CHARACTER",
/**
* This describes the level of depth of the result, it can be CHARACTER, WORD, TEXT.
* If you choose TEXT, you will just get the final result for the totality of the strokes
* sent in that request.
* If you choose WORD, you will get the result word by word, and so on.
*/ 
	"textProperties":{  
      	  "textCandidateListSize":1,
      	  "wordCandidateListSize":1,
       	 "characterCandidateListSize":1
   	  },
/**
* This describes the number of candidates (alternative conversions) that will be proposed
* in the returned result. Maximum list size is 20.
*/
	"language":"en_US",
/**
* This is the language and country code corresponding to the language in which the strokes
* are written, for example French from Canada (fr_CA), Hungarian from Hungary (hu_HU) etc.
* Fetch all available codes with a GET request.
*/ 
	"contentTypes":[  
        	"text"
     	]
/**
* This describes the expected type of content.
* This determines the language resources that the recognizer will use to 'understand' the input
* better (for example a lexicon of names). Here it uses a broad lexicon of general text.
*/
	},

	"inputUnits":[  
      {  
         "textInputType":"SINGLE_LINE_TEXT",
/**
* This describes what the input form is - is it solely a character (CHAR), a word (WORD),
* or a line of text (SINGLE_LINE_TEXT)?
*/ 
	"components":[  
            {  
               "type":"stroke",
/**
* The component type is usually "stroke" but can also be a string or character if you want
* to add existing digital text to the input.
*/ 
				"x":[333.5,332.5,326.5,322.5,318.5,313.5,308.5,303.5],
                "y":[176.5,163.5,162.5,162.5,162.5,163.5,165.5,167.5]
            },
/**
* These arrays describe the X and Y points that the stroke trajectory follows. These elements 
* must be captured by an ink detection system of your own deployment.
*/
            {  

               "type":"stroke",
               "x":[359.5,361.5,368.5,371.5,375.5,379.5,382.5,385.5],
               "y":[207.5,226.5,228.5,228.5,228.5,227.5,226.5,224.5],
            }
         ]
      }
	]
	}
/**
* This is the end of the request.
*/
  
/**
* Process to send the request
* /

/**
* First step: encode your input
*/
	myVariableEncoded=myVariable_urlEncoded
/**
* Second step: send your JSON request with your data
*/
	apiKey=your_apiKey&textInput=myVariableEncoded
/**
* This is the end of the request.
*/

/**
* Here is the result. It is displayed as a hierarchical tree, where the candidates are shown for
* each level of the result, with the corresponding ink ranges. In this example only one
* candidate appears as we asked for only one candidate on each level, in the original request.
* If you request more candidates, more will be displayed in the result.
*/
	result :

	{  
	"instanceId":"0ceaff00-3de4-4a6f-80ff-da845780021b",
	"result":{  
      "textSegmentResult":{  
         "selectedCandidateIdx":0,
         "candidates":[  
            {  
               "label":"Go",
/**
* The label is the actual recognition result.
*/
               "normalizedScore":1.0,
               "resemblanceScore":0.6266748,
/**
* The recognition score measures the recognizer's confidence in the result. This is a value
* between 0 and 1, with 1 meaning highly confident.
*/
               "spellingDistortionRatio":0.0,
               "children":[  
                  {  
                     "inkRanges":"0-0-0:0-1-27",
                     "selectedCandidateIdx":0
                  }
               ]
            }
         ]
      },
      "wordCandidates":[  
         {  
            "inkRanges":"0-0-0:0-1-27",
            "candidates":[  
               {  
                  "label":"Go",
                  "normalizedScore":1.0,
                  "resemblanceScore":0.6266748,
                  "spellingDistortionRatio":0.0,
                  "children":[  
                     {  
                        "inkRanges":"0-0-0:0-0-59",
                        "selectedCandidateIdx":0
                     },
                     {  
                        "inkRanges":"0-1-0:0-1-27",
                        "selectedCandidateIdx":0
                     }
                  ]
               }
            ]
         }
      ],
      "charCandidates":[  
         {  
            "inkRanges":"0-0-0:0-0-59",
            "candidates":[  
               {  
                  "label":"G",
                  "normalizedScore":0.7529412,
                  "resemblanceScore":0.6486349,
                  "spellingDistortionRatio":0.0
               }
            ]
         },
         {  
            "inkRanges":"0-1-0:0-1-27",
            "candidates":[  
               {  
                  "label":"o",
                  "normalizedScore":0.53333336,
                  "resemblanceScore":0.6266748,
                  "spellingDistortionRatio":0.0
               }
            ]
         }
      ],
      "tagItems":[  
         {  
            "tagType":"TEXT_LINE",
            "inkRanges":"0-0-0:0-1-27"
         },
         {  
            "tagType":"TEXT_BLOCK",
            "inkRanges":"0-0-0:0-1-27"
         }
      ]
	}
	}

Shape example

/**
* THE REQUEST SENDING INPUT AND PARAMETERS
* This is an example of input, used to transmit a recognition request for shape,
* forming in this example an ellipse, arrow and triangle.
* A shape request is quite simple. You only have to pass the XY array of strokes.
*/

/**
* Depending on your invoicing method, you may need to pass certain parameters that allow
* the server to keep a count of your traffic, e.g. the number of containers recognized,
* the number of user IDs passed, etc.
*/
	containerType=myContainerType1
	&containerId=myContainerId1
	&userId=myUserId1
/**
* You must pass this key which identifies you as an authentic user.
*/
	&apiKey=whatever_your_key_is

	shapeInput=

	{  
	"components":[  
      {  
         "type":"stroke",
         "x":[279.5,277.5,276.5,273.5,272.5,271.5,270.5],
         "y":[113.5,113.5,113.5,114.5,115.5,116.5,116.5]
      },
      {  
         "type":"stroke",
         "x":[333.5,334.5,336.5,339.5,341.5,342.5,345.5,347.5,350.5,353.5,356.5,359.5],
         "y":[163.5,163.5,163.5,162.5,162.5,162.5,162.5,162.5,162.5,162.5,162.5,162.5]
      },
      {  
         "type":"stroke",
         "x":[450.5,450.5,452.5,456.5,459.5,460.5,462.5,464.5,465.5],
         "y":[152.5,151.5,151.5,151.5,152.5,152.5,154.5,155.5,155.5]
      },
      {  
         "type":"stroke",
         "x":[505.5,506.5,507.5,510.5,510.5,510.5,510.5,510.5],
         "y":[218.5,218.5,217.5,215.5,212.5,205.5,200.5,196.5]
      }
   ]
}
/**
* Process to send the request
*/

/**
* First step: encode your input
*/
	myVariableEncoded=myVariable_urlEncoded
/**
* Second step: send your JSON request with your data
*/
	apiKey=your_apiKey&shapeInput=myVariableEncoded
/**
* This is the end of the request.
*/

/**
* Here is the result
*/

/**
* Our example was a circle, followed by an arrow, then a triangle. Each shape is returned 
* with a label followed by its primitives - the elements that make it up.
* The geometrical details are given that allow the shape to be reconstitued.
*/
	result :
	{  
	"instanceId":"your_instance_ID",
	"result":{  
      "segments":[  
         {  
            "elementType":"shape",
            "selectedCandidateIndex":0,
            "candidates":[  
               {  
                  "type":"recognizedShape",
                  "label":"line",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0,
                        "endTangentAngle":0,
                        "firstPoint":{  
                           "x":279.2841,
                           "y":112.91761
                        },
                        "lastPoint":{  
                           "x":270.39377,
                           "y":116.21341
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0,
                  "resemblanceScore":0
               }
            ],
            "inkRanges":[  
               {  
                  "firstStroke":0,
                  "lastStroke":0,
                  "firstPoint":0,
                  "lastPoint":6
               }
            ],
            "uniqueID":""
         },
         {  
            "elementType":"shape",
            "selectedCandidateIndex":0,
            "candidates":[  
               {  
                  "type":"recognizedShape",
                  "label":"line",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0,
                        "endTangentAngle":0,
                        "firstPoint":{  
                           "x":333.48834,
                           "y":163.03818
                        },
                        "lastPoint":{  
                           "x":359.497,
                           "y":162.38153
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0,
                  "resemblanceScore":0
               }
            ],
            "inkRanges":[  
               {  
                  "firstStroke":1,
                  "lastStroke":1,
                  "firstPoint":0,
                  "lastPoint":11
               }
            ],
            "uniqueID":""
         },
         {  
            "elementType":"shape",
            "selectedCandidateIndex":0,
            "candidates":[  
               {  
                  "type":"recognizedShape",
                  "label":"line",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0,
                        "endTangentAngle":0,
                        "firstPoint":{  
                           "x":450.70743,
                           "y":150.74568
                        },
                        "lastPoint":{  
                           "x":465.67557,
                           "y":154.86148
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0,
                  "resemblanceScore":0
               }
            ],
            "inkRanges":[  
               {  
                  "firstStroke":2,
                  "lastStroke":2,
                  "firstPoint":0,
                  "lastPoint":8
               }
            ],
            "uniqueID":""
         },
         {  
            "elementType":"shape",
            "selectedCandidateIndex":0,
            "candidates":[  
               {  
                  "type":"recognizedShape",
                  "label":"line",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0,
                        "endTangentAngle":0,
                        "firstPoint":{  
                           "x":508.99744,
                           "y":218.71707
                        },
                        "lastPoint":{  
                           "x":512.1481,
                           "y":182.4694
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0,
                  "resemblanceScore":0
               }
            ],
            "inkRanges":[  
               {  
                  "firstStroke":3,
                  "lastStroke":3,
                  "firstPoint":0,
                  "lastPoint":10
               }
            ],
            "uniqueID":""
         }
      ]
	}
	}
/**
* This is the end of the result.
*/

Analyzer example

/**
* THE REQUEST SENDING INPUT AND PARAMETERS
* This is an example of input, used to transmit a recognition request for analyzer, forming in
* this example a box which contains the word "start", an arrow and an ellipse which contains
* the word "end".
* An analyzer request is quite simple. You only have to pass the XY array of strokes and a
* parameter object used to pass all parameters that you need or wish to use, depending on
* what will be recognized and what the recognition result should give you in return.
*/

/**
* Depending on your invoicing method, you may need to pass certain parameters that allow
* the server to keep a count of your traffic, e.g. the number of containers recognized,
* the number of user IDs passed, etc.
*/
	containerType=myContainerType1
	&containerId=myContainerId1
	&userId=myUserId1
/**
* You must pass this key which identifies you as an authentic user.
*/
	&apiKey=whatever_your_key_is

	myVariable=
	{  
	"components":[  
      {  
         "type":"stroke",
         "x":[169,169,169,169,168,168,168,167,167,166],
         "y":[235,234,233,232,231,230,229,229,228,227]
      },
      {  
         "type":"stroke",
         "x":[165,166,166,166,167,168,170,172,174,176],
         "y":[287,287,288,289,289,289,290,290,290,290]
      },
      {  
         "type":"stroke",
         "x":[271,272,273,273,275,277,278,280,282,284],
         "y":[294,294,295,296,297,298,298,299,299,299]
      },
      {  
         "type":"stroke",
         "x":[324,324,325,327,329,331,334,337,341,344,348,350,351,352],
         "y":[236,235,235,234,233,232,232,231,230,230,230,230,230,230]
      },
      {  
         "type":"stroke",
         "x":[208,209,210,211,212,213,215,216,217,219,220,223,226,229],
         "y":[237,237,237,237,237,237,237,237,237,237,237,237,237,238]
      },
      {  
         "type":"stroke",
         "x":[655,656,657,659,662,666,670,674,679,682,685,688],
         "y":[301,301,301,301,302,302,303,303,303,302,302,301]
      },
      {  
         "type":"stroke",
         "x":[772,771,771,771,770,770,769,769,768,768,767,767],
         "y":[302,301,300,299,297,295,293,291,289,286,284,280]
      },
      {  
         "type":"stroke",
         "x":[97,98,98,98,98,99,99,99,99,100,100,100],
         "y":[186,186,187,188,190,192,194,197,200,204,207,211]
      },
      {  
         "type":"stroke",
         "x":[737,735,731,728,725,723,719,715,711,707,702,696],
         "y":[207,207,207,207,207,207,207,208,208,208,210,211]
      },
      {  
         "type":"stroke",
         "x":[383,384,385,386,387,388,392,395,398,402,406,409],
         "y":[273,273,273,274,274,274,274,275,275,276,277,278]
      },
      {  
         "type":"stroke",
         "x":[544,545,546,547,547,548,549,549,551,551,552,553],
         "y":[298,297,297,296,295,295,295,294,294,293,293,292]
      }
	],
	"parameter":{  
      "textParameter":{  
         "resultDetail":"TEXT",
         "textProperties":{  

         },
         "language":"en_US"
      },
      "coordinateResolution":0
	}
	}
/**
* Process to send the request
*/

/**
* First step: encode your input
*/
	myVariableEncoded=myVariable_urlEncoded
/**
* Second step: send your JSON request with your data
*/
	apiKey=your_apiKey&shapeInput=myVariableEncoded
/**
* This is the end of the request.
*/

/**
* Here is the result
*/

/**
* Our example was a box with "start" text inside, followed by an arrow, then a ellipse with
* "end" text inside.
* Textlines hierarchical tree, where the candidates are shown for each level of the result,
* with the corresponding ink ranges. In this example only one candidate appears as we asked
* for only one candidate on each level, in the original request.
* If you request more candidates, more will be displayed in the result.
* Shapes contains each shape returned with a label followed by its primitives - the elements
* that make it up.
* The geometrical details are given that allow the shape to be reconstitued.
* Tables contains each cells returned with a label and a contained object.
* Groups references above objects groups as LIST, PARAGRAPH or TEXT_INSIDE_GRAPHICS
*/
	analyzerOutput=
	{  
	"instanceId":"your_instance_ID",
	"result":{  
      "uniqueID":"N/A",
      "textLines":[  
         {  
            "elementType":"textLine",
            "uniqueID":"0",
            "data":{  
               "baselinePos":335.52094,
               "toMidline":0.0,
               "orientation":0.0,
               "topLeftPoint":{  
                  "x":418.51526,
                  "y":198.46405
               },
               "height":157.0,
               "width":278.0,
               "textHeight":82.60055,
               "justificationType":"CENTER"
            },
            "result":{  
               "textSegmentResult":{  
                  "selectedCandidateIdx":0,
                  "candidates":[  
                     {  
                        "label":"two",
                        "normalizedScore":1.0,
                        "resemblanceScore":0.07754552
                     }
                  ]
               }
            },
            "underlineList":[  

            ],
            "inkRanges":[  
               {  
                  "firstPoint":0.0,
                  "lastPoint":167.0,
                  "stroke":1
               }
            ]
         }
      ],
      "shapes":[  
         {  
            "elementType":"shape",
            "selectedCandidateIndex":0,
            "candidates":[  
               {  
                  "type":"recognizedShape",
                  "label":"rectangle",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":382.21716,
                           "y":122.64729
                        },
                        "lastPoint":{  
                           "x":321.88538,
                           "y":362.3778
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":321.88538,
                           "y":362.3778
                        },
                        "lastPoint":{  
                           "x":732.8135,
                           "y":465.794
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":732.8135,
                           "y":465.794
                        },
                        "lastPoint":{  
                           "x":793.1452,
                           "y":226.0635
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":793.1452,
                           "y":226.0635
                        },
                        "lastPoint":{  
                           "x":382.21716,
                           "y":122.64729
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0.0,
                  "resemblanceScore":0.0
               },
               {  
                  "type":"recognizedShape",
                  "label":"polygon",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":367.5475,
                           "y":95.098335
                        },
                        "lastPoint":{  
                           "x":334.02435,
                           "y":406.52753
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":334.02435,
                           "y":406.52753
                        },
                        "lastPoint":{  
                           "x":532.6705,
                           "y":388.97897
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":532.6705,
                           "y":388.97897
                        },
                        "lastPoint":{  
                           "x":712.83636,
                           "y":449.36176
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":712.83636,
                           "y":449.36176
                        },
                        "lastPoint":{  
                           "x":808.60095,
                           "y":253.81027
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":808.60095,
                           "y":253.81027
                        },
                        "lastPoint":{  
                           "x":367.5475,
                           "y":95.098335
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0.0,
                  "resemblanceScore":0.0
               },
               {  
                  "type":"recognizedShape",
                  "label":"quadrilateral",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":367.5475,
                           "y":95.098335
                        },
                        "lastPoint":{  
                           "x":336.43967,
                           "y":390.3853
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":336.43967,
                           "y":390.3853
                        },
                        "lastPoint":{  
                           "x":717.47314,
                           "y":437.58862
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":717.47314,
                           "y":437.58862
                        },
                        "lastPoint":{  
                           "x":808.60095,
                           "y":253.81027
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":808.60095,
                           "y":253.81027
                        },
                        "lastPoint":{  
                           "x":367.5475,
                           "y":95.098335
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0.0,
                  "resemblanceScore":0.0
               },
               {  
                  "type":"recognizedShape",
                  "label":"parallelogram",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":382.5525,
                           "y":122.975494
                        },
                        "lastPoint":{  
                           "x":321.43463,
                           "y":362.50818
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":321.43463,
                           "y":362.50818
                        },
                        "lastPoint":{  
                           "x":732.4782,
                           "y":465.4658
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":732.4782,
                           "y":465.4658
                        },
                        "lastPoint":{  
                           "x":793.5959,
                           "y":225.9331
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":793.5959,
                           "y":225.9331
                        },
                        "lastPoint":{  
                           "x":382.5525,
                           "y":122.975494
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0.0,
                  "resemblanceScore":0.0
               },
               {  
                  "type":"recognizedShape",
                  "label":"polyline",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":356.5686,
                           "y":113.857574
                        },
                        "lastPoint":{  
                           "x":335.03748,
                           "y":406.35077
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":335.03748,
                           "y":406.35077
                        },
                        "lastPoint":{  
                           "x":532.6705,
                           "y":388.97897
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":532.6705,
                           "y":388.97897
                        },
                        "lastPoint":{  
                           "x":712.73956,
                           "y":449.3492
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":712.73956,
                           "y":449.3492
                        },
                        "lastPoint":{  
                           "x":808.19653,
                           "y":253.66927
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":808.19653,
                           "y":253.66927
                        },
                        "lastPoint":{  
                           "x":361.774,
                           "y":92.080635
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0.0,
                  "resemblanceScore":0.0
               },
               {  
                  "type":"recognizedShape",
                  "label":"trapezoid",
                  "primitives":[  
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":340.73404,
                           "y":367.3512
                        },
                        "lastPoint":{  
                           "x":713.1788,
                           "y":460.62274
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":713.1788,
                           "y":460.62274
                        },
                        "lastPoint":{  
                           "x":815.4237,
                           "y":231.38956
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":815.4237,
                           "y":231.38956
                        },
                        "lastPoint":{  
                           "x":360.72476,
                           "y":117.51905
                        }
                     },
                     {  
                        "type":"line",
                        "beginDecoration":"NONE",
                        "endDecoration":"NONE",
                        "beginTangentAngle":0.0,
                        "endTangentAngle":0.0,
                        "firstPoint":{  
                           "x":360.72476,
                           "y":117.51905
                        },
                        "lastPoint":{  
                           "x":340.73404,
                           "y":367.3512
                        }
                     }
                  ],
                  "normalizedRecognitionScore":0.0,
                  "resemblanceScore":0.0
               }
            ],
            "inkRanges":[  
               {  
                  "firstStroke":0,
                  "lastStroke":0,
                  "firstPoint":0.0,
                  "lastPoint":92.0
               }
            ],
            "uniqueID":"1"
         }
      ],
      "tables":[  

      ],
      "groups":[  
         {  
            "elementType":"group",
            "uniqueID":"3",
            "elementReferences":[  
               {  
                  "uniqueID":"0",
                  "type":"textLine"
               },
               {  
                  "uniqueID":"1",
                  "type":"shape"
               }
            ],
            "type":"TEXT_INSIDE_GRAPHICS"
         }
      ]
	}
	}
/**
* This is the end of the result.
*/

Math example

/**
* THE REQUEST SENDING MATH INPUT AND PARAMETERS
* This is an example of input, used to transmit a math recognition request,
* forming the infinity symbol "∞".
* A math request is quite simple. You only have to pass the XY array of strokes and choose the
* result type (LaTeX or MathML). You will probably need to parse that to produce a viewable result.
*/

/**
* Depending on your invoicing method, you may need to pass certain parameters that allow
* the server to keep a count of your traffic, e.g. the number of containers recognized,
* the number of user IDs passed, etc.
*/
	containerType=myContainerType1
	&containerId=myContainerId1
	&userId=myUserId1
/**
* You must pass this key which identifies you as an authentic user.
*/
	&apiKey=whatever_your_key_is
	myVariable=
	{  
	"components":[  
      {  
         "type":"stroke",
         "x":[349.5,349.5,348.5,337.5,331.5,329.5,327.5,325.5],
         "y":[153.5,152.5,152.5,152.5,153.5,153.5,154.5,154.5]
      }
	],
	"resultTypes":[  
      "LATEX",
      "MATHML"
	]

	}
/**
* Here we have asked for two types of result but only one is mandatory.
*/

/**
* Process to send the request
*/

/**
* First step: encode your input
*/
	myVariableEncoded=myVariable_urlEncoded
/**
* Second step: send your JSON request with your data
*/
	apiKey=your_apiKey&mathInput=myVariableEncoded
/**
* This is the end of the request.
*/

/**
* Here is the result
*/
	{  
	"instanceId":"0871ae33-df13-4336-b8cf-96283e9b1944",
/**
* This is a unique identifier for this particular request.
*/
	"result":{  
         
      "results":[  
            
                  {  
               
            	"type":"MATHML",
                        "value":"<math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n
						<mstyle displaystyle=\"true\">\n <mi> &#x221E;<!--infinity--> </mi>\n
						</mstyle>\n</math>"                     
         },
                           {  
               
           	"type":"LATEX",
                       	"value":"\\infty"
        }
      ]
	}
	}
/**
* The results are returned for both the types that were requested in the input.
*/

/**
* This is the end of the result.
*/

Music example

/**
* THE REQUEST SENDING MUSIC INPUT AND PARAMETERS
* This is an example of input, used to transmit a music recognition request, forming
* the treble clef symbol.
* A Music request requires to pass the XY array of strokes and choose the result type
* (MUSICXML or SCORETREE). You will probably need to parse that to produce a viewable result.
*/

/**
* Depending on your invoicing method, you may need to pass certain parameters
* that allow the server to keep a count of your traffic, e.g. the number of containers recognized,
* the number of user IDs passed, etc.
*/
	containerType=myContainerType1
	&containerId=myContainerId1
	&userId=myUserId1
/**
* You must pass this key which identifies you as an authentic user.
*/
	&apiKey=whatever_your_key_is
	myVariable=

	{  
	"resultTypes":[  
      "MUSICXML",
      "SCORETREE"
	],
/**
* Here we have asked for two types of result but only one is mandatory.
*/
	"components":[  
      {  
         "type":"stroke",
         "x":[8.01,9.01,10.01,10.01,11.01,12.01,12.01,13.01],
         "y":[182.25,182.25,182.25,181.25,181.25,181.25,180.25,180.25]
      }
	],
	"divisions":480,
	"staff":{  
      "count":5,
      "top":127.5,
      "gap":20
	}
	}
/**
* Process to send the request
*/

/**
* First step: encode your input
*/
	myVariableEncoded=myVariable_urlEncoded
/**
* Second step: send your JSON request with your data
*/
	apiKey=your_apiKey&musicInput=myVariableEncoded
/**
* This is the end of the request.
*/

/**
* Here is the result
*/
	{
	"instanceId":"5bb5a6bb-0525-4deb-b487-a65941c7aed5",
	"result":{
      "results":[
	{  
	   "type":"SCORETREE",
	   "score":{  
	      "parts":[  
	         {  
	            "elements":[  
	               {  
	                  "elementType":"clef",
	                  "line":2,
	                  "octave":0,
	                  "symbol":"G",
	                  "inputRanges":[  
	                     {  
	                        "component":0,
	                        "firstItem":0.0,
	                        "lastItem":332.0
	                     }
	                  ]
	               }
	            ]
	         }
	      ]
	   }
	},
    {
           "type":"MUSICXML",
           "value":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n
		   <!DOCTYPE score-partwise PUBLIC
		   \"-//Recordare//DTD MusicXML 1.0 Partwise//EN\"\n\
			"http://www.musicxml.org/dtds/partwise.dtd\">\n
		   <score-partwise version=\"3.0\">\n
			   <part-list>\n
				  <score-part id=\"P1\">\n
				  <part-name></part-name>\n
				  </score-part>\n
			   </part-list>\n
			   <part id=\"P1\">\n
				   <measure number=\"1\">\n
					   <attributes>\n
						   <divisions>480</divisions>\n
						   <clef>\n
						   <sign>G</sign>\n
						   <line>2</line>\n
						   <clef-octave-change>0</clef-octave-change>\n
						   </clef>\n
					   </attributes>\n
				   </measure>\n
			    </part>\n
		    </score-partwise>\n"
        }
     ]
	}
	}
/**
* This is the end of the result.
*/