Save Allocation
curl --request POST \
--url https://planner.svc.v2.projectcor.com/allocation/saveAllocation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": 1111,
"companyId": 1111,
"email": "email@email.com",
"resource": {
"typeId": "Project",
"entityId": 1111
},
"from": "2024-06-01",
"to": "2024-10-31",
"assignedByUserId": 11111,
"allocatedHours": 20
}
'import requests
url = "https://planner.svc.v2.projectcor.com/allocation/saveAllocation"
payload = {
"userId": 1111,
"companyId": 1111,
"email": "email@email.com",
"resource": {
"typeId": "Project",
"entityId": 1111
},
"from": "2024-06-01",
"to": "2024-10-31",
"assignedByUserId": 11111,
"allocatedHours": 20
}
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({
userId: 1111,
companyId: 1111,
email: 'email@email.com',
resource: {typeId: 'Project', entityId: 1111},
from: '2024-06-01',
to: '2024-10-31',
assignedByUserId: 11111,
allocatedHours: 20
})
};
fetch('https://planner.svc.v2.projectcor.com/allocation/saveAllocation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://planner.svc.v2.projectcor.com/allocation/saveAllocation';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 1111,
companyId: 1111,
email: 'email@email.com',
resource: {typeId: 'Project', entityId: 1111},
from: '2024-06-01',
to: '2024-10-31',
assignedByUserId: 11111,
allocatedHours: 20
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://planner.svc.v2.projectcor.com/allocation/saveAllocation",
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([
'userId' => 1111,
'companyId' => 1111,
'email' => 'email@email.com',
'resource' => [
'typeId' => 'Project',
'entityId' => 1111
],
'from' => '2024-06-01',
'to' => '2024-10-31',
'assignedByUserId' => 11111,
'allocatedHours' => 20
]),
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://planner.svc.v2.projectcor.com/allocation/saveAllocation"
payload := strings.NewReader("{\n \"userId\": 1111,\n \"companyId\": 1111,\n \"email\": \"email@email.com\",\n \"resource\": {\n \"typeId\": \"Project\",\n \"entityId\": 1111\n },\n \"from\": \"2024-06-01\",\n \"to\": \"2024-10-31\",\n \"assignedByUserId\": 11111,\n \"allocatedHours\": 20\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))
}Allocations
Save Allocation
Creates a new resource allocation for a user on a project.
Request Body Requirements: All values in the object are required.
Known Errors:
InvalidAllocationError— The allocation is invalid:- Empty
allocatedHoursfield - The
fromdate is greater than or equal to thetodate - The date range exceeds 12 months
- Empty
AllocationAlreadyExistInDatesRangeError— An allocation already exists within the specified date rangeUserNotFoundError— The specified user cannot be foundUserNotHaveWorkDaysError— The user does not have any work days configuredProjectNotFoundError— The specified project cannot be found
POST
/
allocation
/
saveAllocation
Save Allocation
curl --request POST \
--url https://planner.svc.v2.projectcor.com/allocation/saveAllocation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": 1111,
"companyId": 1111,
"email": "email@email.com",
"resource": {
"typeId": "Project",
"entityId": 1111
},
"from": "2024-06-01",
"to": "2024-10-31",
"assignedByUserId": 11111,
"allocatedHours": 20
}
'import requests
url = "https://planner.svc.v2.projectcor.com/allocation/saveAllocation"
payload = {
"userId": 1111,
"companyId": 1111,
"email": "email@email.com",
"resource": {
"typeId": "Project",
"entityId": 1111
},
"from": "2024-06-01",
"to": "2024-10-31",
"assignedByUserId": 11111,
"allocatedHours": 20
}
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({
userId: 1111,
companyId: 1111,
email: 'email@email.com',
resource: {typeId: 'Project', entityId: 1111},
from: '2024-06-01',
to: '2024-10-31',
assignedByUserId: 11111,
allocatedHours: 20
})
};
fetch('https://planner.svc.v2.projectcor.com/allocation/saveAllocation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://planner.svc.v2.projectcor.com/allocation/saveAllocation';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 1111,
companyId: 1111,
email: 'email@email.com',
resource: {typeId: 'Project', entityId: 1111},
from: '2024-06-01',
to: '2024-10-31',
assignedByUserId: 11111,
allocatedHours: 20
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://planner.svc.v2.projectcor.com/allocation/saveAllocation",
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([
'userId' => 1111,
'companyId' => 1111,
'email' => 'email@email.com',
'resource' => [
'typeId' => 'Project',
'entityId' => 1111
],
'from' => '2024-06-01',
'to' => '2024-10-31',
'assignedByUserId' => 11111,
'allocatedHours' => 20
]),
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://planner.svc.v2.projectcor.com/allocation/saveAllocation"
payload := strings.NewReader("{\n \"userId\": 1111,\n \"companyId\": 1111,\n \"email\": \"email@email.com\",\n \"resource\": {\n \"typeId\": \"Project\",\n \"entityId\": 1111\n },\n \"from\": \"2024-06-01\",\n \"to\": \"2024-10-31\",\n \"assignedByUserId\": 11111,\n \"allocatedHours\": 20\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))
}Authorizations
Uses the same authentication as the main COR API. Obtain a token from https://api.projectcor.com/v1/oauth/token
Body
application/json
ID of the user being allocated
Company ID
Show child attributes
Show child attributes
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD). Must be after 'from' date and within 12 months.
ID of the user who assigned the allocation
Number of hours allocated
User email (optional)
Response
Allocation saved successfully
Was this page helpful?

