Get started developing with social features in SharePoint 2013

SharePoint 2013

Get started programming with SharePoint 2013 social feeds and microblog posts, following people and content (documents, sites, and tags), and working with user profiles.

Social features in SharePoint 2013 apps and solutions can help people to connect, communicate, and collaborate with each other and find, track, and share important content and information. You can add new social features or extend the features that are already available in SharePoint 2013. For example, you can create an app that lets you find and follow people who have a common interest, create a custom visualization of feed data, or publish custom activities to the feed.

The features described in this article align to the people, feeds, and following functionality that you find on personal sites and team sites. The forum experience and reputation model on Community Sites don't expose a specific API, so you use SharePoint site and list APIs directly to extend that functionality. For more information, see New Community Site feature.

Before you start developing, you should know where your code will run, what SharePoint environment it will run on, and what functionality it will provide. These factors help you choose the kind of app to create and which API or APIs to use. See Choose the right API set in SharePoint 2013, Apps for SharePoint compared with SharePoint solutions, and Deciding between apps for SharePoint and SharePoint solutions for information that can help you decide.

Setting up your development environment

To get started developing with social features, you'll need:

  • SharePoint Server 2013 or SharePoint Online

  • Visual Studio 2012 or Visual Studio 2013, with Office Developer Tools for Visual Studio 2013
       OR
    "Napa" Office 365 Development Tools (only for developing SharePoint-hosted apps on an Office 365 Developer Site)

For more guidance, see Start: Set up the development environment for SharePoint 2013 and Configure social computing features in SharePoint Server 2013.

Development scenarios for social features in SharePoint 2013

High-level development scenarios for social features include working with social feeds, following people and content (documents, sites, and tags), and working with user properties. Table 1 contains links to articles that describe the primary APIs that you use to access functionality for each scenario and common programming tasks.

The following articles describe the primary APIs and programming tasks for the particular development scenario:

How-tos for programming with social features in SharePoint 2013

After you set up your development environment and choose your scenario, you can get started programming with social features. Table 1 contains links to articles that show how to do basic programming tasks with social features.

Table 1. How-to articles for developing with social features

Feature area

Description

How to: Learn to read and write to the social feed by using the .NET client object model in SharePoint 2013

Walk through detailed steps for creating an application that reads and writes to the social feed by using the .NET client object model.

How to: Learn to read and write to the social feed by using the REST service in SharePoint 2013

Walk through detailed steps for creating an application that reads and writes to the social feed by using the REST service.

How to: Create and delete posts and retrieve the social feed by using the .NET client object model in SharePoint 2013

Learn how to create and delete and microblog posts and retrieve social feeds by using the .NET client object model.

How to: Create and delete posts and retrieve the social feed by using the JavaScript object model in SharePoint 2013

Learn how to create and delete and microblog posts and retrieve social feeds by using the JavaScript object model.

How to: Include mentions, tags, and links to sites and documents in posts in SharePoint Server 2013

Learn how to add SocialDataItem objects to microblog posts, which render as mentions, tags, and links in social feeds.

How to: Embed images, videos, and documents in posts in SharePoint Server 2013

Learn how to add SocialAttachment objects to microblog posts, which render as embedded pictures, videos, and documents in social feeds.

How to: Follow people by using the .NET client object model in SharePoint 2013

Learn how to work with Following People features by using the .NET client object model.

How to: Follow people by using the JavaScript object model in SharePoint 2013

Learn how to work with Following People features by using the JavaScript object model.

How to: Follow documents and sites by using the .NET client object model in SharePoint 2013

Learn how to work with Following Content features by using the .NET client object model.

How to: Follow documents, sites, and tags by using the REST service in SharePoint 2013

Learn how to work with Following Content features by using the REST service.

How to: Retrieve user profile properties by using the .NET client object model in SharePoint 2013

Learn how to retrieve user profile properties by using the .NET client object model.

How to: Retrieve user profile properties by using the JavaScript object model in SharePoint 2013

Learn how to retrieve user profile properties by using the JavaScript object model.

How to: Work with user profiles and organization profiles by using the server object model in SharePoint 2013

Learn how to create, retrieve, and manage user profiles and properties by using the server object model.

APIs for programming with SharePoint 2013 social features

Although apps and solutions access SharePoint differently, after you do access SharePoint you use the social APIs in basically the same way. Table 2 shows the APIs for programming with feed, following, and user profiles features in SharePoint 2013 and the paths to the source files on the server.

Table 2. APIs for programming with social features

API name

Source and path

.NET client object model

Microsoft.SharePoint.Client.UserProfiles.dll
in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\ISAPI

Silverlight client object model

Microsoft.SharePoint.Client.UserProfiles.Silverlight.dll
in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS\ClientBin

Mobile client object model

Microsoft.SharePoint.Client.UserProfiles.Phone.dll
in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS\ClientBin

JavaScript object model

SP.UserProfiles.js
in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS

Representational State Transfer (REST) service

http://<site url>/_api/social.feed
http://<site url>/_api/social.following
http://<site url>/_api/SP.UserProfiles.PeopleManager

Server object model

Microsoft.Office.Server.UserProfiles.dll
in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\ISAPI

Note Note

Not all server-side functionality in the Microsoft.Office.Server.UserProfiles assembly is available from client APIs. To see which APIs are available, see the Microsoft.SharePoint.Client.Social namespace and the Microsoft.SharePoint.Client.UserProfiles namespace.

An app for SharePoint must request the permissions that it needs to access SharePoint resources from the user who installs it. For example, an app that posts to the feed should request Write permission (at minimum) to the feed. You specify the permissions that your app need in the AppManifest.xml file in Visual Studio or in the Properties dialog box in "Napa" Office 365 Development Tools.

App permission requests are scoped to the SharePoint deployment landscape. Table 3 shows the scope names (with corresponding scope URIs) and the available rights for accessing social features. For more information, see App permissions in SharePoint 2013, App authorization policy types in SharePoint 2013, and Plan app permissions management in SharePoint 2013.

Table 3. App permission scopes and available rights for social features in SharePoint Server 2013

Scope name

Description

Available rights

User Profiles
(http://sharepoint/social/tenant)

The permission request scope used to access all user profiles. Only the profile picture can be changed; all other user profile properties are read-only for apps for SharePoint. Must be installed by a tenant administrator.

Read, Write, Manage, FullControl

Core
(http://sharepoint/social/core)

The permission request scope used to access the user's followed content and shared metadata that is used by microblogging features. This scope applies only to personal sites that support following content. If the app installs on any other type of site, use the Tenant scope.

Read, Write, Manage, FullControl

News Feed
(http://sharepoint/social/microfeed)

The permission request scope used to access the user's feed or the team feed. This scope applies to personal sites that support microblogging or to team sites where the Site Feed feature is activated. If the app installs on any other type of site, use the Tenant scope.

Read, Write, Manage, FullControl

http://sharepoint/social/trimming

This permission request scope used to determine whether to display security-trimmed content in the social feed to apps. If this high-trust permission is not granted, some content (such as activities about documents and sites that the app doesn't have permissions to) is trimmed from the feed data that's returned to the app, even if the user has sufficient permissions. This permission must be manually added to the app's manifest file.

Read, Write, Manage, FullControl

What you’ll need to consider when requesting app permissions

You should be aware of the following considerations when you specify app permissions for social features:

  • Apps that specify FullControl rights are not allowed for Office Store apps. Only Read, Write, and Manage rights are allowed for Office Store apps.

  • You can specify permissions for feed and following features by using the Core, News Feed, and Tenant (http://sharepoint/content/tenant) scopes. The Tenant scope represents the whole tenancy where an app is installed, including the Core and News Feed scopes. So if your app already specifies the rights that it needs at the Tenant scope, then you don't need to request permissions at the Core or News Feed scope.

  • During development, use the Tenant scope if you get a "SocialListNotFound : The Social list does not exist in your personal site" or "File Not Found" message. If you want to use the Core or News Feed scope in your app, you can test the permissions by opening the app from the app catalog.

  • The Core scope applies to personal sites that support following content. The News Feed scope applies to personal sites that support microblogging or to team sites where the Site Feed feature is activated. If the app will be installed on any other type of site, you must use the Tenant scope. See Tenancies and deployment scopes for apps for SharePoint.

  • Apps that request rights for the User Profiles scope must be installed by a tenant administrator.

  • If licensing or feature activation requirements for social and microblogging features are not met, users get a message saying that they can't install the app.

  • Apps that are launched outside of SharePoint 2013 can request permission on-the-fly (except Full Control). For more information, see OAuth authentication and authorization flow for apps that ask for access permissions on the fly in SharePoint 2013 (advanced topic).

Show:
© 2014 Microsoft