Skip to main content
POST
/
timmi-timesheet
/
api
/
timesheets
/
{id}
/
invalidate
Invalidate a timesheet
curl --request POST \
  --url https://{host}/timmi-timesheet/api/timesheets/{id}/invalidate \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "comment": "<string>"
}
'
import requests

url = "https://{host}/timmi-timesheet/api/timesheets/{id}/invalidate"

payload = { "comment": "<string>" }
headers = {
    "Authorization": "<authorization>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
  body: JSON.stringify({comment: '<string>'})
};

fetch('https://{host}/timmi-timesheet/api/timesheets/{id}/invalidate', 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://{host}/timmi-timesheet/api/timesheets/{id}/invalidate",
  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([
    'comment' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <authorization>",
    "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://{host}/timmi-timesheet/api/timesheets/{id}/invalidate"

	payload := strings.NewReader("{\n  \"comment\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<authorization>")
	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://{host}/timmi-timesheet/api/timesheets/{id}/invalidate")
  .header("Authorization", "<authorization>")
  .header("Content-Type", "application/json")
  .body("{\n  \"comment\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://{host}/timmi-timesheet/api/timesheets/{id}/invalidate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"comment\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "exceptionMessage": "<string>",
  "startsOn": "2023-12-25",
  "endsOn": "2023-12-25",
  "expectedNextActor": {},
  "status": "<string>"
}
{}

Headers

Authorization
string
required

API key. Value must be formatted like so: lucca application={api_key}.

Path Parameters

id
integer
required

timesheet id

Body

comment
string
required

A comment to explain why this timesheet is invalidated.

Response

OK

A WorkflowItem is an individual workflow action performed by a user.

The expectedNextActor object is a User. See API reference. [blocked]

id
integer

Unique id of the WorkflowItem.

exceptionMessage
string

Any human readable error message.

startsOn
string<date>

The Timesheet the WorkflowItem is related on starting date (included).

Pattern: yyyy-MM-dd
endsOn
string<date>

The Timesheet the WorkflowItem is related on ending date (excluded).

Pattern: yyyy-MM-dd
expectedNextActor
object

A Directory 'User'. See API reference for up-to-date attributes.

status
string
  • "success" for a succesfull workflow operation.
  • "error" if any error was met, and therefore an excetion message is set.
  • "noAction" if the workflow operation was not performed.