Create Assignment
curl --request POST \
--url https://api.everhour.com/resource-planner/assignments \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"startDate": "2019-01-21",
"endDate": "2019-02-01",
"user": 79786,
"project": "as:981141080110246",
"task": "<string>",
"client": 123,
"type": "project",
"time": 252000,
"note": "<string>",
"includeWeekends": true,
"color": "<string>",
"sendNotification": true,
"forceOverride": true,
"timeOffType": "<string>",
"users": [
79786,
80012
],
"reviewer": 123
}
'import requests
url = "https://api.everhour.com/resource-planner/assignments"
payload = {
"startDate": "2019-01-21",
"endDate": "2019-02-01",
"user": 79786,
"project": "as:981141080110246",
"task": "<string>",
"client": 123,
"type": "project",
"time": 252000,
"note": "<string>",
"includeWeekends": True,
"color": "<string>",
"sendNotification": True,
"forceOverride": True,
"timeOffType": "<string>",
"users": [79786, 80012],
"reviewer": 123
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2019-01-21',
endDate: '2019-02-01',
user: 79786,
project: 'as:981141080110246',
task: '<string>',
client: 123,
type: 'project',
time: 252000,
note: '<string>',
includeWeekends: true,
color: '<string>',
sendNotification: true,
forceOverride: true,
timeOffType: '<string>',
users: [79786, 80012],
reviewer: 123
})
};
fetch('https://api.everhour.com/resource-planner/assignments', 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.everhour.com/resource-planner/assignments",
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([
'startDate' => '2019-01-21',
'endDate' => '2019-02-01',
'user' => 79786,
'project' => 'as:981141080110246',
'task' => '<string>',
'client' => 123,
'type' => 'project',
'time' => 252000,
'note' => '<string>',
'includeWeekends' => true,
'color' => '<string>',
'sendNotification' => true,
'forceOverride' => true,
'timeOffType' => '<string>',
'users' => [
79786,
80012
],
'reviewer' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.everhour.com/resource-planner/assignments"
payload := strings.NewReader("{\n \"startDate\": \"2019-01-21\",\n \"endDate\": \"2019-02-01\",\n \"user\": 79786,\n \"project\": \"as:981141080110246\",\n \"task\": \"<string>\",\n \"client\": 123,\n \"type\": \"project\",\n \"time\": 252000,\n \"note\": \"<string>\",\n \"includeWeekends\": true,\n \"color\": \"<string>\",\n \"sendNotification\": true,\n \"forceOverride\": true,\n \"timeOffType\": \"<string>\",\n \"users\": [\n 79786,\n 80012\n ],\n \"reviewer\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<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.everhour.com/resource-planner/assignments")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2019-01-21\",\n \"endDate\": \"2019-02-01\",\n \"user\": 79786,\n \"project\": \"as:981141080110246\",\n \"task\": \"<string>\",\n \"client\": 123,\n \"type\": \"project\",\n \"time\": 252000,\n \"note\": \"<string>\",\n \"includeWeekends\": true,\n \"color\": \"<string>\",\n \"sendNotification\": true,\n \"forceOverride\": true,\n \"timeOffType\": \"<string>\",\n \"users\": [\n 79786,\n 80012\n ],\n \"reviewer\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.everhour.com/resource-planner/assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2019-01-21\",\n \"endDate\": \"2019-02-01\",\n \"user\": 79786,\n \"project\": \"as:981141080110246\",\n \"task\": \"<string>\",\n \"client\": 123,\n \"type\": \"project\",\n \"time\": 252000,\n \"note\": \"<string>\",\n \"includeWeekends\": true,\n \"color\": \"<string>\",\n \"sendNotification\": true,\n \"forceOverride\": true,\n \"timeOffType\": \"<string>\",\n \"users\": [\n 79786,\n 80012\n ],\n \"reviewer\": 123\n}"
response = http.request(request)
puts response.read_body{
"days": 10,
"endDate": "2019-02-01",
"id": 41827,
"project": "as:981141080110246",
"startDate": "2019-01-21",
"time": 252000,
"type": "project",
"user": 79786
}Schedule
Create Assignment
Create a schedule assignment. To create time-off use POST /resource-planner/assignments/time-off instead.
POST
/
resource-planner
/
assignments
Create Assignment
curl --request POST \
--url https://api.everhour.com/resource-planner/assignments \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"startDate": "2019-01-21",
"endDate": "2019-02-01",
"user": 79786,
"project": "as:981141080110246",
"task": "<string>",
"client": 123,
"type": "project",
"time": 252000,
"note": "<string>",
"includeWeekends": true,
"color": "<string>",
"sendNotification": true,
"forceOverride": true,
"timeOffType": "<string>",
"users": [
79786,
80012
],
"reviewer": 123
}
'import requests
url = "https://api.everhour.com/resource-planner/assignments"
payload = {
"startDate": "2019-01-21",
"endDate": "2019-02-01",
"user": 79786,
"project": "as:981141080110246",
"task": "<string>",
"client": 123,
"type": "project",
"time": 252000,
"note": "<string>",
"includeWeekends": True,
"color": "<string>",
"sendNotification": True,
"forceOverride": True,
"timeOffType": "<string>",
"users": [79786, 80012],
"reviewer": 123
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2019-01-21',
endDate: '2019-02-01',
user: 79786,
project: 'as:981141080110246',
task: '<string>',
client: 123,
type: 'project',
time: 252000,
note: '<string>',
includeWeekends: true,
color: '<string>',
sendNotification: true,
forceOverride: true,
timeOffType: '<string>',
users: [79786, 80012],
reviewer: 123
})
};
fetch('https://api.everhour.com/resource-planner/assignments', 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.everhour.com/resource-planner/assignments",
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([
'startDate' => '2019-01-21',
'endDate' => '2019-02-01',
'user' => 79786,
'project' => 'as:981141080110246',
'task' => '<string>',
'client' => 123,
'type' => 'project',
'time' => 252000,
'note' => '<string>',
'includeWeekends' => true,
'color' => '<string>',
'sendNotification' => true,
'forceOverride' => true,
'timeOffType' => '<string>',
'users' => [
79786,
80012
],
'reviewer' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.everhour.com/resource-planner/assignments"
payload := strings.NewReader("{\n \"startDate\": \"2019-01-21\",\n \"endDate\": \"2019-02-01\",\n \"user\": 79786,\n \"project\": \"as:981141080110246\",\n \"task\": \"<string>\",\n \"client\": 123,\n \"type\": \"project\",\n \"time\": 252000,\n \"note\": \"<string>\",\n \"includeWeekends\": true,\n \"color\": \"<string>\",\n \"sendNotification\": true,\n \"forceOverride\": true,\n \"timeOffType\": \"<string>\",\n \"users\": [\n 79786,\n 80012\n ],\n \"reviewer\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<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.everhour.com/resource-planner/assignments")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2019-01-21\",\n \"endDate\": \"2019-02-01\",\n \"user\": 79786,\n \"project\": \"as:981141080110246\",\n \"task\": \"<string>\",\n \"client\": 123,\n \"type\": \"project\",\n \"time\": 252000,\n \"note\": \"<string>\",\n \"includeWeekends\": true,\n \"color\": \"<string>\",\n \"sendNotification\": true,\n \"forceOverride\": true,\n \"timeOffType\": \"<string>\",\n \"users\": [\n 79786,\n 80012\n ],\n \"reviewer\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.everhour.com/resource-planner/assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2019-01-21\",\n \"endDate\": \"2019-02-01\",\n \"user\": 79786,\n \"project\": \"as:981141080110246\",\n \"task\": \"<string>\",\n \"client\": 123,\n \"type\": \"project\",\n \"time\": 252000,\n \"note\": \"<string>\",\n \"includeWeekends\": true,\n \"color\": \"<string>\",\n \"sendNotification\": true,\n \"forceOverride\": true,\n \"timeOffType\": \"<string>\",\n \"users\": [\n 79786,\n 80012\n ],\n \"reviewer\": 123\n}"
response = http.request(request)
puts response.read_body{
"days": 10,
"endDate": "2019-02-01",
"id": 41827,
"project": "as:981141080110246",
"startDate": "2019-01-21",
"time": 252000,
"type": "project",
"user": 79786
}Authorizations
Body
application/json
Format: Y-m-d
Example:
"2019-01-21"
Format: Y-m-d
Example:
"2019-02-01"
Example:
79786
Project encoded ID
Example:
"as:981141080110246"
Task encoded ID
Client ID
Available options:
project, client, task, time-off Example:
"project"
Scheduled time in seconds
Example:
252000
Max 1000 chars
Hex color #rrggbb
Example:
true
Time-off type (only when type is time-off).
Time-off period (only when type is time-off).
Available options:
full-day, half-of-day, quarter-of-day, half-and-quarter-of-day Time-off approval status (only when type is time-off).
Available options:
pending, approved Create the same schedule for multiple users (create only).
Example:
[79786, 80012]
Reviewer user ID for time-off (create only).
Response
OK
Number of workdays
Example:
10
Example:
"2019-02-01"
Example:
41827
Example:
"as:981141080110246"
Example:
"2019-01-21"
Scheduled time in seconds
Example:
252000
Available options:
project, time-off Example:
"project"
Example:
79786
⌘I
