ProGet Documentation

Package Promotion API

The Package Promotion API offer a simple mechanism for querying the status of promoted packages and promoting packages between feeds.

This API endpoint should be used instead of the Native API Methods when possible, as they are much easier to use and will likely not change.

Data Specification

  • Package
  • Promotion
Property Format
packageName A string representing the name or ID of the package.
groupName A string representing the group of the package for Universal and Maven feeds and the scope of the package for npm feeds. This property is omitted for all other feed types.
packageType A string representing the feed type of the package, one of: upack, powershell, nuget, chocolatey, maven, npm, bower, or docker
version A string representing the version of the package.
promotions An array of Promotion objects representing a package promotion.
Property Format
fromFeed A string representing the name of the feed the promotion originated from.
toFeed A string representing the name of the feed the package was promoted to.
date A string representing the UTC date of the promotion in ISO 8601 format (yyyy-MM-ddThh:mm:ss).
user A string representing the user who promoted the package. Packages promoted via this API will by noted with SYSTEM as the user.
comments A string containing comments submitted when the promotion occurred.
id An integer representing a unique identifier of the promotion.

List Promotions Endpoint

GET /api/promotions/list?key=«api-key»&fromFeed=«feed-name»&toFeed=«feed-name»&groupName=«group-name»&packageName=«package-name»&version=«version»

Lists package promotions based on supplied parameters. This endpoint returns a status of 200 (on success), 400 (missing or incorrect parameters), 403 (invalid key).

On success, an array of Package objects will be returned, filtered by the specified parameters.

Promote Packages Endpoint

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.

  • JSON Request
  • URL-Encoded Request

POST /api/promotions 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"
}
  

POST /api/promotions 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