To call a REST API from your extension, get the client service first, and then use that to call the API.

Client services

You can find the full list of available REST clients and their references here.

Call an API

  1. Get the REST client. In this case, we're getting the work item tracking client.

    VSS.require(["VSS/Service", "TFS/WorkItemTracking/RestClient"], function (VSS_Service, TFS_Wit_WebApi) {
        // Get the REST client
        var witClient = VSS_Service.getCollectionClient(TFS_Wit_WebApi.WorkItemTrackingHttpClient);
        // ...
  2. Call the API, getWorkItems, using the client service, witClient, with a callback that handles results.

    witClient.getWorkItems(/* some work item IDs */ [1,2,3,4], ["System.Title"]).then(
        function(workItems) {

Try this next

Display the results of your REST API call in a Grid.