{"openapi":"3.1.0","info":{"title":"MyScript IInk Batch Mode","description":"Service to recognize myscript iink in batch mode","contact":{"name":"MyScript support","url":"https://developer.myscript.com"},"license":{"name":"commercial license"},"version":"1.1.0"},"servers":[{"url":"https://cloud.myscript.com","description":"Generated server url"}],"paths":{"/api/v4.0/iink/recognize":{"post":{"tags":["Rest api for recognizer"],"summary":"Recognize iink","description":"This endpoint sends an json object representing an iink input to the recognition engine and sends back a payload whose format depends on the requested mime type. In case of error, an error object in json format is returned. That is why it is mandatory to ask in the Accept header the requested format + application/json","operationId":"recognize","parameters":[{"name":"applicationKey","in":"header","description":"The application key that was given during registration.","required":true,"schema":{"type":"string"}},{"name":"myscript-client-name","in":"header","required":false,"schema":{"type":"string"}},{"name":"myscript-client-version","in":"header","required":false,"schema":{"type":"string"}},{"name":"hmac","in":"header","description":"The HMAC signature of the payload, using the secret hmac key that was given during registration and SHA-512 algorithm. See https://developer.myscript.com/support/account/registering-myscript-cloud/#computing-the-hmac-value","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"A comma-separated list of mime types for the response. Must contain application/json as the error response is a json object. The first suitable mime type for the recognition type will be used as content type for the response","required":true,"schema":{"type":"array","items":{"type":"string"}},"example":"text/plain, application/json"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecognizeInput"}}},"required":true},"responses":{"200":{"description":"OK"},"500":{"description":"Internal error. Please contact us for information.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"400":{"description":"An error was found in the request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"description":"Wrong credentials","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"403":{"description":"Operation not permitted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"406":{"description":"No suitable mime type was found for the response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}},"/api/v4.0/iink/contextlessgesture":{"post":{"tags":["Batch mode"],"summary":"Recognize contextless gesture","description":"This endpoint recognizes gesture without any context from a group of strokes. Deprecated : use /api/v4.0/iink/recognize with content type equal to 'Gesture'","operationId":"contextLessGesture","parameters":[{"name":"applicationKey","in":"header","description":"The application key that was given during registration.","required":true,"schema":{"type":"string"}},{"name":"myscript-client-name","in":"header","required":false,"schema":{"type":"string"}},{"name":"myscript-client-version","in":"header","required":false,"schema":{"type":"string"}},{"name":"hmac","in":"header","description":"The HMAC signature of the payload, using the secret hmac key that was given during registration and SHA-512 algorithm. See https://developer.myscript.com/support/account/registering-myscript-cloud/#computing-the-hmac-value","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLessGestureInput"}}},"required":true},"responses":{"200":{"description":"OK"},"500":{"description":"Internal error. Please contact us for information.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"400":{"description":"An error was found in the request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"description":"Wrong credentials","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"403":{"description":"Operation not permitted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"deprecated":true}},"/api/v4.0/iink/batch":{"post":{"tags":["Batch mode"],"summary":"Recognize iink","description":"This endpoint sends an json object representing an iink input to the recognition engine and sends back a payload whose format depends on the requested mime type. In case of error, an error object in json format is returned. That is why it is mandatory to ask in the Accept header the requested format + application/json","operationId":"batch","parameters":[{"name":"applicationKey","in":"header","description":"The application key that was given during registration.","required":true,"schema":{"type":"string"}},{"name":"myscript-client-name","in":"header","required":false,"schema":{"type":"string"}},{"name":"myscript-client-version","in":"header","required":false,"schema":{"type":"string"}},{"name":"hmac","in":"header","description":"The HMAC signature of the payload, using the secret hmac key that was given during registration and SHA-512 algorithm. See https://developer.myscript.com/support/account/registering-myscript-cloud/#computing-the-hmac-value","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"A comma-separated list of mime types for the response. Must contain application/json as the error response is a json object. The first suitable mime type for the recognition type will be used as content type for the response","required":true,"schema":{"type":"array","items":{"type":"string"}},"example":"text/plain, application/json"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchInput"}}},"required":true},"responses":{"200":{"description":"OK"},"500":{"description":"Internal error. Please contact us for information.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"400":{"description":"An error was found in the request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401":{"description":"Wrong credentials","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"403":{"description":"Operation not permitted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"406":{"description":"No suitable mime type was found for the response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}}},"components":{"schemas":{"BeautificationConfiguration":{"type":"object","properties":{"enable":{"type":"boolean"}}},"Classification":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string","pattern":"^(text|math|shape|drawing|decoration)$"},"uniqueItems":true}}},"ConfigurationMessage":{"type":"object","description":"The configuration for the recognition. See explanation for parameters in https://developer.myscript.com/docs/interactive-ink/latest/reference/web/configuration-rest/","properties":{"alwaysConnected":{"type":"boolean"},"lang":{"type":"string","example":"en_US","title":"lang"},"math":{"$ref":"#/components/schemas/MathConfiguration"},"text":{"$ref":"#/components/schemas/TextConfiguration"},"export":{"$ref":"#/components/schemas/ExportConfiguration"},"diagram":{"$ref":"#/components/schemas/DiagramConfiguration"},"gesture":{"$ref":"#/components/schemas/GestureConfiguration"},"shape":{"$ref":"#/components/schemas/ShapeConfiguration"},"verticalJapanese":{"type":"boolean"},"guidesEnabled":{"type":"boolean"},"raw-content":{"$ref":"#/components/schemas/RawContentConfiguration"},"stroke-max-point-count":{"type":"integer","format":"int32"}},"title":"Configuration"},"CustomSk":{"type":"object","properties":{"type":{"type":"string","example":"Math Enabled Subset","title":"math.custom-sk.type"},"content":{"type":"string","example":0,"title":"math.custom-sk.content"}}},"DiagramConfiguration":{"type":"object","properties":{"text":{"$ref":"#/components/schemas/TextConfConfiguration","title":"text"},"convert":{"$ref":"#/components/schemas/DiagramConvertConfiguration"},"enable-sub-blocks":{"type":"boolean","example":true,"title":"diagram.enable-sub-blocks"},"session-time":{"type":"integer","format":"int32","example":750,"title":"diagram.session-time"},"eraser":{"$ref":"#/components/schemas/EraserConfiguration","title":"diagram.eraser"}}},"DiagramConvertConfiguration":{"type":"object","properties":{"edge":{"type":"boolean","deprecated":true,"example":true,"title":"diagram.convert.edge"},"node":{"type":"boolean","deprecated":true,"example":true,"title":"diagram.convert.node"},"text":{"type":"boolean","deprecated":true,"example":true,"title":"diagram.convert.text"},"types":{"type":"array","items":{"type":"string","pattern":"^(text|shape|math)$"},"uniqueItems":true},"matchTextSize":{"type":"boolean","example":true,"title":"diagram.convert.match-text-size"}}},"EraserConfiguration":{"type":"object","properties":{"erase-precisely":{"type":"boolean","example":false,"title":"eraser.erase-precisely"}}},"ExportConfiguration":{"type":"object","properties":{"image":{"$ref":"#/components/schemas/ImageConfiguration","title":"export.image"},"jiix":{"$ref":"#/components/schemas/JiixConfiguration"},"mathml":{"$ref":"#/components/schemas/MathMLExport"},"image-resolution":{"type":"integer","format":"int32","example":300,"title":"export.image-resolution"}}},"GestureBehaviorConfiguration":{"type":"object","properties":{"behavior":{"type":"string"}}},"GestureConfiguration":{"type":"object","properties":{"enable":{"type":"boolean"},"ignoreGestureStrokes":{"type":"boolean"},"tap":{"$ref":"#/components/schemas/TapConfiguration"},"disabled-gestures":{"type":"array","items":{"type":"string","pattern":"^(scratch-out|underline|double-underline|insert|join|strike-through|top-bottom|bottom-top|left-right|right-left|scratch|surround|tap|double-tap|long-press)$"}},"underlines":{"$ref":"#/components/schemas/GestureBehaviorConfiguration"}}},"GuidesConfiguration":{"type":"object","properties":{"enable":{"type":"boolean","example":true,"title":"text.guides.enable"},"line-gap-mm":{"type":"integer","format":"int32","example":10,"title":"text.guides.line-gap-mm"},"origin-y-mm":{"type":"integer","format":"int32","example":100,"title":"text.guides.origin-y-mm"}}},"ImageConfiguration":{"type":"object","properties":{"guides":{"type":"boolean","title":"export.image.guides"},"viewport":{"$ref":"#/components/schemas/ImageViewportConfiguration","title":"export.image.viewport"}}},"ImageViewportConfiguration":{"type":"object","properties":{"x":{"type":"integer","format":"int32","title":"export.image.viewport.x"},"y":{"type":"integer","format":"int32","title":"export.image.viewport.y"},"width":{"type":"integer","format":"int32","title":"export.image.viewport.width"},"height":{"type":"integer","format":"int32","title":"export.image.viewport.height"}}},"JiixConfiguration":{"type":"object","properties":{"strokes":{"type":"boolean","example":true,"title":"export.jiix.strokes"},"style":{"type":"boolean","example":false,"title":"export.jiix.style"},"ids":{"type":"boolean","example":true,"title":"export.jiix.ids"},"ranges":{"type":"boolean","example":false,"title":"export.jiix.ranges"},"primitives":{"type":"boolean","example":true,"title":"export.jiix.primitives"},"glyphs":{"type":"boolean","example":true,"title":"export.jiix.glyphs"},"shape":{"$ref":"#/components/schemas/JiixShapeConfiguration"},"bounding-box":{"type":"boolean","example":false,"title":"export.jiix.bounding-box"},"text":{"$ref":"#/components/schemas/JiixTextConfiguration"},"full-stroke-ids":{"type":"boolean","example":false,"title":"export.jiix.full-stroke-ids"}}},"JiixShapeConfiguration":{"type":"object","properties":{"candidates":{"type":"boolean","example":true,"title":"export.jiix.shape.candidates"}}},"JiixTextConfiguration":{"type":"object","properties":{"structure":{"type":"boolean","example":false,"title":"export.jiix.text.structure"},"chars":{"type":"boolean","example":false,"title":"export.jiix.text.chars"},"words":{"type":"boolean","example":true,"title":"export.jiix.text.words"},"lines":{"type":"boolean","example":true,"title":"export.jiix.text.lines"}}},"MarginConfiguration":{"type":"object","properties":{"top":{"type":"integer","format":"int32","example":10,"title":"math.margin.top"},"left":{"type":"integer","format":"int32","example":15,"title":"math.margin.left"},"right":{"type":"integer","format":"int32","example":15,"title":"math.margin.right"},"bottom":{"type":"integer","format":"int32","example":10,"title":"math.margin.bottom"}}},"MathConfiguration":{"type":"object","properties":{"solver":{"$ref":"#/components/schemas/SolverConfiguration"},"margin":{"$ref":"#/components/schemas/MarginConfiguration"},"customGrammarId":{"type":"string","example":"your_custom_grammar_id","title":"math.customGrammarId"},"customGrammarContent":{"type":"string","example":"symbol = 0\\nexpression ::= identity(symbol)\\nstart(expression)","title":"math.customGrammarContent"},"undo-redo":{"$ref":"#/components/schemas/UndoRedoConfiguration","title":"math.undo-redo"},"session-time":{"type":"integer","format":"int32","example":750,"title":"math.session-time"},"eraser":{"$ref":"#/components/schemas/EraserConfiguration","title":"math.eraser"},"recognition-timeout":{"type":"integer","format":"int32","example":30,"title":"math.recognition-timeout"},"custom-resources":{"type":"array","example":["your_custom_resource"],"items":{"type":"string"},"title":"math.customResources"},"custom-sk":{"$ref":"#/components/schemas/CustomSk","title":"math.custom-sk"}}},"MathMLExport":{"type":"object","properties":{"flavor":{"type":"string","enum":["standard","ms-office"],"title":"export.mathml.flavor"}}},"RawContentConfiguration":{"type":"object","properties":{"recognition":{"$ref":"#/components/schemas/Recognition"},"classification":{"$ref":"#/components/schemas/Classification"},"text":{"$ref":"#/components/schemas/TextConfConfiguration","title":"raw-content.text"},"gestures":{"type":"array","items":{"type":"string"},"title":"gestures","uniqueItems":true},"session-time":{"type":"integer","format":"int32","example":750,"title":"raw-content.session-time"},"eraser":{"$ref":"#/components/schemas/EraserConfiguration","title":"raw-content.eraser"}}},"Recognition":{"type":"object","properties":{"text":{"type":"boolean","deprecated":true},"shape":{"type":"boolean","deprecated":true},"types":{"type":"array","items":{"type":"string","pattern":"^(text|math|shape)$"},"uniqueItems":true}}},"RecognizeInput":{"type":"object","description":"The input of the recognition, including configuration, strokes, ...","properties":{"contentType":{"type":"string","enum":["Text","Math","Diagram","Raw Content","Text Document","Gesture","Shape","HandwritingGenerationPNG","HandwritingGenerationSVG"],"title":"recognition type"},"strokes":{"type":"array","items":{"$ref":"#/components/schemas/Stroke"},"minItems":1,"title":"a list of strokes"},"configuration":{"$ref":"#/components/schemas/ConfigurationMessage","title":"The configuration for the recognition."},"scaleX":{"type":"number","format":"float","example":0.265,"title":"scale to convert input horizontal coordinates unit into mm (for example for pixels inputs inches-to-mm / x-resolution-dpi = 25.4 / 96 = 0.265)"},"scaleY":{"type":"number","format":"float","example":0.265,"title":"scale to convert input vertical coordinates unit into mm (for example for pixels inputs inches-to-mm / y-resolution-dpi = 25.4 / 96 = 0.265)"}},"required":["contentType","scaleX","scaleY","strokes"]},"ShapeConfiguration":{"type":"object","properties":{"beautification":{"$ref":"#/components/schemas/BeautificationConfiguration"}}},"SolverConfiguration":{"type":"object","properties":{"enable":{"type":"boolean","example":true,"title":"math.solver.enable"},"fractional-part-digits":{"type":"integer","format":"int32","example":3,"title":"math.solver.fractional-part-digits"},"decimal-separator":{"type":"string","example":".","title":"math.solver.decimal-separator"},"rounding-mode":{"type":"string","enum":["half up","truncate"],"example":"half up","title":"math.solver.rounding-mode"},"angle-unit":{"type":"string","enum":["deg","rad"],"example":"deg","title":"math.solver.angle-unit"},"fraction-mode":{"type":"string","enum":["decimal","rational","mixed"],"example":"decimal","title":"math.solver.fraction-mode"},"options":{"type":"string","enum":["algebraic","numeric"],"example":"algebraic","title":"math.solver.options"}}},"Stroke":{"type":"object","description":"Representation of a stroke, that is the capture of an user writing input between the moment when the writing device touches the writing surface and the moment when it is lifted from the surface. See https://developer.myscript.com/docs/interactive-ink/latest/web/myscriptjs/editing/ for information about the components of a stroke","properties":{"id":{"type":"string","title":"An optional id for the stroke"},"x":{"type":"array","example":[289,290,290,290,290,290,290,291,291,292,293],"items":{"type":"number","format":"float"},"title":"The list of x coordinates of the stroke"},"y":{"type":"array","example":[215,218,222,225,228,231,235,238,242,245,248],"items":{"type":"number","format":"float"},"title":"The list of y coordinates of the stroke"},"t":{"type":"array","example":[1516717383637,1516717383677,1516717383694,1516717383711,1516717383727,1516717383744,1516717383761,1516717383777,1516717383794,1516717383811,1516717383827],"items":{"type":"integer","format":"int64"},"title":"The list of timestamps of the stroke"},"p":{"type":"array","example":[0.5,0.8221720589961077,0.7145158745241171,0.6761535882018319,0.6761535882018319,0.6761535882018319,0.7145158745241171,0.6831899108492184,0.7145158745241171,0.6831899108492184,0.6831899108492184],"items":{"type":"number","format":"float"},"title":"The list of pressure information of the stroke"},"pointerType":{"type":"string","enum":["PEN, TOUCH, ERASER"],"title":"The pointer type for the stroke"},"pointerId":{"type":"integer","format":"int32","title":"The pointer id"},"fullStrokeId":{"type":"string","title":"An optional id of the full stroke the sub-stroke belongs to"}},"required":["x","y"],"title":"Stroke"},"TapConfiguration":{"type":"object","properties":{"spacing-mm":{"type":"integer","format":"int32"}}},"TextConfConfiguration":{"type":"object","properties":{"customResources":{"type":"array","example":["your_custom_resource"],"items":{"type":"string"},"title":"text.configuration.customResources"},"customLexicon":{"type":"array","example":["word1","word2"],"items":{"type":"string"},"title":"text.configuration.customLexicon"},"addLKText":{"type":"boolean","example":true,"title":"text.configuration.addLKText"},"name":{"type":"string","example":"text-superimposed","title":"text.configuration.name"}}},"TextConfiguration":{"type":"object","properties":{"margin":{"$ref":"#/components/schemas/MarginConfiguration"},"guides":{"$ref":"#/components/schemas/GuidesConfiguration"},"configuration":{"$ref":"#/components/schemas/TextConfConfiguration"},"eraser":{"$ref":"#/components/schemas/EraserConfiguration","title":"text.eraser"}}},"UndoRedoConfiguration":{"type":"object","properties":{"mode":{"type":"string","enum":["stroke,session"],"title":"math.undo-redo.mode"}}},"ErrorMessage":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"title":"Error message"},"ContextLessGestureInput":{"type":"object","description":"The input of the recognition, including configuration, strokes, ...","properties":{"strokeGroups":{"type":"array","items":{"$ref":"#/components/schemas/StrokeGroup"},"title":"The write entries that corresponds to the input iink"},"scaleX":{"type":"number","format":"float","example":25.4,"minimum":0,"title":"scale to convert input horizontal coordinates unit into mm,"},"scaleY":{"type":"number","format":"float","example":25.4,"minimum":0,"title":"scale to convert input vertical coordinates unit into mm,"}},"required":["strokeGroups"]},"StrokeGroup":{"type":"object","description":"a list of strokes that share the same pen style","properties":{"strokes":{"type":"array","items":{"$ref":"#/components/schemas/Stroke"},"title":"a list of strokes"},"penStyle":{"type":"string","example":"color: #120f51;↵-myscript-pen-width: 2;","title":"CSS style for the pen. See https://developer.myscript.com/docs/interactive-ink/latest/reference/web/styling/"},"penStyleClasses":{"type":"string","example":"ink mycolor","title":"CSS classes for the pen. Classes are to be provided in the general CSS theme. See https://developer.myscript.com/docs/interactive-ink/latest/reference/web/styling/"}},"required":["strokes"],"title":"StrokeGroup"},"BatchInput":{"type":"object","description":"The input of the recognition, including configuration, strokes, ...","properties":{"width":{"type":"integer","format":"int32","example":722,"minimum":0,"title":"width of the writing area"},"height":{"type":"integer","format":"int32","example":620,"minimum":0,"title":"height of the writing area"},"contentType":{"type":"string","enum":["Text","Math","Diagram","Raw Content","Text Document","Gesture","Shape","HandwritingGenerationPNG","HandwritingGenerationSVG"],"title":"recognition type"},"conversionState":{"type":"string","description":"DIGITAL_PUBLISH not supported yet","enum":["DIGITAL_PUBLISH","DIGITAL_EDIT"],"example":"DIGITAL_EDIT","title":"target of conversion, no conversion will be made if that parameter is not provided"},"theme":{"type":"string","example":"ink {color: #000000; -myscript-pen-width: 1; -myscript-pen-fill-style: none; -myscript-pen-fill-color: #FFFFFF00;} mycolor {color: #120f51;} .math { font-family: STIXGeneral;} .math-solved {font-family: STIXGeneral; color: #A8A8A8FF;} .text {font-family: Open Sans; font-size: 10;}","title":"A global CSS styling for your content. See https://developer.myscript.com/docs/interactive-ink/latestweb/myscriptjs/styling/"},"strokeGroups":{"type":"array","items":{"$ref":"#/components/schemas/StrokeGroup"},"title":"The write entries that corresponds to the input iink"},"configuration":{"$ref":"#/components/schemas/ConfigurationMessage","title":"The configuration for the recognition."},"xDPI":{"type":"number","format":"float","example":96,"minimum":0,"title":"x resolution of the writing area in dpi"},"yDPI":{"type":"number","format":"float","example":96,"minimum":0,"title":"y resolution of the writing area in dpi"}},"required":["contentType","strokeGroups"]}},"securitySchemes":{"applicationKey":{"type":"apiKey","description":"Moreover the calls must be signed using the content of the payload and an hmac key. See https://developer.myscript.com/docs/interactive-ink/1.4/web/rest/architecture/#credentials","name":"applicationKey","in":"header"}}}}