From the linux/mac command line (bash):
curl -D- -u myUsername:myPassword -X PUT --data '{"update":{"labels":[{"add":"testlabel2"}]}}' -H "Content-Type: application/json" https://mycompany.jira.com/rest/api/latest/issue/CRE-97/editmeta
Using cloud-based jira, which reports to be version 7.0.0. I'm new to using the API; I can do this operation flawlessly if I use the interface, so I know my account is setup correctly from a permission perspective.
I get:
HTTP/1.1 405 Method Not Allowed
Server: nginx
Date: Mon, 26 Oct 2015 22:06:26 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 1056
Connection: keep-alive
X-AREQUESTID: 1086x8384x1
X-ASEN: SEN-2452839
Set-Cookie: JSESSIONID=A689FB2882891B0186DFD591CED47FED; Path=/; Secure; HttpOnly
Set-Cookie: studio.crowd.tokenkey=""; Domain=.mycompany.jira.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly
X-Seraph-LoginReason: OUT
Set-Cookie: studio.crowd.tokenkey=hx9RCkR0jbCsMyOB5muQYw00; Domain=.mycompany.jira.com; Path=/; Secure; HttpOnly
X-Seraph-LoginReason: OK
Set-Cookie: atlassian.xsrf.token=AG87-S37R-QM8W-6VWE|2600c6fd212118a9db13c77376f47a6459e39193|lin; Path=/; Secure
X-ASESSIONID: 12byeuf
X-AUSERNAME: myUsername
X-ATENANT-ID: mycompany.jira.com
Allow: HEAD,GET,OPTIONS
X-Content-Type-Options: nosniff
Content-Language: en
What am I doing wrong?
According to the examples here:
the path in your URL is wrong
The complete curl line that should work is:
curl -D- -u myUsername:myPassword -X PUT --data '{"update":{"labels":[{"add":"testlabel2"}]}}' -H "Content-Type: application/json" https://mycompany.jira.com/rest/api/latest/issue/CRE-97
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.