title: How to get a list of Service Endpoints using REST API for TFS 2015 on prem instance?
body: <p>I am using the REST based API for the TFS 2015 to get list of Service Endpoints (as per the <a href="https://www.visualstudio.com/it-it/docs/integrate/api/endpoints/endpoints" rel="nofollow noreferrer">reference</a>). But facing an issue while extracting the information.</p>
  
  <p>We have an on prem instance of TFS 2015 (Version 14.102.25423.0). Below is the URL I am trying to get the list of service endpoints.</p>
  
  <p><a href="https://tfs-on-prem-instance/DefaultCollection/product-name/_apis/distributedtask/serviceendpoints?api-version=3.0-preview.1" rel="nofollow noreferrer">https://tfs-on-prem-instance/DefaultCollection/product-name/_apis/distributedtask/serviceendpoints?api-version=3.0-preview.1</a></p>
  
  <p><strong>Error:</strong></p>
  
  <p><strong>In Browser</strong>  </p>
  
  <pre><code>{"count":1,"value":{"Message":"An error has occurred."}}
  </code></pre>
  
  <p><strong>In PowerShell</strong>  </p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>Could anyone let me know how can I fix this? Or refer me to some additional documentation to go through.</p>