Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API: difference between curl and browser query

ian feldberg May 10, 2018

I am trying to get the watchers array out of a ticket using the Jira REST API. When I do the GET in a web browser I get the full watches element with the watchers array filled in. If I use curl I get the watches element but the watchers array is always []. Why would I get different results? BTW, I'm not providing an "expand" argument, just a straight URL like:

    https://whatever.com/jira/rest/api/2/issue/PROJ-1234/watchers

Also, the same is true for an issue's votes and transitions.

2 answers

0 votes
ian feldberg May 11, 2018

It's:

curl -s --cookie-jar cookie.jar --cert servercert.pem --cacert certchain.crt -L https://my.jira.host/jira/rest/api/2/issue/PROJ-1234/watchers

 

Now I'm wondering if it has something to do with the cert. With curl I use the server cert that identifies my project. But in the browser, I'm using my own personal PKI cert. They both work but is it possible that one would return watchers and the other wouldn't? That sounds like a weird side effect.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2018

I think there is a problem with authentication. 

ian feldberg May 11, 2018

I think you're right but why would I get similar results getting the issue from the REST API but not for an issue's watchers, votes or transition?

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 10, 2018

what is your curl command?

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2018

I think there is a problem with authentication. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events