SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does any one knows how to get the document id after uploading it to sharepoint using a single web service? So by using one call i can upload the document and get it's id.

I looked at Copy.asmx web service, but it returns zero to indicate that the operation has been completed and a result that does not contain the document id.

Thank you for your time.

share|improve this question
up vote 2 down vote accepted

We can get the List Item ID or Document id based on Document url using SiteData webservice.

We can use SiteData.GetURLSegments method, by passing document url and then we can retrive the List ID, WebId and Document id.

For ref,

share|improve this answer
Ok. But i will need two web services calls. one to upload the document using Copy.asmx, and the other to get it's id using SiteData.asmx. Can i upload the document and get it's id with one service call? – user3470 Aug 22 '11 at 7:23
no as far as I know, you can not achieve this with one service call – GillouX Aug 22 '11 at 7:48
No, we can't achieve the requirement with single web service call. Copy service especially for uploading document, so we can't get the document id from this web service. So we have to go for another webservice. – Shantha Kumar Thambidurai Aug 22 '11 at 8:15

do you try to make a EventHandler? you can save the document id on a new column created by yourself, I don't understand so much the question but I think can be useful for you... greetings!


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.