Skip to main content

Overview

This endpoint retrieves metadata about the repository associated with a viewer token, specifically the GitHub username of the owner and the repository name. This is useful for displaying context to the viewer.

Endpoint

GET /view-info/:token

Path Parameters

token
string
required
The unique viewer token that grants access to the repository

How It Works

  1. Token is extracted from the URL path
  2. Viewer link is looked up in the database
  3. Associated user is retrieved
  4. GitHub username and repository name are returned

Response

Returns a JSON object with repository metadata.
github_username
string
The GitHub username of the repository owner
repo_name
string
The name of the repository being shared

Example Request

curl https://api.privycode.com/view-info/abc123xyz456

Example Response

{
  "github_username": "johndoe",
  "repo_name": "my-portfolio-project"
}

Error Responses

400
error
Missing token - No token provided in the URL
404
error
Invalid or expired link - Token not found in database
500
error
User not found - The user associated with the viewer link no longer exists

Use Case

This endpoint is typically called by the frontend when a recruiter first accesses a viewer link. It provides the necessary information to display a header like “Viewing: johndoe/my-portfolio-project” in the UI.

Notes

  • This endpoint does NOT check expiration dates or view limits
  • It does NOT increment the view count
  • It’s a lightweight metadata endpoint for UI context
  • Can be used to verify a token exists before attempting to load repository contents

Security Considerations

While this endpoint doesn’t check expiration, it only reveals the GitHub username and repository name, which are typically public information. The actual repository contents are protected by the other endpoints that do enforce expiration and view limits.

Build docs developers (and LLMs) love