Diff one file
GET
/api/orgs/{org}/projects/{project}/diff/file
const url = 'https://api-dev.wrktr.com/api/orgs/example/projects/example/diff/file?from=example&to=example&path=example';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 'https://api-dev.wrktr.com/api/orgs/example/projects/example/diff/file?from=example&to=example&path=example' \ --header 'Authorization: Bearer <token>'One file’s hunks between two commits (a branch diff’s fromSha and toSha). The response never changes for the same three values.
Authorizations
Section titled “Authorizations”- bearer
- None
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”org
required
string
project
required
string
Query Parameters
Section titled “Query Parameters”from
required
string
to
required
string
path
required
string
Responses
Section titled “Responses”FileDiff
Media typeapplication/json
object
path
required
string
status
required
string
binary
required
boolean
tooLarge
required
boolean
hunks
required
Array<object>
object
Example
{ "status": "added", "hunks": [ { "oldStart": "Infinity", "oldLines": "Infinity", "newStart": "Infinity", "newLines": "Infinity", "lines": [ { "kind": "context", "oldLine": "Infinity", "newLine": "Infinity" } ] } ]}Unauthorized
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Unauthorized"}ProjectNotFound | PathNotInDiff