Questions tagged [csom]

CSOM (Client Side Object Model) is a web services-based API of SharePoint allowing easy remote access to data and SharePoint's functions.

CSOM, which stands for Client-Side Object Model, is a web services-based API of SharePoint. It allows access to SharePoint data and features from remote clients. CSOM was introduced in SharePoint 2010 and greatly enhanced in SharePoint 2013.

Both JavaScript and .NET bindings to CSOM exist. Software leveraging CSOM can integrate with SharePoint without the need to run within a SharePoint farm.

In SharePoint 2013 CSOM is the only API available to software built using the new Apps for SharePoint architecture. Apps for SharePoint run side-by-side, typically in the cloud, and integrate with both cloud and on-premise SharePoint farms.

Corresponding MSDN documentation is located here, with separate JavaScript and .NET API references. The web services-based API underlying CSOM has been documented as part of Microsoft's Open Specifications initiative.

870 questions
32
votes
8 answers

How to download/upload files from/to SharePoint 2013 using CSOM?

I am developing a Win8 (WinRT, C#, XAML) client application (CSOM) that needs to download/upload files from/to SharePoint 2013. How do I do the Download/Upload?
eitan barazani
  • 1,073
  • 3
  • 16
  • 33
17
votes
4 answers

SharePoint Error: The server does not allow messages larger than 2097152 bytes

I have web service that point to sharepoint 2013 Office 365. I use the client object model. I am trying to update the xml file which stores 4 attachments in it. When I do this when I have large binary data in the xml file I get the following…
Carter
  • 181
  • 1
  • 1
  • 6
15
votes
4 answers

Proper way to detect if a ClientObject property is already retrieved/initialized

If you're using the Client Object Model from SharePoint and access properties which haven't been initialized or already retrieved by an Context.Load(property); Context.ExecuteQuery(); you get for example…
Mark
  • 3,180
  • 2
  • 33
  • 50
14
votes
3 answers

Creating Folders programmatically in SharePoint 2013

Currently I have code that creates a Folder in the Documents directory when run: using (var context = new Microsoft.SharePoint.Client.ClientContext(sharePointSite)) { context.Credentials = new…
B-M
  • 999
  • 1
  • 15
  • 37
13
votes
5 answers

Set Item Permissions

Folders work: I now know how to set the permissions of a folder in a library: public void ChangeItemPermissions() { _SharePoint.ClientContext _ClientContext = new _SharePoint.ClientContext("https://sharepoint.oshirowanen.com/sites/oshirodev/"); …
oshirowanen
  • 15,331
  • 77
  • 181
  • 330
12
votes
3 answers

Check if Current Users belongs to SP group using javascript Client Side Object Model

I havent found a specific example of how to get the current user and then check if it belongs to a specific sharepoint group, as I havent found anything I cant provide a code, help on the right direction is appreciated.
Luis Valencia
  • 27,032
  • 76
  • 237
  • 423
11
votes
4 answers

C# CSOM - Check if File Exists in Document Library

I'm coding in C# using CSOM, my app uploads a template asp.net page to the "/Pages/" library, I need it to check if a file exists in that location with the same name prior to file upload (then maybe it can return a bool value). I did have a quick…
Junior
  • 315
  • 2
  • 4
  • 9
10
votes
1 answer

How to include Project's FieldValues in CSOM request

I'm trying to pull all Projects information from SharePoint using Client Side Object Model (CSOM). Here is how I'm getting Projects information: projectContext.Load(projectContext.Projects, c => c.Where(p => p.Id == new Guid(id)) …
Vlad Bezden
  • 59,971
  • 18
  • 206
  • 157
10
votes
4 answers

Retrieve Publishing image field with Sharepoint 2013 REST Api / CSOM

We're using the Sharepoint 2013 REST API to get all news items from the Sharepoint. We made a custom ContentType 'Newsitem' with several properties including a Publishing Image Field. var contentTypeId =…
Gigi2m02
  • 1,192
  • 3
  • 16
  • 33
9
votes
1 answer

User is part of an AD Group that is nested in the SharePoint group how to relate ad user with SharePoint group

We have added a AD group to SharePoint users group. Now when we login with user, we want to check permission for the logged in AD user. I have added Ad group (example) managers in SharePoint. Now I want show some URL links to only the…
Ajay Nikam
  • 229
  • 4
  • 15
9
votes
4 answers

The remote server returned an error: (401) Unauthorized. Using CSOM in ASP.NET

I'm tried to pull some SharePoint 2013 list data I created which works fine when running locally on my machine and when run locally one the server. I'm user the same credentials when running both locally and locally on the server. The issue is…
Hidan
  • 347
  • 1
  • 5
  • 18
8
votes
2 answers

How to manage client context object in seperate class library?

I am trying to create a library(class library) for sharepoint which will have all sharepoint dll to interact with sharepoint server to upload files,documents and create document library and document set. Now this library could be consumed by clients…
7
votes
9 answers

Check if a List Column Exists using SharePoint Client Object Model?

Using the Client Object Model (C#) in SharePoint 2010, how can I determine if a specified column (field) name exists in a given List? Thanks, MagicAndi.
MagicAndi
  • 42,295
  • 24
  • 76
  • 109
7
votes
4 answers

How do I extract the type from a field?

In SharePoint Server side code, you can write something like: field.fieldvalueType Which will sometimes give you the type (DateTime, or whatever). Annoyingly, sometimes, it just returns Null (for example, the ID field). In CSOM, you don't have that…
David
  • 14,313
  • 26
  • 100
  • 149
7
votes
2 answers

How to get users from SharePoint via CSOM?

How can I efficiently grab users (with their properties) from a SharePoint web using CSOM? The code below results in multiple calls to the server (one for each user). It's ridiculously inefficient. Also, is it possible to perform a Filter on the…
Matt Fitzmaurice
  • 1,093
  • 4
  • 13
  • 32
1
2 3
57 58