Package Promotion (Query) API
  • 30 Oct 2021
  • 2 Minutes to read
  • Dark
  • PDF

Package Promotion (Query) API

  • Dark
  • PDF

The Query Package Promotions API can help you build CI/CD workflows by querying the status of Package Promotions in ProGet.

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

Returns a JSON array of Promoted Package objects, optionally filtered by querystring parameters.

Security & API Keys

An API Key is not required to query package promotions.

When an API Key isn't specified, and the Anonymous user doesn't have "Feeds: View Feed" access, then a 401 authentication challenge will be issued. Otherwise, only the promotions the Anonymous user has access to view will be displayed.

To specify an API Key, use the request header (X-ApiKey), querystring (key), orapi:«api-key» as the username. See API Key Usage to learn more.

Access Type Requirements
System API Keys Use/Manage Feeds Permission
Feed API Keys Promote Permission
Personal API Key associated user must have Feeds: View Feed
No API Key anonymous or authenticated user must have Feeds: View Feed

Endpoint Specification

Returns a JSON array of Promoted Package objects, optionally filtered by querystring parameters.

GET /api/promotions/list

Input Parameters (Querystring filter)

You may filter the results by specifying one or more Querystring parameters:

  • fromFeed
  • toFeed
  • groupName
  • packageName
  • version

Output Status Code

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

Data Specification

This endpoint returns Promoted Package objects, which contain basic information about each package and an array of one of more Promotion objects.

Promoted Package Object Properties (JSON)

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. In ProGet 5.0.9 and later, you can specify latest or latest-stable for the version property. This will then promote the latest or latest non-prerelease version of the package.
promotions An array of Promotion objects representing a package promotion.

Promotion Object Properties (JSON)

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.

Was this article helpful?

What's Next