7

I'm trying to follow the Java example on GitHub for using the RallyRestApi in java. The first line of code creates a RallyRestApi object using two parameters. The first is the server, but I cannot figure out how to generate an 'apiKey'. Can someone share how this is done?

Here is the example I'm following https://github.com/RallyTools/RallyRestToolkitForJava/wiki/User-Guide

Shevliaskovic
  • 1,562
  • 4
  • 26
  • 43
Bill Spens
  • 73
  • 1
  • 4
  • 7
    "#Using api keys? -- currently rally1 only Go to https://rally1.rallydev.com/login You can generate an api key on this site and use it *instead* of username and password" as seen in https://github.com/RallyTools/RallyRestToolkitForRuby, must work both languages – G.Mendes Jul 14 '14 at 21:49
  • @G.Mendes Welcome to the StackExchange network. Here we post answers as, erm, answers. Comments are great for clarifying questions but a question/answer page should be useful without any of the comments. I'll gladly delete my answer if you post yours instead. – djeikyb Dec 10 '14 at 04:53

3 Answers3

12

Go to https://rally1.rallydev.com/login. You can generate api keys there. It'd be awesome if they noted that in their getting started guides.

djeikyb
  • 4,470
  • 3
  • 35
  • 42
1

The comment in the original question above should be the accepted answer. For what it's worth however there is still a constructor which takes server, username, password as well (although this is considered deprecated in favor of the api key approach)

//preferred
RallyRestApi api = new RallyRestApi(new URI("https://rally1.rallydev.com", "myAPIKey");

//deprecated, but still possible
RallyRestApi api = new RallyRestApi(new URI("https://rally1.rallydev.com", "username", "password");
Kyle Morse
  • 8,390
  • 2
  • 15
  • 16
  • Agree, the comment on the original post is the right answer, but comments cannot be marked as answers. I used the deprecated method until I got the link from G.Mendes's comment. – Bill Spens Jul 28 '14 at 00:15
0
RallyRestApi restApi = new RallyRestApi();
restApi.AuthenticateWithApiKey("Your Key", "https://rally1.rallydev.com", null);

The above is how to use the API key using C#. It's probably very similar for Java. (The null is a proxy, adjust for your needs).

Jack
  • 506
  • 4
  • 4