Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

SharePoint CSOM

$
0
0

I am trying to run the below CSOM to retrieve events using this link: https://www.jonathanhuss.com/sharing-a-sharepoint-online-calendar-via-icalendar/. How can I run the below code?

Uri uri = new Uri(remoteCalendarAccess.SiteAddress);
string realm = TokenHelper.GetRealmFromTargetUrl(uri);
var token = TokenHelper.GetAppOnlyAccessToken("00000003-0000-0ff1-ce00-000000000000", uri.Authority, realm);
ClientContext clientContext = TokenHelper.GetClientContextWithAccessToken(uri.ToString(), token.AccessToken);
clientContext.Load(clientContext.Web.Lists);
clientContext.ExecuteQuery();
List list = clientContext.Web.Lists.Where(l => l.Id == remoteCalendarAccess.CalendarId).First();
ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery());
clientContext.Load(items);
clientContext.ExecuteQuery();




Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>