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!!!
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI'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!!!
I was Solved My problem.you have to follow this steps
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
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