curl --request POST \
--url https://api.dittowords.com/v2/textItems \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "project-id",
"textItems": [
{
"text": "Hello world"
},
{
"developerId": "custom-dev-id",
"text": "Custom ID example",
"notes": "Shown on the welcome screen",
"characterLimit": 80
},
{
"text": "{{count}} items in your cart",
"variables": [
"count"
],
"plurals": [
{
"form": "one",
"text": "{{count}} item in your cart"
},
{
"form": "other",
"text": "{{count}} items in your cart"
}
]
},
{
"text": "Hello world",
"developerId": "localized-greeting",
"variants": [
{
"variantId": "french",
"text": "Bonjour le monde"
}
]
},
{
"text": "Welcome to the homepage",
"blockId": "header"
}
]
}
'import requests
url = "https://api.dittowords.com/v2/textItems"
payload = {
"projectId": "project-id",
"textItems": [
{ "text": "Hello world" },
{
"developerId": "custom-dev-id",
"text": "Custom ID example",
"notes": "Shown on the welcome screen",
"characterLimit": 80
},
{
"text": "{{count}} items in your cart",
"variables": ["count"],
"plurals": [
{
"form": "one",
"text": "{{count}} item in your cart"
},
{
"form": "other",
"text": "{{count}} items in your cart"
}
]
},
{
"text": "Hello world",
"developerId": "localized-greeting",
"variants": [
{
"variantId": "french",
"text": "Bonjour le monde"
}
]
},
{
"text": "Welcome to the homepage",
"blockId": "header"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: 'project-id',
textItems: [
{text: 'Hello world'},
{
developerId: 'custom-dev-id',
text: 'Custom ID example',
notes: 'Shown on the welcome screen',
characterLimit: 80
},
{
text: '{{count}} items in your cart',
variables: ['count'],
plurals: [
{form: 'one', text: '{{count}} item in your cart'},
{form: 'other', text: '{{count}} items in your cart'}
]
},
{
text: 'Hello world',
developerId: 'localized-greeting',
variants: [{variantId: 'french', text: 'Bonjour le monde'}]
},
{text: 'Welcome to the homepage', blockId: 'header'}
]
})
};
fetch('https://api.dittowords.com/v2/textItems', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dittowords.com/v2/textItems",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => 'project-id',
'textItems' => [
[
'text' => 'Hello world'
],
[
'developerId' => 'custom-dev-id',
'text' => 'Custom ID example',
'notes' => 'Shown on the welcome screen',
'characterLimit' => 80
],
[
'text' => '{{count}} items in your cart',
'variables' => [
'count'
],
'plurals' => [
[
'form' => 'one',
'text' => '{{count}} item in your cart'
],
[
'form' => 'other',
'text' => '{{count}} items in your cart'
]
]
],
[
'text' => 'Hello world',
'developerId' => 'localized-greeting',
'variants' => [
[
'variantId' => 'french',
'text' => 'Bonjour le monde'
]
]
],
[
'text' => 'Welcome to the homepage',
'blockId' => 'header'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dittowords.com/v2/textItems"
payload := strings.NewReader("{\n \"projectId\": \"project-id\",\n \"textItems\": [\n {\n \"text\": \"Hello world\"\n },\n {\n \"developerId\": \"custom-dev-id\",\n \"text\": \"Custom ID example\",\n \"notes\": \"Shown on the welcome screen\",\n \"characterLimit\": 80\n },\n {\n \"text\": \"{{count}} items in your cart\",\n \"variables\": [\n \"count\"\n ],\n \"plurals\": [\n {\n \"form\": \"one\",\n \"text\": \"{{count}} item in your cart\"\n },\n {\n \"form\": \"other\",\n \"text\": \"{{count}} items in your cart\"\n }\n ]\n },\n {\n \"text\": \"Hello world\",\n \"developerId\": \"localized-greeting\",\n \"variants\": [\n {\n \"variantId\": \"french\",\n \"text\": \"Bonjour le monde\"\n }\n ]\n },\n {\n \"text\": \"Welcome to the homepage\",\n \"blockId\": \"header\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dittowords.com/v2/textItems")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"project-id\",\n \"textItems\": [\n {\n \"text\": \"Hello world\"\n },\n {\n \"developerId\": \"custom-dev-id\",\n \"text\": \"Custom ID example\",\n \"notes\": \"Shown on the welcome screen\",\n \"characterLimit\": 80\n },\n {\n \"text\": \"{{count}} items in your cart\",\n \"variables\": [\n \"count\"\n ],\n \"plurals\": [\n {\n \"form\": \"one\",\n \"text\": \"{{count}} item in your cart\"\n },\n {\n \"form\": \"other\",\n \"text\": \"{{count}} items in your cart\"\n }\n ]\n },\n {\n \"text\": \"Hello world\",\n \"developerId\": \"localized-greeting\",\n \"variants\": [\n {\n \"variantId\": \"french\",\n \"text\": \"Bonjour le monde\"\n }\n ]\n },\n {\n \"text\": \"Welcome to the homepage\",\n \"blockId\": \"header\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dittowords.com/v2/textItems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"project-id\",\n \"textItems\": [\n {\n \"text\": \"Hello world\"\n },\n {\n \"developerId\": \"custom-dev-id\",\n \"text\": \"Custom ID example\",\n \"notes\": \"Shown on the welcome screen\",\n \"characterLimit\": 80\n },\n {\n \"text\": \"{{count}} items in your cart\",\n \"variables\": [\n \"count\"\n ],\n \"plurals\": [\n {\n \"form\": \"one\",\n \"text\": \"{{count}} item in your cart\"\n },\n {\n \"form\": \"other\",\n \"text\": \"{{count}} items in your cart\"\n }\n ]\n },\n {\n \"text\": \"Hello world\",\n \"developerId\": \"localized-greeting\",\n \"variants\": [\n {\n \"variantId\": \"french\",\n \"text\": \"Bonjour le monde\"\n }\n ]\n },\n {\n \"text\": \"Welcome to the homepage\",\n \"blockId\": \"header\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"developerIds": [
"hello-world",
"custom-dev-id"
]
}Create text items
Creates a set of text items in a project.
Supports plural forms, variant text, variable placeholders, notes, character limits, tags, status, assignee, and placing the item inside a block.
curl --request POST \
--url https://api.dittowords.com/v2/textItems \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "project-id",
"textItems": [
{
"text": "Hello world"
},
{
"developerId": "custom-dev-id",
"text": "Custom ID example",
"notes": "Shown on the welcome screen",
"characterLimit": 80
},
{
"text": "{{count}} items in your cart",
"variables": [
"count"
],
"plurals": [
{
"form": "one",
"text": "{{count}} item in your cart"
},
{
"form": "other",
"text": "{{count}} items in your cart"
}
]
},
{
"text": "Hello world",
"developerId": "localized-greeting",
"variants": [
{
"variantId": "french",
"text": "Bonjour le monde"
}
]
},
{
"text": "Welcome to the homepage",
"blockId": "header"
}
]
}
'import requests
url = "https://api.dittowords.com/v2/textItems"
payload = {
"projectId": "project-id",
"textItems": [
{ "text": "Hello world" },
{
"developerId": "custom-dev-id",
"text": "Custom ID example",
"notes": "Shown on the welcome screen",
"characterLimit": 80
},
{
"text": "{{count}} items in your cart",
"variables": ["count"],
"plurals": [
{
"form": "one",
"text": "{{count}} item in your cart"
},
{
"form": "other",
"text": "{{count}} items in your cart"
}
]
},
{
"text": "Hello world",
"developerId": "localized-greeting",
"variants": [
{
"variantId": "french",
"text": "Bonjour le monde"
}
]
},
{
"text": "Welcome to the homepage",
"blockId": "header"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: 'project-id',
textItems: [
{text: 'Hello world'},
{
developerId: 'custom-dev-id',
text: 'Custom ID example',
notes: 'Shown on the welcome screen',
characterLimit: 80
},
{
text: '{{count}} items in your cart',
variables: ['count'],
plurals: [
{form: 'one', text: '{{count}} item in your cart'},
{form: 'other', text: '{{count}} items in your cart'}
]
},
{
text: 'Hello world',
developerId: 'localized-greeting',
variants: [{variantId: 'french', text: 'Bonjour le monde'}]
},
{text: 'Welcome to the homepage', blockId: 'header'}
]
})
};
fetch('https://api.dittowords.com/v2/textItems', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dittowords.com/v2/textItems",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => 'project-id',
'textItems' => [
[
'text' => 'Hello world'
],
[
'developerId' => 'custom-dev-id',
'text' => 'Custom ID example',
'notes' => 'Shown on the welcome screen',
'characterLimit' => 80
],
[
'text' => '{{count}} items in your cart',
'variables' => [
'count'
],
'plurals' => [
[
'form' => 'one',
'text' => '{{count}} item in your cart'
],
[
'form' => 'other',
'text' => '{{count}} items in your cart'
]
]
],
[
'text' => 'Hello world',
'developerId' => 'localized-greeting',
'variants' => [
[
'variantId' => 'french',
'text' => 'Bonjour le monde'
]
]
],
[
'text' => 'Welcome to the homepage',
'blockId' => 'header'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dittowords.com/v2/textItems"
payload := strings.NewReader("{\n \"projectId\": \"project-id\",\n \"textItems\": [\n {\n \"text\": \"Hello world\"\n },\n {\n \"developerId\": \"custom-dev-id\",\n \"text\": \"Custom ID example\",\n \"notes\": \"Shown on the welcome screen\",\n \"characterLimit\": 80\n },\n {\n \"text\": \"{{count}} items in your cart\",\n \"variables\": [\n \"count\"\n ],\n \"plurals\": [\n {\n \"form\": \"one\",\n \"text\": \"{{count}} item in your cart\"\n },\n {\n \"form\": \"other\",\n \"text\": \"{{count}} items in your cart\"\n }\n ]\n },\n {\n \"text\": \"Hello world\",\n \"developerId\": \"localized-greeting\",\n \"variants\": [\n {\n \"variantId\": \"french\",\n \"text\": \"Bonjour le monde\"\n }\n ]\n },\n {\n \"text\": \"Welcome to the homepage\",\n \"blockId\": \"header\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dittowords.com/v2/textItems")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"project-id\",\n \"textItems\": [\n {\n \"text\": \"Hello world\"\n },\n {\n \"developerId\": \"custom-dev-id\",\n \"text\": \"Custom ID example\",\n \"notes\": \"Shown on the welcome screen\",\n \"characterLimit\": 80\n },\n {\n \"text\": \"{{count}} items in your cart\",\n \"variables\": [\n \"count\"\n ],\n \"plurals\": [\n {\n \"form\": \"one\",\n \"text\": \"{{count}} item in your cart\"\n },\n {\n \"form\": \"other\",\n \"text\": \"{{count}} items in your cart\"\n }\n ]\n },\n {\n \"text\": \"Hello world\",\n \"developerId\": \"localized-greeting\",\n \"variants\": [\n {\n \"variantId\": \"french\",\n \"text\": \"Bonjour le monde\"\n }\n ]\n },\n {\n \"text\": \"Welcome to the homepage\",\n \"blockId\": \"header\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dittowords.com/v2/textItems")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"project-id\",\n \"textItems\": [\n {\n \"text\": \"Hello world\"\n },\n {\n \"developerId\": \"custom-dev-id\",\n \"text\": \"Custom ID example\",\n \"notes\": \"Shown on the welcome screen\",\n \"characterLimit\": 80\n },\n {\n \"text\": \"{{count}} items in your cart\",\n \"variables\": [\n \"count\"\n ],\n \"plurals\": [\n {\n \"form\": \"one\",\n \"text\": \"{{count}} item in your cart\"\n },\n {\n \"form\": \"other\",\n \"text\": \"{{count}} items in your cart\"\n }\n ]\n },\n {\n \"text\": \"Hello world\",\n \"developerId\": \"localized-greeting\",\n \"variants\": [\n {\n \"variantId\": \"french\",\n \"text\": \"Bonjour le monde\"\n }\n ]\n },\n {\n \"text\": \"Welcome to the homepage\",\n \"blockId\": \"header\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"developerIds": [
"hello-world",
"custom-dev-id"
]
}Authorizations
Body
Developer ID of the project the new text items will be added to
Array of new text items to create
Show child attributes
Show child attributes
When set to 'html', all text values in this request (including plural and variant text) are parsed as HTML and saved as rich text. Supported formatting: <strong>/<b>, <em>/<i>, <u>, <s>, and <br> for line breaks. <sup> and <sub> are only supported for workspaces with superscript and subscript enabled. Unsupported markup (for example links, lists, or headings) is dropped and its text content kept.
Note: Fully-bolded strings will have that bold styling stripped, as Figma does not support bolding an entire text layer this way.
When omitted, text is saved as plaintext and any markup is stored literally.
html Response
Returns the developer IDs of the created text items
Array of developer IDs for the created text items