It's all about the answers!

Ask a question

How to get ID of a work item which was just created by USING RESTI API?


jane zhou (1061068) | asked Jan 02 '18, 1:28 p.m.

 

Hi Someone who may concern,

     We are working on using REST API to create a new work item. And we need to know the id of this work item after the work item is created, and use it to update our patch commit information.
     However, we noticed there is no ID information in the response xml we got from RTC after creating work item. It only indicated the work item is created successfully.

     We are wondering how can we get that?

      Thanks!

Best Regards,
Jane Zhou

One answer



permanent link
Donald Nong (14.5k614) | answered Jan 02 '18, 7:40 p.m.

In most cases, when a creation operation (POST) is successful, and you get an HTTP 201 code, the response header "Content-Location" contains the URI or ID of the new resource.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.