HTTP API
Ditto offers an HTTP API that you can use to programmatically interact with the Big Peer. The Big Peer is an optional feature that you can use for managing and coordinating data in the peer-to-peer mesh network. For more information, see Platform Manual > Big Peer.
The HTTP 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 methods as if making local calls.
This article provides an overview of the HTTP API:
The remote procedure call (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 upsert, and receive corresponding responses from the Big Peer.
These resources correspond to the key elements of the Ditto document model. For more information, see Document Model.
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:
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:
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:
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.
Make sure to encode your JSON text-based data, such as JSON, using UTF-8.
If encoding using another schema, such as UTF-16, decoding errors and invalid results are likely to occur.
When sending binary data, such as a media file, to the Big Peer, you must first convert the binary data into a Base64-encoded string.
Once converted, include your Base64-encoded string in your request.
Failing to send binary data encoded with Base64 may result in compatibility issues leading to data corruption or loss.