AnsweredAssumed Answered

How to pass API Key in REST URL in javascript?

Question asked by kurmcbride on May 7, 2018
Latest reply on May 8, 2018 by Sagi_Gabay

I am trying to call Rally REST API from javascript and getting a 401 error.  I have tried to pass the API Key in a number of different ways to the Rally API without success.  Below is my latest javascript.  Any ideas how to successfully pass my API Key to the Rally REST API?

 

myConnector.getData = function(table, doneCallback) {

 

           $.getJSON("https://rally1.rallydev.com/slm/webservice/v2.0/defect?apiKey=_<my key>&project=https://rally1.rallydev.com/slm/webservice/v2.0/project/47361246342&pagesize=2&projectScopeUp=false&fetch=FormattedID,Name", function(resp) {

               var data = resp.QueryResult[0].Results;

               console.log(data);

               var tableData = [];

               for(var i=0;i<data.length;i++) {

                   tableData.push({

                       'FormattedID': data[i].FormattedID,

                       'Name': data[i].Name

                   });

               }

               table.appendRows(tableData);

               doneCallback()

Outcomes