CSOM Methods

Below are all the currently implemented methods for access the REST services of SharePoint. All of these methods return a promise.

CreateListItem

This method will create a new item in the list specified
CreateListItem(listName, webUrl, item)

Parameters
     var obj = { 
          Title: 'Test Title', 
          MyCustomField: 'Testing'
     }

DeleteListItem

This method will delete an item from a list by ID.
DeleteListItem(itemId, listName, webUrl)

Parameters

GetItemById

This method will retrieve an item from a list by ID.
GetItemById(itemId, listName, webUrl)

Parameters

GetListItems

This method will retrieve items from a list by using a CAML query .
GetListItems(listName, webUrl, camlquery)

Parameters

GetUserId

This method will retrieve the user object from SharePoint based on the login name provided. This call will get the user if they are already part of the site, if not it will call ensure user so that there is a user object to return. This can cause issues if the user that is logged in doesn't have permissions to add users.
GetUserId(loginName, webUrl)

Parameters

UpdateListItem

This method will update a list item with the values you provide.
UpdateListItem(itemId, listName, webUrl, item)

Parameters
     var obj = { 
          Title: 'Test Title', 
          MyCustomField: 'Testing'
     }