Fisheye rest API 'queryasrows' not working with curl Edited

Hi Team,

I was trying to run the API using command line, but it is giving error

HTTP/1.1 400 Bad Request

 

curl  -g --insecure -D- -u xxx:xxx -X GET --data @get.txt  -H "Content-Type: application/xml"  "https://<host-url>/rest-service-fe/search-v1/queryAsRows/<repo>?query=select revisions where (not in any review and date in [2017-03-16,2017-03-22]) group by changeset return path, revision, csid, author, comment, reviews"

Though, the link is working on browser

https://<host-url>/rest-service-fe/search-v1/queryAsRows/<repo>?query=select revisions where (not in any review and date in [2017-03-16,2017-03-22]) group by changeset return path, revision, csid, author, comment, reviews


This is bit urgent. Please help me with the resolution or where am I doing it wrong ?


Thanks,
Gunjan Roy

1 answer

0 vote
Jeff Thomas Atlassian Team Apr 20, 2017

Hi Gunjan,

Can you try the following?

curl -g --insecure -D -u xxx:xxx -X GET -H "Content-Type: application/xml" "https://<host-url>/rest-service-fe/search-v1/queryAsRows/<repo>?query=select%20revisions%20where%20(not%20in%20any%20review%20and%20date%20in%20%5B2017-03-16%2C2017-03-22%5D)%20group%20by%20changeset%20return%20path%2C%20revision%2C%20csid%2C%20author%2C%20comment%2C%20reviews"

I made a few changes such as URL encoding the query string and removing the get.txt that was being sent. What is contained in get.txt? You shouldn't need to send any data via a file in this scenario.

Cheers,
Jeff

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 Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

90 views 0 5
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