Access REST webservices of Jiraatlassian-jira-6.0.4

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 Unauthorized
Server: Apache-Coyote/1.1
X-AREQUESTID: 740x67x1
X-Seraph-LoginReason: AUTHENTICATED_FAILED
WWW-Authenticate: OAuth realm="http%3A%2F%2Flocalhost%3A8080%2Fjira"
X-Content-Type-Options: nosniff
Set-Cookie: JSESSIONID=8AE7F9970D44E97C37B8A90BF941F873; Path=/jira/; HttpOnly
Content-Type: text/html;charset=UTF-8
Content-Length: 3752
Date: 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>&quot;401 - Unauthorized&quot;</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

1 answer

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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

691 views 6 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you