How to create ContentTypes in Sharepoint 2013/Office 365 using CSOM
In this article, we will learn about ContentType creation in Sharepoint 2013/Office 365 using CSOM. Below is the sample CSOM code to achieve the same. ClientContext cc = new ClientContext(siteUrl); cc.AuthenticationMode = ClientAuthenticationMode.Default; cc.Credentials = new SharePointOnlineCredentials(userName, pwd); Web web = cc.Web; ContentTypeCollection contentTypes = web.ContentTypes; cc.Load(contentTypes); cc.ExecuteQuery(); foreach (var item in contentTypes) { if (item.StringId == “0x0101009189AB5D3D2647B580DFGT56F356FB2”) return; […]