SharePoint 2013: How to Find the List Item Content Type

This one is short and sweet…if you’re using the SharePoint REST API for inserts or updates, you will need the List Item content Type.  Usually, it’s straightforward, just take the list name and add ListItem to the end.  So a list named “Event Fund” would have a list item content type of:  Event_x0020_FundListItem.

But if the list’s name has been changed or some other reason, it might not be a perfect match.  To find it, you can simply run a Select REST call through a browser (Chrome works well) and find it in the returned data.

https://mysharepointsiteurl/_api/web/lists/getbytitle(‘LIST%20NAME’)/items

When you get the returned data, search for the text  “SP.Data.”.  The part that comes after should be your content type if it ends in ListItem.  ONE CAVEAT: you have to have an item in your list, or that jewel won’t be in there.

Note: in the url above, the mysharepointsiteurl part might look something like:  mysite.com/sites/mySharePointSite.  But you may have a different url scheme, so there’s 100% always right answer there.

 

No comments yet.

Leave a Reply

Powered by WordPress. Designed by Woo Themes