Hi,
I have downloaded atlassian-jira-6.0.4 war file and confiured in my local machine. I am able to to access the jira application from my local. Now I am trying to access the REST web services provided by Jira to integrate the third party system. When I am trying to access the REST web services through CURL command I am getting the below error. How can we access the REST web servivces from our local environment.
curl -D- -u fred:fred -X GET -H "Content-Type: application/json" http://localhost:8080/jira/rest/api/2/search?jql=assignee=Madhavi
HTTP/1.1 401 UnauthorizedServer: Apache-Coyote/1.1X-AREQUESTID: 740x67x1X-Seraph-LoginReason: AUTHENTICATED_FAILEDWWW-Authenticate: OAuth realm="http%3A%2F%2Flocalhost%3A8080%2Fjira"X-Content-Type-Options: nosniffSet-Cookie: JSESSIONID=8AE7F9970D44E97C37B8A90BF941F873; Path=/jira/; HttpOnlyContent-Type: text/html;charset=UTF-8Content-Length: 3752Date: Thu, 01 Aug 2013 06:50:56 GMT
<html>
<head> <title>Unauthorized (401)</title>
<!--[if IE]><![endif]--><script type="text/javascript">var contextPath = '/jira';</script><link type="text/css" rel="stylesheet" href="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/1/_/download/superbatch/css/batch.css" media="all"><!--[if lte IE 8]><link type="text/css" rel="stylesheet" href="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/1/_/download/superbatch/css/batch.css?conditionalComment=lte+IE+8" media="all"><![endif]--><!--[if lte IE 9]><link type="text/css" rel="stylesheet" href="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/1/_/download/superbatch/css/batch.css?conditionalComment=lte+IE+9" media="all"><![endif]--><link type="text/css" rel="stylesheet" href="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/b6bc95b518f283291f8fe8e036a0f516/_/download/contextbatch/css/atl.general,jira.global/batch.css" media="all"><!--[if lte IE 8]><link type="text/css" rel="stylesheet" href="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/b6bc95b518f283291f8fe8e036a0f516/_/download/contextbatch/css/atl.general,jira.global/batch.css?conditionalComment=lte+IE+8" media="all"><![endif]--><link type="text/css" rel="stylesheet" href="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/d57fa41e63a8eb00c4658102ca76a48a/_/download/contextbatch/css/jira.general/batch.css" media="all"><script type="text/javascript" src="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/1/_/download/superbatch/js/batch.js" ></script><!--[if lte IE 8]><script type="text/javascript" src="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/1/_/download/superbatch/js/batch.js?conditionalComment=lte+IE+8" ></script><![endif]--><script type="text/javascript" src="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/b6bc95b518f283291f8fe8e036a0f516/_/download/contextbatch/js/atl.general,jira.global/batch.js" ></script><script type="text/javascript" src="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/d57fa41e63a8eb00c4658102ca76a48a/_/download/contextbatch/js/jira.general/batch.js" ></script><script type="text/javascript" src="http://localhost:8080/s/en_USfh7p7c-1988229788/6100/3/1.3.1/_/download/batch/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources/com.atlassian.administration.atlassian-admin-quicksearch-jira:admin-quicksearch-webresources.js" ></script>
<script type="text/javascript" src="/jira/rest/api/1.0/shortcuts/6100/7e0f454e1875f682a6025d6b07ee0240/shortcuts.js"></script>
<meta name="application-name" content="JIRA" data-name="jira" data-version="6.0.4"></head><body id="jira" class="aui-layout aui-style-default page-type-message" data-version="6.0.4" > <div class="aui-page-panel"><div class="aui-page-panel-inner"> <section class="aui-page-panel-content"> <header class="aui-page-header"><div class="aui-page-header-inner"> <div class="aui-page-header-main"> <h1>Unauthorized (401)</h1> </div><!-- .aui-page-header-main --> </div><!-- .aui-page-header-inner --></header><!-- .aui-page-header --> <div class="aui-message warning"> <p>Encountered a <code>"401 - Unauthorized"</code> error while loading this page.</p> <p><a href="/jira/secure/MyJiraHome.jspa">Go to JIRA home</a></p> <span class="aui-icon icon-warning"></span></div> </section><!-- .aui-page-panel-content --> </div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></body></html>
Your help would be appreciated.
Thanks
Regards,
madhavi
you have to pass user name and password? did you passed those?
fre:fred is username and password given as example you have to change this.
like
curl -D- -u prasad:prasad -X GET -H "Content-Type: application/json" http://localhost:8080/jira/rest/api/2/search?jql=assignee=Madhavi
It looks like you're new here. Sign in or register to get started.