NuGet

Last Update: 12/8/2016

api-version = 3.0-preview.1

This API in preview. Learn more

Get package info

GET https://{account}.pkgs.visualstudio.com/DefaultCollection/_apis/packaging/feeds/{feedName}/nuget/packages/{packageName}/versions/{packageVersion}?api-version={api-version}&showDeleted={showDeleted}
Parameter Type Default Notes
URL
account string Visual Studio Team Services account
feedName string Name or ID of the feed
packageName string Normalized Name or ID of the package
packageVersion string Version of the package or Version ID
showDeleted bool false Set to true to return metadata for packages that have been deleted
api-version string Version of the API to use

Sample request

GET https://contoso.pkgs.visualstudio.com/DefaultCollection/_apis/packaging/feeds/fabrikam/nuget/packages/bootstrap/versions/3.3.6/?api-version=3.0-preview

Sample response

Status code: 200
{
  "id": "nuget_bootstrap",
  "name": "bootstrap",
  "version": "3.3.6",
  "deletedDate": null
}

Unlist/Relist package

PATCH https://{account}.pkgs.visualstudio.com/DefaultCollection/_apis/packaging/feeds/{feedName}/nuget/packages/{packageName}/versions/{packageVersion}?api-version={api-version}
Content-Type: application/json
{
    "listed": false
}
Parameter Type Default Notes
URL
account string Visual Studio Team Services account
feedName string Name or ID of the feed
packageName string Normalized name or ID of the package
packageVersion string Version or version ID of the package
api-version string Version of the API to use
Body
listed boolean Set to true for relist and false for unlist

Sample request

PATCH https://contoso.pkgs.visualstudio.com/DefaultCollection/_apis/packaging/feeds/fabrikam/nuget/packages/bootstrap/versions/3.3.6/?api-version=3.0-preview
Content-Type: application/json
{
  "listed": "false"
}

Sample response

Status code: 202

Delete package

DELETE https://{account}.pkgs.visualstudio.com/DefaultCollection/_apis/packaging/feeds/{feedName}/nuget/packages/{packageName}/versions/{packageVersion}?api-version={api-version}
Parameter Type Default Notes
URL
account string Visual Studio Team Services account
feedName string Name or ID of the feed
packageName string Normalized name or ID of the package
packageVersion string Version or version ID of the package
api-version string Version of the API to use

Sample request

DELETE https://contoso.pkgs.visualstudio.com/DefaultCollection/_apis/packaging/feeds/fabrikam/nuget/packages/bootstrap/versions/3.3.6/?api-version=3.0-preview

Sample response

Status code: 202
{
  "id": "nuget_bootstrap",
  "name": "bootstrap",
  "version": "3.3.6",
  "deletedDate": "2016-11-01T20:46:13.7973563Z"
}

Download Package

This endpoint is not intended for programmatic usage or bulk downloads. The service will throttle when excessive use is detected.

GET https://{account}.pkgs.visualstudio.com/defaultcollection/_apis/packaging/feeds/{feedname}/nuget/packages/{packagename}/versions/{packageversion}/content?api-version={api-version}
Parameter Type Notes
URL
account string Visual Studio Team Services account.
feedname string Name or Id of the feed
packageName string Normalized Name or ID of the package
packageversion string Version of the package or Version ID
api-version string Version of the API to use.

Response

Status code: 200

Response is binary

Release Package

PATCH https://{account}.pkgs.VisualStudio.com/DefaultCollection/_apis/packaging/feeds/{feedName}/nuget/packages/{packageName}/versions/{packageVersion}?api-version={api-version}
Content-Type: application/json
{
    "views": { "op":"add", "path":"/views/-", "value":"release" }
}
Parameter Type Default Notes
URL
account string Visual Studio Team Services account
feedName string Name or ID of the feed
packageName string Normalized name or ID of the package
packageVersion string Version or version ID of the package
api-version string Version of the API to use
Body
views string JSON patch object

Sample request

PATCH https://contoso.pkgs.visualstudio.com/DefaultCollection/_apis/packaging/feeds/fabrikam/nuget/packages/bootstrap/versions/3.3.6/?api-version=3.0-preview
Content-Type: application/json
{
  "views": {
    "op": "add",
    "path": "/views/-",
    "value": "release"
  }
}

Sample response

Status code: 202