<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: Accessing Spira test using rest web services in java (Thread)</title><description>Hi All,    I am new to Spira test and its API. Can anyone help me with a sample java code which authenticates and does request and response using the Spira API.     Also I am trying to do a maven repository set up, please provide me dependency if any.     Thanks, Manoj </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spirateam/issues-questions/1620.aspx</link><item><guid isPermaLink="false">threadId=1620</guid><author>Manoj Singh (manoj.singh7@tcs.com)</author><category domain="http://www.inflectra.com/kronodesk/thread/tag">java rest web services spira api</category><title>Accessing Spira test using rest web services in java</title><description>Hi All,    I am new to Spira test and its API. Can anyone help me with a sample java code which authenticates and does request and response using the Spira API.     Also I am trying to do a maven repository set up, please provide me dependency if any.     Thanks, Manoj </description><pubDate>Thu, 16 Feb 2017 06:54:32 -0500</pubDate><a10:updated>2017-02-20T10:40:51-05:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/1620.aspx</link></item><item><guid isPermaLink="false">messageId=2915</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> Hi Manoj  Please try this out:   https://www.inflectra.com/Support/KnowledgeBase/KB49.aspx   Regard</title><description> Hi Manoj  Please try this out:   https://www.inflectra.com/Support/KnowledgeBase/KB49.aspx   Regards  Adam </description><pubDate>Fri, 17 Feb 2017 17:32:27 -0500</pubDate><a10:updated>2017-02-17T17:32:27-05:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/1620.aspx#reply2915</link></item><item><guid isPermaLink="false">messageId=2917</guid><author>Manoj Singh (manoj.singh7@tcs.com)</author><title> Hi Adam,  I am going through this example. But this example uses SOAP services. However i am lookin</title><description> Hi Adam,  I am going through this example. But this example uses SOAP services. However i am looking for rest api which i am able to connect through java code.      public final String BASE_URL = http://api.inflectra.com/Spira/Services/v4_0/RestService.svc     public final String USER_NAME =      public final String API_KEY=            public static void main( String[] args )     {         try         {             ClientConfig clientConfig = new DefaultClientConfig();             Client client = Client.create(clientConfig);                          WebResource resource = client.resource(BASE_URL); //            resource.header(username, USER_NAME); //            resource.header(api-key, API_KEY);             resource.queryParam(username, USER_NAME);             resource.queryParam(api-key, API_KEY);                          ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);                          System.out.println(response.getStatus());         }         catch (Exception e)         {             e.printStackTrace();         }     this is my sample code for connecting spira rest url. i am getting exception as fallows  com.sun.jersey.api.client.ClientHandlerException: java.net.UnknownHostException: api.inflectra.com     at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:155)     at com.sun.jersey.api.client.Client.handle(Client.java:652)     at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)     at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)     at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:509)     at com.iDRT.controller.SpiraConnection.main(SpiraConnection.java:34) Caused by: java.net.UnknownHostException: api.inflectra.com     at java.net.AbstractPlainSocketImpl.connect(Unknown Source)     at java.net.PlainSocketImpl.connect(Unknown Source)     at java.net.SocksSocketImpl.connect(Unknown Source)     at java.net.Socket.connect(Unknown Source)     at java.net.Socket.connect(Unknown Source)     at sun.net.NetworkClient.doConnect(Unknown Source)     at sun.net.www.http.HttpClient.openServer(Unknown Source)     at sun.net.www.http.HttpClient.openServer(Unknown Source)     at sun.net.www.http.HttpClient. (Unknown Source)     at sun.net.www.http.HttpClient.New(Unknown Source)     at sun.net.www.http.HttpClient.New(Unknown Source)     at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)     at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)     at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)     at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)     at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)     at java.net.HttpURLConnection.getResponseCode(Unknown Source)     at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:253)     at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:153)     ... 5 more       </description><pubDate>Mon, 20 Feb 2017 10:40:50 -0500</pubDate><a10:updated>2017-02-20T10:40:50-05:00</a10:updated><link>/Support/Forum/spirateam/issues-questions/1620.aspx#reply2917</link></item></channel></rss>