Get my external percentage
Returns the caller's hours on external-customer projects as a percentage of their net norm hours, for month to date, last month and the last 90 days.
For the CALLER only: percentage = round(hours registered on projects whose customer is not the account's own company ÷ (norm hours − holiday hours) × 100), as integers, for three windows relative to currentDate — month to date (today included), the previous calendar month, and a rolling 90 days ending yesterday (not three calendar months). 0 when the net norm is 0. Full definitions on WidgetDataExternalPercentageRead. currentDate's time part is dropped; no timezone conversion — the caller decides which calendar day "today" is.
Use it to:
- Show a consultant how much of their capacity went to customer (external) work
Not for:
- Billable share →
GET /v2/widget-data/billable-percentage(different numerator AND a different norm definition) - Another employee or a team — always the caller
Behaviour:
- Idempotent.
- Safe to retry.
- Changes are visible to the next read immediately.
See also: GET /v2/widget-data/billable-percentage, GET /v2/widget/all-active-widgets
Not yet documented: examples.
curl -X GET "https://app3.timelog.com/your-account/api/v2/widget-data/external-percentage?currentDate=2024-12-25T10%3A00%3A00Z" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://app3.timelog.com/your-account/api/v2/widget-data/external-percentage?currentDate=2024-12-25T10%3A00%3A00Z"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://app3.timelog.com/your-account/api/v2/widget-data/external-percentage?currentDate=2024-12-25T10%3A00%3A00Z", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://app3.timelog.com/your-account/api/v2/widget-data/external-percentage?currentDate=2024-12-25T10%3A00%3A00Z", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app3.timelog.com/your-account/api/v2/widget-data/external-percentage?currentDate=2024-12-25T10%3A00%3A00Z')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"Properties": {
"UserId": 123,
"CurrentMonthPercentage": 25,
"LastMonthPercentage": 25,
"LastThreeMonthsPercentage": 25
},
"Links": [
{
"Href": "example_string",
"Rel": "example_string"
}
],
"Actions": [
{}
]
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
/v2/widget-data/external-percentage
Target server for requests. Edit to use your own host.
OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
> Not yet documented: how to obtain a token.
> Not yet documented: token lifetime.
Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
> Not yet documented: how to obtain a token.
> Not yet documented: token lifetime.The reference day ('today'). Windows: month start … currentDate; previous calendar month; currentDate−90 … currentDate−1. Time part dropped. Omitted → 404 action not matched (captured). Date only — no time component.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. JWT and reference tokens are both accepted. The token must carry the required scope (default tlp).
The token's sub claim is the acting user. A token WITHOUT sub (client-credentials) acts as the system service user. If the sub user cannot log in (inactive, locked, deleted), the request is rejected with 401 — it is no longer let through without a user.
Not yet documented: how to obtain a token.
Not yet documented: token lifetime.
Query Parameters
The reference day ('today'). Windows: month start … currentDate; previous calendar month; currentDate−90 … currentDate−1. Time part dropped. Omitted → 404 action not matched (captured).
Date only — no time component.
Responses
"External percentage" of ONE user (the caller): registered hours on projects of external customers as a percentage of the user's norm hours (expected working hours) minus holiday, for three windows relative to currentDate. Formula, per window: round(ExternalHours / NetNormHours × 100) as an integer; 0 when NetNormHours = 0. - ExternalHours = SUM of the caller's project time registrations (those linked to a task allocation through a work unit row) on projects whose customer is NOT the account's own company (application value FirmaID). Billable and non-billable hours both count. Registrations without such a work unit (e.g. absence) are not counted. - NetNormHours = Function_Calulate_Norm_New(employee, from, to, SubtractVacation = 1): SUM of the employee's NormalWorkingHours in the window, clipped to the employment period (hire / dismissal date), minus hours registered on absence codes whose system absence code type is 2 (holiday); never below 0. - Values can exceed 100 (more external hours than norm).