Overview
This endpoint retrieves the raw content of a specific file within a repository using a viewer token. It’s used by recruiters to read source code files without authentication.Endpoint
Path Parameters
The unique viewer token that grants access to the repository
Query Parameters
The file path within the repository (e.g., “src/main.go” or “README.md”)
How It Works
- Token is extracted from URL path
- File path is read from query parameters
- Link is validated (including soft-deleted check)
- Expiration and view limits are verified
- File content is fetched from GitHub API
- Raw file content is returned as plain text
Response
Returns the raw file content astext/plain.
The response body contains the actual file contents without any JSON wrapping.
Example Request
Example Response
Error Responses
Invalid viewer URL - Malformed URL structureMissing token or path - Either token or path query parameter is missing
Invalid link or deleted link - Token not found or link has been soft-deleted
This link has been deleted - The viewer link was deleted by the owner
This link has expired - Token expiration date has passedView limit reached - Maximum views exceeded
Proxied errors from GitHub API if the file cannot be accessed
Use Case
When a recruiter clicks on a file in the repository viewer, this endpoint fetches and displays the file’s contents. The raw text format allows for syntax highlighting on the frontend.Notes
- This endpoint uses
Unscoped()query to check for soft-deleted links - Returns raw file content with
Content-Type: text/plain - GitHub API is called with
Accept: application/vnd.github.v3.rawheader