You need to sign in to do that
Don't have an account?

Accessing "Rally" Rest service from Apex
I am new to using Rest services .I am trying to access Rally rest service (https://rally1.rallydev.com/slm/doc/webservice/) , i tried using :
HttpRequest req = new HttpRequest();
req.setEndpoint('https://rally1.rallydev.com/slm/webservice/v2.0/task.js');
req.setMethod('GET');
// Specify the required user name and password to access the endpoint
// As well as the header and header information
String username = 'myname';
String password = 'mypwd';
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
// Create a new http object to send the request object
// A response object is generated as a result of the request
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
But it didnt work , i go a 401 response code back.
How do i get the security token and use it in my queries ? Has anyone integrated with Rally using Apex ?
HttpRequest req = new HttpRequest();
req.setEndpoint('https://rally1.rallydev.com/slm/webservice/v2.0/task.js');
req.setMethod('GET');
// Specify the required user name and password to access the endpoint
// As well as the header and header information
String username = 'myname';
String password = 'mypwd';
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
// Create a new http object to send the request object
// A response object is generated as a result of the request
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
But it didnt work , i go a 401 response code back.
How do i get the security token and use it in my queries ? Has anyone integrated with Rally using Apex ?
String authorizationHeader = 'BASIC ' +
to
String authorizationHeader = 'Basic ' +
It will work.
All Answers
http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#CSHID=errorcodes.htm|StartTopic=Content%2Ferrorcodes.htm|SkinName=webhelp
Please check that you have correct username and password.
Try that going to the endpoint using your browser and put your username and pwd in it.
String authorizationHeader = 'BASIC ' +
to
String authorizationHeader = 'Basic ' +
It will work.