Get what a task changed
const url = 'http://127.0.0.1:7700/api/tasks/t3k9x2a1b2/diff';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://127.0.0.1:7700/api/tasks/t3k9x2a1b2/diff \ --header 'Authorization: Bearer <token>'The files the task added, modified or deleted, read from its own layer only, and a unified diff.
The diff is cut at 200,000 bytes. An undone task’s files are deleted, so its diff is empty and
carries undone: true. For a task on several folders, each path starts with its folder’s label and
roots maps each label to the real folder.
With at, the task’s files as they were right after that log event, read from the flight recorder
(GET /tasks/{id}/replay lists the events). A file over 1 MB then has big: true and no diff.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The task id.
Example
t3k9x2a1b2Query Parameters
Section titled “Query Parameters”A log event’s seq. Show the task’s layer as it was right after that event.
Responses
Section titled “Responses”The task’s changes.
object
object
Path inside the workspace.
A unified diff of every change
For a task on several folders, each label and the real folder it stands for.
object
Set when the task is undone and its files are gone.
Example
{ "changes": [ { "path": "a.txt", "change": "modified" }, { "path": "summary.md", "change": "added" } ], "diff": "--- a/a.txt\n+++ b/a.txt\n@@ -1 +1 @@\n-original a\n+changed by A\n"}No task with this id, or an at that is not an event number.
object
What went wrong
Example generated
{ "error": "example"}