Create Project Phase
curl --request POST \
--url https://api.sonderplan.com/v2/project/phase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Deliverables due to client",
"project_id": 2776,
"type_id": 2,
"start": 1669802192,
"end": 1670234192,
"color_background": "#B0A7F1",
"color_text": "#000000"
}
'import requests
url = "https://api.sonderplan.com/v2/project/phase"
payload = {
"name": "Deliverables due to client",
"project_id": 2776,
"type_id": 2,
"start": 1669802192,
"end": 1670234192,
"color_background": "#B0A7F1",
"color_text": "#000000"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Deliverables due to client',
project_id: 2776,
type_id: 2,
start: 1669802192,
end: 1670234192,
color_background: '#B0A7F1',
color_text: '#000000'
})
};
fetch('https://api.sonderplan.com/v2/project/phase', 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.sonderplan.com/v2/project/phase",
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' => 'Deliverables due to client',
'project_id' => 2776,
'type_id' => 2,
'start' => 1669802192,
'end' => 1670234192,
'color_background' => '#B0A7F1',
'color_text' => '#000000'
]),
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://api.sonderplan.com/v2/project/phase"
payload := strings.NewReader("{\n \"name\": \"Deliverables due to client\",\n \"project_id\": 2776,\n \"type_id\": 2,\n \"start\": 1669802192,\n \"end\": 1670234192,\n \"color_background\": \"#B0A7F1\",\n \"color_text\": \"#000000\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sonderplan.com/v2/project/phase")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Deliverables due to client\",\n \"project_id\": 2776,\n \"type_id\": 2,\n \"start\": 1669802192,\n \"end\": 1670234192,\n \"color_background\": \"#B0A7F1\",\n \"color_text\": \"#000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/project/phase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Deliverables due to client\",\n \"project_id\": 2776,\n \"type_id\": 2,\n \"start\": 1669802192,\n \"end\": 1670234192,\n \"color_background\": \"#B0A7F1\",\n \"color_text\": \"#000000\"\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 1
}
}{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}Project
Create Project Phase
WRITE access to the PROJECT module is required to access this endpointPOST
/
v2
/
project
/
phase
Create Project Phase
curl --request POST \
--url https://api.sonderplan.com/v2/project/phase \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Deliverables due to client",
"project_id": 2776,
"type_id": 2,
"start": 1669802192,
"end": 1670234192,
"color_background": "#B0A7F1",
"color_text": "#000000"
}
'import requests
url = "https://api.sonderplan.com/v2/project/phase"
payload = {
"name": "Deliverables due to client",
"project_id": 2776,
"type_id": 2,
"start": 1669802192,
"end": 1670234192,
"color_background": "#B0A7F1",
"color_text": "#000000"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Deliverables due to client',
project_id: 2776,
type_id: 2,
start: 1669802192,
end: 1670234192,
color_background: '#B0A7F1',
color_text: '#000000'
})
};
fetch('https://api.sonderplan.com/v2/project/phase', 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.sonderplan.com/v2/project/phase",
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' => 'Deliverables due to client',
'project_id' => 2776,
'type_id' => 2,
'start' => 1669802192,
'end' => 1670234192,
'color_background' => '#B0A7F1',
'color_text' => '#000000'
]),
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://api.sonderplan.com/v2/project/phase"
payload := strings.NewReader("{\n \"name\": \"Deliverables due to client\",\n \"project_id\": 2776,\n \"type_id\": 2,\n \"start\": 1669802192,\n \"end\": 1670234192,\n \"color_background\": \"#B0A7F1\",\n \"color_text\": \"#000000\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.sonderplan.com/v2/project/phase")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Deliverables due to client\",\n \"project_id\": 2776,\n \"type_id\": 2,\n \"start\": 1669802192,\n \"end\": 1670234192,\n \"color_background\": \"#B0A7F1\",\n \"color_text\": \"#000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sonderplan.com/v2/project/phase")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Deliverables due to client\",\n \"project_id\": 2776,\n \"type_id\": 2,\n \"start\": 1669802192,\n \"end\": 1670234192,\n \"color_background\": \"#B0A7F1\",\n \"color_text\": \"#000000\"\n}"
response = http.request(request)
puts response.read_body{
"success": {
"id": 1
}
}{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Project Phase object
The default project phase schema which contains all of these fields
Name of the project phase
Example:
"Deliverables due to client"
ID of the project that this phase is linked to
Example:
2776
1 = Project Phase, 2 = Project Milestone
Example:
2
UNIX time of the start of the phase
Example:
1669802192
UNIX end of the start of the phase
Example:
1670234192
A hex color value of the background of this phase
Example:
"#B0A7F1"
A hex color value of the text of this phase
Example:
"#000000"
Response
Successful Operation
Show child attributes
Show child attributes
⌘I