retrieving rational team concert work items via REST api
Hi,
I'm trying to retrieve rational team concert work items via REST api and curl.
I can login successfully with these two statements:
curl -k -c $COOKIES https://rtp-rtc14.tivlab.raleigh.ibm.com:9443/jazz/authenticated/identity
curl -k -L -b $COOKIES -c $COOKIES -d j_username=$USER -d j_password=$PWD https://rtp-rtc14.tivlab.raleigh.ibm.com:9443/jazz/authenticated/j_security_check
# I get a simple query url with this statement:
curl -k -b $COOKIES https://rtp-rtc14.tivlab.raleigh.ibm.com:9443/jazz/oslc/contexts/_OtsvcBWvEeOYac7sZ6RSdw/workitems/services.xml
However, when I issue the following simple query to get the work items:
curl -k -b $COOKIES https://rtp-rtc14.tivlab.raleigh.ibm.com:9443/jazz/oslc/contexts/_OtsvcBWvEeOYac7sZ6RSdw/workitems
I get no work items. This is returned:
{
"userId": "iscipdev@us.ibm.com",
"roles": [
"JazzGuests"]
}
Can someone tell me what I'm doing wrong? Thanks
Accepted answer
Not sure why you got such response for the last URL, as it should output nothing in the console. To understand what's going on, use "-v" to show more information. The last URL normally returns a HTTP 302 with a location link, and you should use "-L" to tell cURL to redirect to that link. This post should help you.
https://jazz.net/forum/questions/168979/rest-api-curl-to-query-and-create-workitem-rtc
https://jazz.net/forum/questions/168979/rest-api-curl-to-query-and-create-workitem-rtc