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 votes
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
Community showcase
Published Wednesday in Jira Service Desk

What's new in Jira Service Desk Server: Introducing 4.0 & more - Feb 2019

Hello Atlassian Community!  I'm Teresa, the Product Marketing Manager   for Jira Service Desk Server at Atlassian. I'm excited to announce two exciting releases for Jira Service De...

28 views 0 0
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