I'm currently working on a project where I need to POST git tags using the TFS Rest API. I am limited to using the API version 2.0, which has no documentation for how I can POST a tag, however the functionality must be there as the response code does not indicate that a POST is not possible. My request looks something like this.
POST {root_url}/DefaultCollection/{project}/_apis/git/repositories/{repository}/refs?api-version=2.0"
{
"name": "refs/tags/test",
"objectId": "{commitId}"
}
The error that I get is as follows:
{ "$id":"1","innerException":null,"message":"Value cannot be null.\r\nParameter name: refUpdates","typeName":"System.Argu mentNullException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","typeKey":"ArgumentNullE xception","errorCode":0,"eventId":0} The remote server returned an error: (400) Bad Request.
I'm not too sure if it's even possible to POST a tag but given the error it should be. Does anyone know how to create a tag using POST or know where I can find documentation for it?