Update a project
curl --request PUT \
--url https://web.edcontrols.com/api/v2/data/projects/{database}/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"referenceName": "<string>",
"archived": "<string>",
"type": "IB.EdBundle.Document.Project",
"tags": [
"<string>"
],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z",
"startDate": "<string>",
"endDate": "<string>"
},
"location": {
"location": "<string>",
"latitude": 123,
"longitude": 123
},
"participants": {
"accountable": {
"email": "jsmith@example.com",
"type": "<string>"
},
"support": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"consulted": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"informed": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
]
},
"settings": {},
"customFields": [
{
"id": "<string>",
"label": "<string>"
}
]
}
'import requests
url = "https://web.edcontrols.com/api/v2/data/projects/{database}/{id}"
payload = {
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"referenceName": "<string>",
"archived": "<string>",
"type": "IB.EdBundle.Document.Project",
"tags": ["<string>"],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z",
"startDate": "<string>",
"endDate": "<string>"
},
"location": {
"location": "<string>",
"latitude": 123,
"longitude": 123
},
"participants": {
"accountable": {
"email": "jsmith@example.com",
"type": "<string>"
},
"support": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"consulted": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"informed": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
]
},
"settings": {},
"customFields": [
{
"id": "<string>",
"label": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_id: '<string>',
_rev: '<string>',
name: '<string>',
referenceName: '<string>',
archived: '<string>',
type: 'IB.EdBundle.Document.Project',
tags: ['<string>'],
dates: {
creationDate: '2023-11-07T05:31:56Z',
lastModifiedDate: '2023-11-07T05:31:56Z',
startDate: '<string>',
endDate: '<string>'
},
location: {location: '<string>', latitude: 123, longitude: 123},
participants: {
accountable: {email: 'jsmith@example.com', type: '<string>'},
support: [{email: 'jsmith@example.com', type: '<string>'}],
consulted: [{email: 'jsmith@example.com', type: '<string>'}],
informed: [{email: 'jsmith@example.com', type: '<string>'}]
},
settings: {},
customFields: [{id: '<string>', label: '<string>'}]
})
};
fetch('https://web.edcontrols.com/api/v2/data/projects/{database}/{id}', 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://web.edcontrols.com/api/v2/data/projects/{database}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'_id' => '<string>',
'_rev' => '<string>',
'name' => '<string>',
'referenceName' => '<string>',
'archived' => '<string>',
'type' => 'IB.EdBundle.Document.Project',
'tags' => [
'<string>'
],
'dates' => [
'creationDate' => '2023-11-07T05:31:56Z',
'lastModifiedDate' => '2023-11-07T05:31:56Z',
'startDate' => '<string>',
'endDate' => '<string>'
],
'location' => [
'location' => '<string>',
'latitude' => 123,
'longitude' => 123
],
'participants' => [
'accountable' => [
'email' => 'jsmith@example.com',
'type' => '<string>'
],
'support' => [
[
'email' => 'jsmith@example.com',
'type' => '<string>'
]
],
'consulted' => [
[
'email' => 'jsmith@example.com',
'type' => '<string>'
]
],
'informed' => [
[
'email' => 'jsmith@example.com',
'type' => '<string>'
]
]
],
'settings' => [
],
'customFields' => [
[
'id' => '<string>',
'label' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://web.edcontrols.com/api/v2/data/projects/{database}/{id}"
payload := strings.NewReader("{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"referenceName\": \"<string>\",\n \"archived\": \"<string>\",\n \"type\": \"IB.EdBundle.Document.Project\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"location\": {\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"participants\": {\n \"accountable\": {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n },\n \"support\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"consulted\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"informed\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"settings\": {},\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://web.edcontrols.com/api/v2/data/projects/{database}/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"referenceName\": \"<string>\",\n \"archived\": \"<string>\",\n \"type\": \"IB.EdBundle.Document.Project\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"location\": {\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"participants\": {\n \"accountable\": {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n },\n \"support\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"consulted\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"informed\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"settings\": {},\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://web.edcontrols.com/api/v2/data/projects/{database}/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"referenceName\": \"<string>\",\n \"archived\": \"<string>\",\n \"type\": \"IB.EdBundle.Document.Project\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"location\": {\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"participants\": {\n \"accountable\": {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n },\n \"support\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"consulted\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"informed\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"settings\": {},\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"referenceName": "<string>",
"archived": "<string>",
"type": "IB.EdBundle.Document.Project",
"tags": [
"<string>"
],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z",
"startDate": "<string>",
"endDate": "<string>"
},
"location": {
"location": "<string>",
"latitude": 123,
"longitude": 123
},
"participants": {
"accountable": {
"email": "jsmith@example.com",
"type": "<string>"
},
"support": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"consulted": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"informed": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
]
},
"settings": {},
"customFields": [
{
"id": "<string>",
"label": "<string>",
"type": "freetext"
}
]
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}Projects
Update a project
Send the project document with your changes; fetch it first and send it
back whole. The server applies your fields onto the current stored
project and ignores the _rev you send, so there is no revision
conflict: the last writer wins. Re-read right before you write.
- Contract administrators and the project’s Accountable may change the project; only a contract administrator may change the Accountable. A Support may change only the project’s metadata.
dates.startDateis required. A start date that has already passed cannot be changed (send it unchanged); a future one cannot be moved into the past; a project without one needs today or a later date. Each of these is a400.- The colour palette holds at most 7 colours; on an Expert price plan
at most three
customFields, with labels of at most 25 characters.
The answer is the updated project document.
PUT
/
api
/
v2
/
data
/
projects
/
{database}
/
{id}
Update a project
curl --request PUT \
--url https://web.edcontrols.com/api/v2/data/projects/{database}/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"referenceName": "<string>",
"archived": "<string>",
"type": "IB.EdBundle.Document.Project",
"tags": [
"<string>"
],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z",
"startDate": "<string>",
"endDate": "<string>"
},
"location": {
"location": "<string>",
"latitude": 123,
"longitude": 123
},
"participants": {
"accountable": {
"email": "jsmith@example.com",
"type": "<string>"
},
"support": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"consulted": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"informed": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
]
},
"settings": {},
"customFields": [
{
"id": "<string>",
"label": "<string>"
}
]
}
'import requests
url = "https://web.edcontrols.com/api/v2/data/projects/{database}/{id}"
payload = {
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"referenceName": "<string>",
"archived": "<string>",
"type": "IB.EdBundle.Document.Project",
"tags": ["<string>"],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z",
"startDate": "<string>",
"endDate": "<string>"
},
"location": {
"location": "<string>",
"latitude": 123,
"longitude": 123
},
"participants": {
"accountable": {
"email": "jsmith@example.com",
"type": "<string>"
},
"support": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"consulted": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"informed": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
]
},
"settings": {},
"customFields": [
{
"id": "<string>",
"label": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_id: '<string>',
_rev: '<string>',
name: '<string>',
referenceName: '<string>',
archived: '<string>',
type: 'IB.EdBundle.Document.Project',
tags: ['<string>'],
dates: {
creationDate: '2023-11-07T05:31:56Z',
lastModifiedDate: '2023-11-07T05:31:56Z',
startDate: '<string>',
endDate: '<string>'
},
location: {location: '<string>', latitude: 123, longitude: 123},
participants: {
accountable: {email: 'jsmith@example.com', type: '<string>'},
support: [{email: 'jsmith@example.com', type: '<string>'}],
consulted: [{email: 'jsmith@example.com', type: '<string>'}],
informed: [{email: 'jsmith@example.com', type: '<string>'}]
},
settings: {},
customFields: [{id: '<string>', label: '<string>'}]
})
};
fetch('https://web.edcontrols.com/api/v2/data/projects/{database}/{id}', 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://web.edcontrols.com/api/v2/data/projects/{database}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'_id' => '<string>',
'_rev' => '<string>',
'name' => '<string>',
'referenceName' => '<string>',
'archived' => '<string>',
'type' => 'IB.EdBundle.Document.Project',
'tags' => [
'<string>'
],
'dates' => [
'creationDate' => '2023-11-07T05:31:56Z',
'lastModifiedDate' => '2023-11-07T05:31:56Z',
'startDate' => '<string>',
'endDate' => '<string>'
],
'location' => [
'location' => '<string>',
'latitude' => 123,
'longitude' => 123
],
'participants' => [
'accountable' => [
'email' => 'jsmith@example.com',
'type' => '<string>'
],
'support' => [
[
'email' => 'jsmith@example.com',
'type' => '<string>'
]
],
'consulted' => [
[
'email' => 'jsmith@example.com',
'type' => '<string>'
]
],
'informed' => [
[
'email' => 'jsmith@example.com',
'type' => '<string>'
]
]
],
'settings' => [
],
'customFields' => [
[
'id' => '<string>',
'label' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://web.edcontrols.com/api/v2/data/projects/{database}/{id}"
payload := strings.NewReader("{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"referenceName\": \"<string>\",\n \"archived\": \"<string>\",\n \"type\": \"IB.EdBundle.Document.Project\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"location\": {\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"participants\": {\n \"accountable\": {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n },\n \"support\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"consulted\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"informed\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"settings\": {},\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://web.edcontrols.com/api/v2/data/projects/{database}/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"referenceName\": \"<string>\",\n \"archived\": \"<string>\",\n \"type\": \"IB.EdBundle.Document.Project\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"location\": {\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"participants\": {\n \"accountable\": {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n },\n \"support\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"consulted\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"informed\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"settings\": {},\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://web.edcontrols.com/api/v2/data/projects/{database}/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"_id\": \"<string>\",\n \"_rev\": \"<string>\",\n \"name\": \"<string>\",\n \"referenceName\": \"<string>\",\n \"archived\": \"<string>\",\n \"type\": \"IB.EdBundle.Document.Project\",\n \"tags\": [\n \"<string>\"\n ],\n \"dates\": {\n \"creationDate\": \"2023-11-07T05:31:56Z\",\n \"lastModifiedDate\": \"2023-11-07T05:31:56Z\",\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"location\": {\n \"location\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n },\n \"participants\": {\n \"accountable\": {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n },\n \"support\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"consulted\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ],\n \"informed\": [\n {\n \"email\": \"jsmith@example.com\",\n \"type\": \"<string>\"\n }\n ]\n },\n \"settings\": {},\n \"customFields\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"_rev": "<string>",
"name": "<string>",
"referenceName": "<string>",
"archived": "<string>",
"type": "IB.EdBundle.Document.Project",
"tags": [
"<string>"
],
"dates": {
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z",
"startDate": "<string>",
"endDate": "<string>"
},
"location": {
"location": "<string>",
"latitude": 123,
"longitude": 123
},
"participants": {
"accountable": {
"email": "jsmith@example.com",
"type": "<string>"
},
"support": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"consulted": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
],
"informed": [
{
"email": "jsmith@example.com",
"type": "<string>"
}
]
},
"settings": {},
"customFields": [
{
"id": "<string>",
"label": "<string>",
"type": "freetext"
}
]
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 422,
"detail": "content.title is required"
}Authorizations
Path Parameters
Body
application/json
Response
Updated project.
