This section describes the different types of server APIs and aims at helping you choose the one you need.

REST and WebSockets

REST over HTTP is an unconnected protocol designed to deliver web pages. Each HTTP/REST request implies a new connection that you have to scramble. Creating and scrambling new requests take time. Every time you make a request you have to provide context and configuration information. REST APIs are very easy to integrate and can settle for low quality networks conditions.

WebSockets is a connected mode, allowing you to create a unique scrambled connection, where requests are continuously sent and received. This protocol allows you to interact with your ink like you would with any other digital content. In addition, it can be time-saving but requires to be supported by your browser (or programming language used on the client side), as well as a high-speed and very stable network condition.

WebSockets offscreen and onscreen modes

When using WebSockets protocol, we further distinguish two different modes that we call offscreen and onscreen:

Choosing the appropriate API

Recognition API could be used in several ways. Depending on what your user writes, you can choose the API you need. WebSockets APIs address the use case where users edit and interact with what they write or import. WebSockets are also ideal if you are looking for an immediate feedback. REST API addresses the use case of recognition of an already set of strokes.

Rich editing and interaction as your users write

Every time your users move the pen up, the coordinates of the strokes they just drew are sent to the server which immediately recognize the content. Gestures are detected immediately. The user input could be updated immediately. WebSocket is the mode you need.

Import of a set of strokes, then live editing

If your users have already written some content in another application and are willing to import it into MyScript world and then manipulate it, the WebSockets API offers a importStrokes API to do so.

Recognition of a set of strokes

If you have already collected the user strokes and want to recognize the digital content, REST is the required mode.

Cloud usage and pricing

Read the dedicated section in your account section.