Ditto API (v0) (deprecated)

Programmatically read and write data in your Ditto workspace.
You probably want the v1 API documentation page instead of this one. This is the documentation for the v0 API, which has been deprecated. If you're an existing API user, please reference this page for a list of breaking changes and instructions for migrating.

Overview

The Ditto API currently supports read access of Ditto workspaces and is served over HTTPS. All endpoint URLs have the following base: https://api.dittowords.com.

Authentication

To access any Ditto API endpoints, you'll need an API key. You can view, create, and revoke your API keys in your Account Settings.
Each API key is attached to a specific user and can only be used to fetch information from that user's Ditto workspace.

Creating an API key

If you already have a Ditto account, you can create an API Key as follows:
  1. 1.
    Head to your Account Settings
  2. 2.
    Under the section titled API Keys, click + Create key.
The User tab under the Account Settings page.

Using an API key

To use your API key to make a request to the Ditto API, you'll need to pass it in an Authorization header in all requests:
'Authorization: token <YOUR_API_KEY>'
Here's an example request to Ditto's /project-names endpoint:
curl -X GET \
--header 'Authorization: token <YOUR_API_KEY>' \
'https://api.dittowords.com/project-names'
Only projects that have Developer Mode enabled are accessible via the API. Learn more about Developer Mode here.

Endpoints

Projects

get
https://api.dittowords.com
/project-names
Fetch project names
get
https://api.dittowords.com
/projects
Fetch projects
get
https://api.dittowords.com
/projects/:id
Fetch project by ID
get
https://api.dittowords.com
/projects/:id/components
Fetch components by project

Components

get
https://api.dittowords.com
/components
Fetch components
put
https://api.dittowords.com
/components
Update components

Component Folders

get
https://api.dittowords.com
/component-folders
Fetch component folders
get
https://api.dittowords.com
/component-folders/:api_id/components
Fetch components by component folder

Variables

get
https://api.dittowords.com
/variables
Fetch variables

Variants

get
https://api.dittowords.com
/variants
Fetch variants

Additional Data Structures

Update Component Data

The shape that the request body should conform to for the Update components endpoint.
{
"[API ID]": {
"text": "[TEXT OF TEXT ITEM (CAN INCLUDE VARIABLES)]",
"notes": "[NOTES OF TEXT ITEM]", // optional
"tags": [ ... ], // optional: array of strings
"plurals": [ // optional: array of plural objects
{
"text": "[TEXT OF PLURAL FORM]",
"form": "[one|two|zero|few|many|other]"
}
]
}
}