Question

Ankushthemaster on Tue, 08 Nov 2016 18:48:09



I am using the REST based API for the VSTS to get the list of Service Endpoints as mentioned under docs "https://www.visualstudio.com/it-it/docs/integrate/api/endpoints/endpoints". We have an on prem instance of TFS 2015. Below is the URL I am trying to get the list of service endpoints.

URL:  https://<tfs on prem instance>/DefaultCollection/<product name>/_apis/distributedtask/serviceendpoints?api-version=3.0-preview.1

Below is the error I am getting.

Browser: {"count":1,"value":{"Message":"An error has occurred."}}

In PowerShell:Invoke-RestMethod : {"count":1,"value":{"Message":"An error has occurred."}} At D:\DevOps\TFS\TFSServiceModule.psm1:75 char:23 + ... $result = Invoke-RestMethod -Method Get -Uri $uri -Credential $Cred ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpW ebRequest) [Invoke-RestMethod], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell .Commands.InvokeRestMethodCommand

I am not sure what is the reason of the error. Could someone help me here.


Sponsored



Replies

Sheethal J S on Wed, 09 Nov 2016 10:09:48


Hello,

We are checking on the query and would get back to you soon on this.

Apologize for the inconvenience and appreciate your time and patience in this matter.

Regards,



Sheethal J S on Thu, 10 Nov 2016 10:55:13


Hi,

Greetings,

I would request to check the URL for on-Prem  TFS and let us know the feedback so that we can assist you more on your query.

it should be:

https://tfsserver/tfs/defaultcollection  (it can be http or https depends on server configuration)

Hope this Helps!

Regards,

_______________________________________________________________________________________________________

If a post answers your question, please click Mark as Answer on that post and Vote as Helpful.

Ankushthemaster on Thu, 10 Nov 2016 13:53:22


I think the URL is correct because I am able to call other REST API like get the list of build/release definition/agent queues, create release definition.

The part of the URL I am not sure about is after DefaultCollection /<product name>/_apis/distributedtask/serviceendpoints?api-version=3.0-preview.1

Even I am able to call the API for getting the list of Service Endpoints types. But the above seems to have some issue.

Ankushthemaster on Wed, 16 Nov 2016 15:46:05


Any update?

Sheethal J S on Tue, 06 Dec 2016 07:21:16


Hello,

Apologies for the delay in response and thank you for your patience while I was checking with the specialist here.

As per the update it didn’t get worked in TFS2015 on premise as well. But they work against TFS2017.

That REST APIs is introduced in 3.0-preview.1 which is most probably not there in TFS2015.

Let us know the feedback so that we can assist you more on query.

Hope this helps!

Regards,

_______________________________________________________________________________________________________

If a post answers your question, please click Mark as Answer on that post and Vote as Helpful.

 

Ankushthemaster on Mon, 09 Jan 2017 21:30:53


Thanks. But I made it to work just by replacing PRODUCT NAME with PRODUCT ID.

Sheethal J S on Tue, 10 Jan 2017 03:49:18


Hello,

Greetings,

Please Mark the helpful response as “Mark as Answer” so that it will be helpful for others.

Regards,