3

I'm working on Android app. I want To add List items in Particular SharePoint list using Rest API.

I can get list items from SharePoint using REST API. I don't know how to add list item in SharePoint list.

Any Help would be appreciated!!!

  • Are you looking for code or API reference? – SlackerAmit Feb 18 '16 at 6:15
  • @RohitWaghela I want to Add SharePoint List Items – Vishal Thakkar Feb 18 '16 at 7:07
  • Please refer this link, may be this could help you out - codeproject.com/Articles/990131/… – Rohit Waghela Feb 18 '16 at 7:07
  • @VishalHalani If you will go through above link, you will find all the CRUD operations there. There is also one example they have given for Adding New Item in SharePoint list. – Rohit Waghela Feb 18 '16 at 11:05
  • @RohitWaghela it was in JavaScript dear I want to do in Java.So how can I implement It? – Vishal Thakkar Feb 18 '16 at 12:20
0

I was Solved My problem.you have to follow this steps

  1. first you have to make HTTP request to get FormDigestValue using POST Method because its will not support GET Method. You can get this using below REST URL

    "https://YourSite.sharepoint.com/_api/contextinfo"

  2. Then you can make HTTP POST request for Add Data In SharePoint Particular List with below REST URL

    "https://YourSite.sharepoint.com/_api/lists/getbytitle('Your_List_Name')/items"

Main things is that you have to Pass FormDigestValue in this request as well your Value which you want to add in list in json format like below

{'__metadata':{'type':'SP.Data.Android_x005f_TasksListItem'},'Title':'" + titleValue + "','Age':'" + ageValue + "'}

In this json You have to replace type of List which i have written like this 'SP.Data.Android_x005f_TasksListItem'

you can get this list type with below REST URL just paste in browser or make web call.

your_sharepointsite/_api/lists/getbytitle('Your_List_Name')?$select=ListItemEntityTypeFullName

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.