Skip to content

Upload API — Client and reference data #11

Description

Parent: #4

Delivers the Upload API authentication plumbing and the two reference-data endpoints needed before files can be uploaded. The Upload API uses a different auth mechanism (X-Api-Token header) and different base URLs (site-relative to https://{game}.curseforge.com/api/).

Acceptance criteria:

  • Invoke-CurseForgeUploadAPI (private) handles Upload API auth and base URL resolution
  • -Game parameter determines the site-relative base URL (e.g., minecrafthttps://minecraft.curseforge.com/api/)
  • Get-CurseForgeUploadGameVersion retrieves game versions with their IDs (needed for upload metadata)
  • Get-CurseForgeUploadGameDependency retrieves available dependencies (slugs and IDs)
  • Upload API token is read from the existing CurseForgeContext object (.AuthorToken property set during Connect-CurseForge)
  • Unit tests cover auth header injection and response parsing

Endpoints:

Function Method Path
Get-CurseForgeUploadGameVersion GET /api/game/versions
Get-CurseForgeUploadGameDependency GET /api/game/dependencies

Auth: Uses X-Api-Token header (different from Core API's x-api-key).

Base URL pattern: https://{game}.curseforge.com/api/ where {game} is the game slug (e.g., minecraft, wow).

Decision: Separate private Invoke-CurseForgeUploadAPI rather than overloading Invoke-CurseForgeAPI, because the auth header name, base URL resolution, and response shapes are fundamentally different.

Blocked by: #5 (needs the Context foundation)


Sub-issues

See linked Tasks below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions