Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Asset Directory API

view on GitHub

The Asset Directory API provides several pgutil commands (available as pgutil assets) and HTTP endpoints to query, download, publish, delete, and perform other operations on files and folders in an asset directory. All HTTP requests are made through the following base URL:

Asset Directories are represented internally in ProGet as Feeds, so Feed API keys can be used to authenticate to Asset Directories.

pgutil Commands

All HTTP endpoints of the The Asset Directory API are available as pgutil commands.

To find the list of commands available in pgutil, simply run pgutil assets. See Getting started with pgutil to learn more.

Available HTTP Endpoints

The Asset Directory API is comprised of endpoints for both files and folders:

📄 File Management

For directly managing the files located in the asset directory. They are designed to function like a standard web server, so hosted files can be accessed by simple GET requests with support for browser caching.

📁 Folder Management

For managing the folders located in the asset directory.

🔖 Metadata Management

Allow for reading or updating metadata on a file or folder. Added in ProGet v6.0.0.

Authenticating to Asset Directory API

The following is a summary of access types and their corresponding requirements for various API keys types and endpoints within this API.

Access Type Requirements
System API Keys Use/Manage Feeds
Feed API Keys View/Download is required for all endpoints
Add/Repackage is required for uploading/importing
Overwrite/Delete is required for deletion
Personal API Key Feeds_ViewFeed is required for all endpoints
Feeds_AddPackage is required for uploading/importing
Feeds_DeletePackage is required for deletion
No API Key anonymous or authenticated user must have at least Feeds_ViewFeed

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

Data Specifications

AssetDirectoryItem Object Attributes

AssetDirectoryItem is a JSON object (see AssetDirectoryItem.cs) that corresponds to the properties an "item" (either a file or folder) within the Asset Directory. It's used as output data for List Asset Folder and Get Asset Metadata.

JSON Object Example:

{
  "name": "example.txt",
  "parent": "/documents",
  "type": "text/plain",
  "content": "https://proget.corp.local/endpoints/myAssetDirectory/content/documents/example.txt",
  "created": "2023-11-29T09:45:00",
  "modified": "2023-11-29T10:30:00",
  "size": 1024,
  "sha1": "a1b2c3d4e5f6g7h8i9j0"
}

AssetItemMetadataUpdate Object Attributes

AssetItemMetadataUpdate is a JSON object (see AssetItemMetadataUpdate.cs) that correspond to the fields in a metadata update. It's used as input data for Set Asset Metadata

JSON Object Example

{
  "type": "application/json",
  "userMetadata": 
        {
         userMetadata // userMetaData Object
        },
  "userMetadataUpdateMode": "update",
  "cacheHeader": 
      {
        "type": "TTL",
        "value": 60
      }
}