Create a project
curl --request POST \
--url https://api.dittowords.com/v2/projects \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My New Project",
"folderId": "my-folder-id",
"baseId": "my-base"
}
'import requests
url = "https://api.dittowords.com/v2/projects"
payload = {
"name": "My New Project",
"folderId": "my-folder-id",
"baseId": "my-base"
}
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({name: 'My New Project', folderId: 'my-folder-id', baseId: 'my-base'})
};
fetch('https://api.dittowords.com/v2/projects', 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/projects",
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([
'name' => 'My New Project',
'folderId' => 'my-folder-id',
'baseId' => 'my-base'
]),
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/projects"
payload := strings.NewReader("{\n \"name\": \"My New Project\",\n \"folderId\": \"my-folder-id\",\n \"baseId\": \"my-base\"\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/projects")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My New Project\",\n \"folderId\": \"my-folder-id\",\n \"baseId\": \"my-base\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dittowords.com/v2/projects")
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 \"name\": \"My New Project\",\n \"folderId\": \"my-folder-id\",\n \"baseId\": \"my-base\"\n}"
response = http.request(request)
puts response.read_body{
"id": "my-new-project",
"name": "My New Project",
"baseId": null
}Projects
Create a project
Creates a new Ditto project in your workspace.
Projects hold project-scoped text items, as opposed to library components which are reusable across projects.
POST
/
projects
Create a project
curl --request POST \
--url https://api.dittowords.com/v2/projects \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My New Project",
"folderId": "my-folder-id",
"baseId": "my-base"
}
'import requests
url = "https://api.dittowords.com/v2/projects"
payload = {
"name": "My New Project",
"folderId": "my-folder-id",
"baseId": "my-base"
}
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({name: 'My New Project', folderId: 'my-folder-id', baseId: 'my-base'})
};
fetch('https://api.dittowords.com/v2/projects', 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/projects",
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([
'name' => 'My New Project',
'folderId' => 'my-folder-id',
'baseId' => 'my-base'
]),
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/projects"
payload := strings.NewReader("{\n \"name\": \"My New Project\",\n \"folderId\": \"my-folder-id\",\n \"baseId\": \"my-base\"\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/projects")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My New Project\",\n \"folderId\": \"my-folder-id\",\n \"baseId\": \"my-base\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dittowords.com/v2/projects")
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 \"name\": \"My New Project\",\n \"folderId\": \"my-folder-id\",\n \"baseId\": \"my-base\"\n}"
response = http.request(request)
puts response.read_body{
"id": "my-new-project",
"name": "My New Project",
"baseId": null
}Authorizations
Body
application/json
The name of the new project.
Minimum string length:
1The developer ID of the folder to create the project in. If omitted, the project is created at the workspace root.
The Developer ID of the base to connect the new project to. If omitted, the project will not be connected to a base.
Response
200 - application/json
Returns the developer ID and name of the created project, as well as the developer ID of the connected base (or null).