HTTP Data API
HTTP API - Getting Started
ditto offers an http api to programmatically interact with transactional data generated in the mesh network and stored within the big peer the big peer is an optional feature for managing and coordinating data in the peer to peer mesh network for more information , see docid\ k51z knujnm0ge8aqkhba the http data api is designed following the principles of the remote procedure call (rpc) framework so, despite the actual exchange occurring over a network, you make requests from ditto's api methods as if making local calls this article provides an overview of the http data api /#about rpc framework /#cloud url endpoint /#data representations about rpc framework the rpc framework is of the request response category, where a client sends one message to the big peer and receives one response in return the http api is structured around various resources , which are endpoints you call in your code to perform specific actions, such as update , and receive corresponding responses from the big peer these resources correspond to the key elements of the ditto document model for more information, see docid\ h1ppyzgdofcx903r2ey9p cloud url endpoint use the ditto http api to integrate external systems with ditto backed apps hosted on cloud ditto live and programmatically interact with them using an http server interface the following url is the base location from which you can make your http api requests curl curl https //{app id} cloud ditto live/api/v4 getting your canonical root url for your canonical root url, go to the ditto portal > select your app > and then, from the connecting via http group at the bottom of the page, copy your cloud url endpoint swagger endpoint to access the http api reference, use the following url endpoint to view the openapi swagger json specification for more information, see the official swagger documentation > https //swagger io/resources/open api/ when accessing the swagger json specification, make sure to replace the {app id} parameter with the unique app id provided when you created your app in the portal https //{app id} cloud ditto live/api/v4/swagger json data representations ditto uses utf 8 to encode data for more information, see /#encoding standard utf 8 unless otherwise specified, the default representation format for individual resources is json, as indicated by the content‑type http header included in your response content type application/json encoding standard utf 8 unless you have a specific requirement for a different encoding, encode your input data in utf 8 utf 8 is a variable length schema for universal character encoding for more information, see the official https //en wikipedia org/wiki/utf 8 make sure to encode your text based data, such as json, using the utf 8 encoding if using another format to encode, such as utf 16, decoding errors and invalid results are likely to occur encoding formats binary data to transmit binary data, such as a media file, to the big peer, you must first convert it into either of the following formats for smaller data, use a base64 encoded string for larger data, use an attachment object (see docid\ zlucxylcxh7nciquu5pju ) the following table provides an overview of the acceptable encoding formats by binary size binary size encoding format below 250 kb base64 encoded string value between 250kb and 2mb attachment object 2mb and above this will be rejected as the payload is too large please get in contact with ditto support to have this limit increased for your deployment if necessary once converted, include your base64 encoded string in your request failing to send binary data encoded with either base64 or an attachment , as appropriate, may result in compatibility issues leading to data corruption or loss