API Endpoints & Methods
  • 19 Apr 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

API Endpoints & Methods

  • Dark
    Light
  • PDF

Article Summary

🚧 Documentation in Progress 🚧

We're still working on finishing up the documentation for ProGet 2024 and this article is on our TODO list. It's pretty rough outline/draft, but we figured it'd be better than nothing.

ProGet provides a variety of API methods and endpoints to upload/download packages, manage feeds, audit package compliance, assess vulnerabilities, etc.

The easiest way to work with the ProGet API is by using pgutil a cross-platform Command-line Interface (CLI) tool. You can also use HTTP Endpoints and the .NET library (NuGet package) that pgutil uses under-the-hood.

pgutil Command-line Interface

pgutil is an open-source (github.com), cross-platform command line tool that's easy to download and install.

🚀 Quick Installation Guide for pgutil

If you've already got dotnet installed, just run this command to install the tool locally.

dotnet tool install pgscan

You can also download stand-alone executable for Windows and Linux on the pgutil GitHub Releases page.

Once you've installed pgutil, you can simply type pgutil help to get a list of all of the commands and options available. You can also register sources so that you don't always have to specify urls, feeds, and API keys, etc.

🚀 Quick pgutil Example: Uploading a Package
pgutil packages upload --source=corpx-dev --input-file=Newtonsoft.Json.13.0.3.nupkg

See the Getting Started with pgutil guide to learn more.

HTTP Endpoints

TODO
  • talk about primary endpoints, feed endpoints, and native API
  • getting started
  • api keys?

API for Third-party Packages and Feed Types

To support third-party package formats such as NuGet, npm, etc., ProGet implements a number of third-party APIs. We provide only minimal documentation for these APIs, as they are usually either already documented elsewhere. However, you can usually find the basics by searching for specific things you want to do with the API, such as "how to search for packages using the NuGet API" or "how to publish an npm package using the API".

Native API

The ProGet Native API is a lower-level API that allows manipulation of most settings and data within ProGet outside the scope of third-party feeds. It should be avoided if another API is suitable, and is documented here: ProGet Native API Reference

.NET library (NuGet package

TODO
  • this is built in tandem with pgutil from same code base
  • mayb ea quick getting started or code example?
  • mention the best way to see how code is used is to go to pgutil code base?