I am trying to use the REST API of TFS 2018 to install an extension on our server with the help of cURL. This process must be repeated everyday, and that's why I'd like to run it using a command with cURL.
So far I figured out how to get a list of all the installed extensions on the server with the following command. This tells me the connection and the authentication work well.
curl -u {username}:{PAT} -d "" -X GET http://{instance}/{collection}/_apis/extensionmanagement/installedextensions?api-version=4.1-preview.1
To install the extension I have read this info from microsoft doc: https://docs.microsoft.com/en-us/rest/api/azure/devops/extensionmanagement/installed%20extensions/install%20extension%20by%20name?view=vsts-rest-tfs-4.1
I try formulate a command to install an extension I found here:https://marketplace.visualstudio.com/items?itemName=benjhuser.tfs-extensions-build-tasks.
The command is:
curl -u {username}:{PAT} -H "Content-Type: application/json" -X POST http://{instance}/{collection}/_apis/extensionmanagement/installedextensionsbyname/benjhuser/tfs-extensions-build-tasks/3.0.14?api-version=4.1-preview.1
I think the publisher, id and version of the extension should be correct, because I took them from this release document: https://github.com/huserben/TfsExtensions/blob/master/BuildTasks/vss-extension.json.
The response says the extension doesn't exist. This is confusing. Could someone please give me some hints, what the problem can be? Thank you in advance.
{
"$id": "1",
"innerException": null,
"message": "The requested extension 'benjhuser.tfs-extensions-build-tasks' doesn't exist.",
"typeName": "Microsoft.VisualStudio.Services.Gallery.WebApi.ExtensionDoesNotExistException, Microsoft.VisualStudio.Services.Gallery.WebApi",
"typeKey": "ExtensionDoesNotExistException",
"errorCode": 0,
"eventId": 3000
}



