Hi
I am trying to follow this documentation - https://confluence.atlassian.com/display/JIRA043/JIRA+REST+API+(Alpha)+Tutorial I am at this step -
curl -c cookie_jar -H "Content-Type: application/json" -d '{"username" : "admin", "password" : "admin"}' http://localhost:8090/jira/rest/auth/latest/session
When I do this with my on demand instance, where I replace localhost:8090 with our on demand url, and the username and password with my own. I get this
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
Community moderators have prevented the ability to post new answers.
You're welcome! Could you try something like this:
curl -D- -u username:password -H "Content-Type: application/json" 'https://company.atlassian.net/rest/api/latest/issue/issue-#'
I've tested it here and it works as expected.
Marlon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you try example.atlassian.net/rest/api/2/issue/ ? The URL for the API on the latest OnDemand version is a little different than version 4.3.
Just for reference, the full documentation for the latest REST API can be found on this link: https://developer.atlassian.com/static/rest/jira/5.2.11.html
This document also has examples of the latest REST API: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+APIs
Hope this information helps!
Regards,
Marlon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, I am getting the same error. Should I set something on the JIRA admin side to make this work?
I just tried https://url/rest/api/latest/issue/PROJ-100 and got this error
</head><body><h1>HTTP Status 405 - Method Not Allowed</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Method Not Allowed</u></p><p><b>description</b> <u>The specified HTTP method is not allowed for the requested resource (Method Not Allowed).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.32</h3></body></html>%
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the full curl line you are using? It could also be that Remote API Calls are disabled in your instance, to check that go to example.atlassian.net/secure/admin/EditApplicationProperties!default.jspa and check for Accept remote API calls under Options.
Let me know how it goes.
Marlon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Accept remote API calls is on. The full curl line is this -
curl -c cookie_jar -H "Content-Type: application/json" -d '{"username" ":"username", "password" :"password"}' "https://company.atlassian.net/rest/api/latest/issue/CYEY-1240"
Full error is below -
<html><head><title>Apache Tomcat/6.0.32 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 405 - Method Not Allowed</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Method Not Allowed</u></p><p><b>description</b> <u>The specified HTTP method is not allowed for the requested resource (Method Not Allowed).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.32</h3></body></html>%
p.s - Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.