curl --request POST \
--url https://api.projectcor.com/v1/hours \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"task_log_id": 123,
"start": "2023-11-07T05:31:56Z",
"stop": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.projectcor.com/v1/hours"
payload = {
"task_log_id": 123,
"start": "2023-11-07T05:31:56Z",
"stop": "2023-11-07T05:31:56Z"
}
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({task_log_id: 123, start: '2023-11-07T05:31:56Z', stop: '2023-11-07T05:31:56Z'})
};
fetch('https://api.projectcor.com/v1/hours', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/hours';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({task_log_id: 123, start: '2023-11-07T05:31:56Z', stop: '2023-11-07T05:31:56Z'})
};
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://api.projectcor.com/v1/hours",
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([
'task_log_id' => 123,
'start' => '2023-11-07T05:31:56Z',
'stop' => '2023-11-07T05:31:56Z'
]),
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.projectcor.com/v1/hours"
payload := strings.NewReader("{\n \"task_log_id\": 123,\n \"start\": \"2023-11-07T05:31:56Z\",\n \"stop\": \"2023-11-07T05:31:56Z\"\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))
}{
"id": 123,
"start": "2023-11-07T05:31:56Z",
"stop": "2023-11-07T05:31:56Z",
"duration": "<string>",
"cost": 123,
"user_id": 123,
"task_log_id": 123,
"project_id": 123,
"client_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"status": "pending",
"status_changed_by": 123,
"status_changed_at": "2023-11-07T05:31:56Z",
"type": "<string>",
"task_log_rework_id": 123,
"comments": "<string>",
"user": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"picture": "<string>",
"remaining_hours": 123,
"timezone": "<string>",
"gmt": "<string>"
},
"client": {},
"project": {},
"task": {
"id": 123,
"title": "<string>",
"project_id": 123,
"task_father": 123,
"status": "<string>",
"father": {
"id": 123,
"title": "<string>"
},
"project": {
"id": 123,
"name": "<string>",
"client_id": 123,
"contract_id": 123,
"client": {
"id": 123,
"name": "<string>",
"client_status_id": 123
},
"has_expired_contract": true
},
"labels": [
{
"id": 123,
"hex": "<string>",
"names": [
{
"name": "<string>",
"lang": "<string>"
}
]
}
]
},
"userPosition": {},
"billInput": {
"id": 123,
"entity_id": 123,
"bill_id": 123,
"updated_at": "2023-11-07T05:31:56Z",
"bill": {
"id": 123,
"receipt_number": "<string>"
}
},
"rework_hour": {
"requested_by": "<string>",
"description": "<string>",
"on": "2023-11-07T05:31:56Z"
}
}Post hours
curl --request POST \
--url https://api.projectcor.com/v1/hours \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"task_log_id": 123,
"start": "2023-11-07T05:31:56Z",
"stop": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.projectcor.com/v1/hours"
payload = {
"task_log_id": 123,
"start": "2023-11-07T05:31:56Z",
"stop": "2023-11-07T05:31:56Z"
}
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({task_log_id: 123, start: '2023-11-07T05:31:56Z', stop: '2023-11-07T05:31:56Z'})
};
fetch('https://api.projectcor.com/v1/hours', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/hours';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({task_log_id: 123, start: '2023-11-07T05:31:56Z', stop: '2023-11-07T05:31:56Z'})
};
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://api.projectcor.com/v1/hours",
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([
'task_log_id' => 123,
'start' => '2023-11-07T05:31:56Z',
'stop' => '2023-11-07T05:31:56Z'
]),
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.projectcor.com/v1/hours"
payload := strings.NewReader("{\n \"task_log_id\": 123,\n \"start\": \"2023-11-07T05:31:56Z\",\n \"stop\": \"2023-11-07T05:31:56Z\"\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))
}{
"id": 123,
"start": "2023-11-07T05:31:56Z",
"stop": "2023-11-07T05:31:56Z",
"duration": "<string>",
"cost": 123,
"user_id": 123,
"task_log_id": 123,
"project_id": 123,
"client_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"status": "pending",
"status_changed_by": 123,
"status_changed_at": "2023-11-07T05:31:56Z",
"type": "<string>",
"task_log_rework_id": 123,
"comments": "<string>",
"user": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"picture": "<string>",
"remaining_hours": 123,
"timezone": "<string>",
"gmt": "<string>"
},
"client": {},
"project": {},
"task": {
"id": 123,
"title": "<string>",
"project_id": 123,
"task_father": 123,
"status": "<string>",
"father": {
"id": 123,
"title": "<string>"
},
"project": {
"id": 123,
"name": "<string>",
"client_id": 123,
"contract_id": 123,
"client": {
"id": 123,
"name": "<string>",
"client_status_id": 123
},
"has_expired_contract": true
},
"labels": [
{
"id": 123,
"hex": "<string>",
"names": [
{
"name": "<string>",
"lang": "<string>"
}
]
}
]
},
"userPosition": {},
"billInput": {
"id": 123,
"entity_id": 123,
"bill_id": 123,
"updated_at": "2023-11-07T05:31:56Z",
"bill": {
"id": 123,
"receipt_number": "<string>"
}
},
"rework_hour": {
"requested_by": "<string>",
"description": "<string>",
"on": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Response
Hours logged successfully
Unique identifier of the time entry
Start timestamp of the time entry
Stop timestamp of the time entry
Duration of the time entry in hours
Calculated cost for this time entry
ID of the user who logged the hours
ID of the task this time entry is logged against
Project ID (null when the task has no associated project)
Client ID (null when the task has no associated client)
Timestamp when the time entry was created
Current approval status of the time entry
pending, approved, rejected, paid ID of the user who last changed the status (null if status has not been changed)
Timestamp when the status was last changed (null if status has not been changed)
Type of time entry (e.g. TASK)
Rework ID if this time entry is associated with a rework, otherwise null
Optional comments on the time entry
Summary of the user who logged the time entry
Show child attributes
Show child attributes
Client information (null when the task has no associated client)
Project information (null when the task has no associated project)
Task this time entry is logged against
Show child attributes
Show child attributes
User's position information (null if not set)
Billing information, present when the time entry has been invoiced (status paid)
Show child attributes
Show child attributes
Rework details, present when task_log_rework_id is set
Show child attributes
Show child attributes
Was this page helpful?

