MicrosoftDocs / vsts-rest-api-specs

MIT License
164 stars 116 forks source link

Name for feedId doesn't work, and how to get feedId? #714

Open dylanw-oss opened 1 month ago

dylanw-oss commented 1 month ago

The document says that we can use Name for feedId in a rest call to get package version, but it does not work.

Name In Required Type Description
feedId path True string Name or ID of the feed.

I got this error: { "$id": "1", "innerException": null, "message": "The feed with ID 'CoreData' doesn't exist.", "typeName": "Microsoft.VisualStudio.Services.Feed.WebApi.FeedIdNotFoundException, Microsoft.VisualStudio.Services.Feed.WebApi", "typeKey": "FeedIdNotFoundException", "errorCode": 0, "eventId": 3000 }

BTW, how to get feedId? I struggled to find a solution to find feed's Id.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

dylanw-oss commented 1 month ago

I figured it out that there're two types of feed, project level and organization level, to get a package version from an organization level feed, the URL is different, should remove project from the URL, like this:

GET https://pkgs.dev.azure.com/{organization}/_apis/packaging/feeds/{feedId}/nuget/packages/{packageName}/versions/{packageVersion}?api-version=7.1-preview.1

Can you update all Artifacts Package API documents to make it clear that {project} is optional and should be removed if feed is organization level.

Name In Required Type Description
project path   string Project ID or project name (remove it from URL if feed is organization level)
-- -- -- -- --