Package Promotion (Promote) API
  • 24 Feb 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

Package Promotion (Promote) API

  • Dark
    Light
  • PDF

The Package Promotion API helps automate Package Promotion in ProGet by posting JSON- or Form-encoded data to instruct ProGet to promote a package.

The status of these promotions can be queried using the Package Promotion (Query) API.

Security & API Keys

Before using this endpoint, you will need to create an API Key with the appropriate permissions.

Access Type Requirements
System API Keys Use/Manage Feeds Permission
Feed API Keys Promote Permission
Personal API Key associated user must have Feeds: Accept Package Promotions

Specifying the API Key

This API Key can be included in the posted data as a JSON Property (API_Key) or Form-encoded Value (key). You can pass it as a header (X-ApiKey) or querystring (key). See API Key Usage to learn more.

Specification

POST /api/promotions/promote

Promotes a package to a specified feed. Of the fields listed in the request body, all fields are required except for groupName and comments.

For npm feeds, groupName should be the package scope (e.g. @mycompany or @vue).

For Docker registries, packageName should be the full repository name (e.g. bitnami/dotnet) and version should be the tag (e.g. a version number).

JSON Request

`POST /api/promotions/promote Content-Type: application/json`

Request Body:

{
  packageName: "hdars-package",
  groupName: "",
  version: "1000.0.0",
  fromFeed: "hdars-integration-feed",
  toFeed: "hdars-production-feed",
  comments: "This package was promoted by BuildMaster HDARS Application"
} 

URL-Encoded Request

`POST /api/promotions/promote Content-Type: application/x-www-form-urlencoded`

Request Body:

packageName="hdars-package"&version=1000.0.0&fromFeed=hdars-integration-feed&toFeed=hdars-production-feed&comments=This+package+was+promoted+by+BuildMaster+HDARS+Application

Was this article helpful?