Targets

Read one side of a Draft file

GET
/targets/{target_id}/draft/files/content

Returns up to 24 KiB of one side of a conflicted or history-affected file: text as UTF-8, binary content as base64. Follow next_cursor with the same path and side to read the rest, and concatenate the chunks in order. A side where the file is absent returns 404.

AuthorizationBearer <token>

Organization API key from the console (ak_...), or an OAuth access token with user:org:read, the organization selected during consent, and the capability required by the operation.

In: header

Path Parameters

target_id*string

Stable identifier for one configured generated product.

Match^tgt_[a-z0-9]{16}$

Query Parameters

path*string

File path from listDraftFiles.

Length1 <= length
side*string

A side listed for the file.

Value in

  • "base"
  • "repository"
  • "incoming"
  • "accepted"
  • "default"
  • "draft"
cursor?string

next_cursor from the preceding chunk of the same path and side.

Match^[A-Za-z0-9_-]+$
Length1 <= length <= 2048

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/targets/tgt_5m8q2v7k1p9d4h6c/draft/files/content?path=src%2Findex.ts&side=base"
{  "object": "draft_file_content",  "target_id": "tgt_5m8q2v7k1p9d4h6c",  "path": "src/index.ts",  "side": "incoming",  "encoding": "utf8",  "content": "export { ParcelClient } from \"./client.js\";\nexport type { Shipment, Label } from \"./types.js\";\n",  "mode": "100644",  "size_bytes": 94,  "offset": 0,  "next_cursor": null,  "request_id": "req_3k8m1v6q9p2d7h4c"}