Skip to content
Navigation

getRepoExtensionFileAtBranch

Read one extension file with its content as written and the copy Forge formatted for reading.

GET
/repos/{repo_id}/branches/{branch}/extensions/{name}/files/{file_id}

Path parameters

  • repo_id
    string
    required
    pattern: ^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • branch
    string
    required
    minLength: 1
  • name
    string
    required
    maxLength: 64 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
  • file_id
    string
    required
    pattern: ^extension_file_[0-7][0-9a-hjkmnp-tv-z]{25}$

Returns

200

ExtensionFile

JSON
  • id
    string
    required
    pattern: ^extension_file_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • extension_id
    string
    required
    pattern: ^extension_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • path
    string
    required
    maxLength: 256 · pattern: ^(?:[A-Za-z0-9_][A-Za-z0-9._-]*\/)*[A-Za-z0-9_][A-Za-z0-9._-]*$
  • content
    string
    required
  • attachment_blob_id
    required

    One of the following:

    • TypeId
    • null
  • formatted_content
    required

    The file formatted with Prettier for reading, when that differs from content. Forge formats a file shortly after it's written, so this is null until then, and stays null when the file is already formatted, isn't TypeScript, JavaScript or JSON, is over 256 KiB, or doesn't parse. Writes never take it, and builds read only content, so edit from content.

    One of the following:

    • string
    • null
  • formatting_pending
    boolean
    required

    Whether Forge is still formatting the file: read it again shortly for formatted_content. False once it's formatted, or when Forge doesn't format it.

400

InvalidRequest
JSON
  • _tag
    InvalidRequest
    required
  • part
    path
    or
    query
    or
    headers
    or
    body
    required
  • issues
    array of
    object
    required
    • path
      array of
      required

      One of the following:

      • string
      • integer
    • message
      string
      required

401

InvalidCredentials
JSON
  • _tag
    InvalidCredentials
    required

403

Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired
JSON

One of the following:

  • ForbiddenEncoded
    • _tag
      Forbidden
      required
    • message
      string
      required
  • ForbiddenOriginEncoded
    • _tag
      ForbiddenOrigin
      required
  • RequiresPersonalSessionEncoded
    • _tag
      RequiresPersonalSession
      required
  • RunBranchRequiredEncoded
    • _tag
      RunBranchRequired
      required
    • branch
      string
      required
      minLength: 1
    • message
      string
      required

404

BranchNotFound | ExtensionNotFound | ExtensionFileNotFound | RepoNotFound
JSON

One of the following:

  • BranchNotFoundEncoded
    • _tag
      BranchNotFound
      required
    • branch
      string
      required
      minLength: 1
  • ExtensionNotFoundEncoded
    • _tag
      ExtensionNotFound
      required
    • extension_name
      string
      required
      minLength: 1
  • ExtensionFileNotFoundEncoded
    • _tag
      ExtensionFileNotFound
      required
    • extension_name
      string
      required
      minLength: 1
    • file_id
      string
      required
      pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • RepoNotFoundEncoded
    • _tag
      RepoNotFound
      required

429

RateLimited
JSON
  • _tag
    RateLimited
    required

500

RepoFailure
JSON
  • _tag
    RepoFailure
    required
  • reason
    string
    required

503

SessionUnavailable | RateLimitUnavailable
JSON

One of the following:

  • SessionUnavailableEncoded
    • _tag
      SessionUnavailable
      required
  • RateLimitUnavailableEncoded
    • _tag
      RateLimitUnavailable
      required

Type to search…

↑↓ navigate↵ selectEsc close