Skip to content

Commit fe2f748

Browse files
committed
synced 1.3 release updates
1 parent d910bc9 commit fe2f748

File tree

172 files changed

+2592
-619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+2592
-619
lines changed
-42.3 KB
Binary file not shown.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Creating SharePoint Communication Site using REST
2+
3+
Learn how to create and get the status of a new modern SharePoint Communication site with the REST interface.
4+
5+
## Prerequisites
6+
7+
This topic assumes that you are already familiar with the topics Get to know the SharePoint REST service and Complete basic operations using SharePoint REST endpoints. It does not provide code snippets.
8+
9+
The following REST commands are available for creating a modern SharePoint Communication site.
10+
11+
- **Create** - Create a new SharePoint Communication site
12+
- **Status** - Get the status of a SharePoint Communication site
13+
14+
The URL for communication site REST commands is based on `_api/sitepages/communicationsite`. For example, these are the endpoints for the commands listed above:
15+
16+
- `http:///_api/sitepages/communicationsite/create`
17+
- `http:///_api/sitepages/communicationsite/status`
18+
19+
## Create Communication Site
20+
21+
```
22+
url: /_api/sitepages/communicationsite/create
23+
method: POST
24+
body:
25+
{
26+
"__metadata":{"type":"SP.Publishing.CommunicationSiteCreationRequest"},
27+
"AllowFileSharingForGuestUsers":false,
28+
"Classification":"Contoso confidential",
29+
"Description":"Here is my communication site",
30+
"SiteDesignId":"6142d2a0-63a5-4ba0-aede-d9fefca2c767",
31+
"Title":"comm1",
32+
"Url":"https://contoso.sharepoint.com/sites/comm1",
33+
"lcid":1033
34+
}
35+
```
36+
37+
Note: New in this API is the concept of SiteDesignID. Much like the in-product site creation flow, the SiteDesignID parameter maps to the included site designs. They are:
38+
39+
- Topic: null
40+
- Showcase: 6142d2a0-63a5-4ba0-aede-d9fefca2c767
41+
- Blank: f6cc5403-0d63-442e-96c0-285923709ffc
42+
43+
**Response**
44+
45+
If successful, this method returns 200, OK response code and simple JSON object in the response body with following details.
46+
47+
```
48+
{
49+
"d":{
50+
"Create":{
51+
"__metadata":{"type":"SP.Publishing.CommunicationSiteCreationResponse"},
52+
"SiteStatus":2,
53+
"SiteUrl":"https://contoso.sharepoint.com/sites/comm1"
54+
}
55+
}
56+
}
57+
```
58+
59+
60+
## Get Communication Site Status
61+
62+
REST API for getting the status of a modern SharePoint Communication site
63+
64+
```
65+
url: /_api/sitepages/communicationsite/status?url='https%3A%2F%2Fcontoso.sharepoint.com%2Fsites%2Fcomm1'
66+
method: GET
67+
body: none
68+
```
69+
70+
**Response**
71+
72+
If successful, this method returns 200, OK response code and simple JSON object in the response body with following details.
73+
74+
If the site exists, the response will return the site status and site URL.
75+
76+
```
77+
{
78+
"d":{
79+
"Status":{
80+
"__metadata":{"type":"SP.Publishing.CommunicationSiteCreationResponse"},
81+
"SiteStatus":2,
82+
"SiteUrl":"https://contoso.sharepoint.com/sites/comm1"
83+
}
84+
}
85+
}
86+
```
87+
88+
If the site does not exist, the response will return site status of 0 with no URL.
89+
90+
```
91+
{
92+
"d":{
93+
"Status":{
94+
"__metadata":{"type":"SP.Publishing.CommunicationSiteCreationResponse"},
95+
"SiteStatus":0,
96+
"SiteUrl":
97+
}
98+
}
99+
}
100+
```

docs/apis/rest/set-custom-permissions-on-a-list-by-using-the-rest-interface.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Learn how to define custom, fine-grained permissions on a SharePoint list by usi
1010

1111
SharePoint sites, lists, and list items are types of **SecurableObject**. By default, a securable object inherits the permissions of its parent. To set custom permissions for an object, you need to break its inheritance so that it stops inheriting permissions from its parent, and then define new permissions by adding or removing role assignments.
1212

13-
**Note** See [Additional resources](set-custom-permissions-on-a-list-by-using-the-rest-interface.md#bk_addresources) for links to articles about setting fine-grained permissions.
13+
> [!Note]
14+
> See [Additional resources](set-custom-permissions-on-a-list-by-using-the-rest-interface.md#bk_addresources) for links to articles about setting fine-grained permissions.
1415
1516
The code example in this article sets custom permissions on a list, and then changes a group's permissions to it. The example uses the REST interface to:
1617

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# SharePoint site theming: CSOM development
2+
3+
The SharePoint Client Side Object Model (CSOM) provides .NET developers with access to the SharePoint object model from code that is running locally or on a different server than SharePoint. This topic covers the site theming functionality available in CSOM.
4+
5+
## Prerequisites
6+
This topic assumes you are familiar with the topics [Using the Client Object Model](https://msdn.microsoft.com/en-us/library/ff798388.aspx) and [Common Programming Tasks in the Managed Client Object Model](https://msdn.microsoft.com/en-us/library/ee537013.aspx), which cover how to work with the SharePoint CSOM.
7+
8+
Install the following components for CSOM development:
9+
10+
* [SharePoint Server 2016 Client Component SDK](https://www.microsoft.com/en-us/download/details.aspx?id=51679)
11+
* [Microsoft.SharePointOnline.CSOM](https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM/) NuGet package (version 16.1.6906.1200 or later)
12+
13+
## Sample code
14+
15+
The following sample shows how to create a __Microsoft.Online.SharePoint.TenantAdministration.Tenant__ object and call the __GetAllTenantThemes__ method to return a list of themes. Notes on this sample:
16+
17+
* The URL used for creating the context object includes the _-admin_ suffix, because TenantAdministration methods work with the admin site.
18+
* Create a __Tenant__ instance with the [Tenant constructor](https://msdn.microsoft.com/en-us/library/dn174852.aspx), and then call the methods on that instance.
19+
* The same approach can be used for calling other theme management methods.
20+
21+
```C#
22+
using System.Security;
23+
using SPClient=Microsoft.SharePoint.Client;
24+
using Microsoft.Online.SharePoint.TenantAdministration;
25+
using Microsoft.Online.SharePoint.TenantManagement;
26+
27+
SPClient.ClientContext ctx = new SPClient.ClientContext("https://mysite-admin.sharepoint.com/");
28+
var pwd = "mypassword";
29+
var passWord = new SecureString();
30+
foreach (char c in pwd.ToCharArray()) passWord.AppendChar(c);
31+
ctx.Credentials = new SPClient.SharePointOnlineCredentials("[email protected]", passWord);
32+
Tenant tenant = new Tenant(ctx);
33+
SPClient.ClientObjectList<ThemeProperties> themes = tenant.GetAllTenantThemes();
34+
```
35+
36+
## Sample theme definition
37+
38+
For methods that take a theme argument, the following code defines an __SPOTheme__ class that you can use to create custom themes.
39+
40+
```C#
41+
/// <summary
42+
/// Properties defining a theme in SharePoint Online. 
43+
/// </summary
44+
public class SPOTheme 
45+
46+
    /// <summary
47+
    /// Specifies the name of the theme. This must uniquely identify the theme. 
48+
    /// </summary
49+
    public string Name 
50+
    { 
51+
        get; private set; 
52+
    } 
53+
    /// <summary
54+
    /// Specifies the palette of colors in the theme, as a dictionary of theme slot values. 
55+
    /// </summary
56+
    public IDictionary<String, String> Palette 
57+
    { 
58+
        get; private set
59+
    } 
60+
    /// <summary
61+
    /// Specifies whether the theme is inverted, with a dark background and a light foreground. 
62+
    /// </summary
63+
    public bool IsInverted 
64+
    { 
65+
        get; private set
66+
    } 
67+
68+
```
69+
70+
## Applying a theme
71+
72+
The methods covered below are used to manage the available themes in your tenant. To _apply_ a theme to a particular SharePoint web site, use the [SPWeb.ApplyTheme](https://msdn.microsoft.com/en-us/library/office/jj251358.aspx) method of the [Microsoft.SharePoint.Client.Web](https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.web.aspx) class.
73+
74+
## Methods/properties of the Microsoft.Online.SharePoint.TenantAdministration.Tenant class
75+
76+
These methods can be used to customize a SharePoint tenant administration site's set of available themes. You can add a new custom theme, update an existing theme, or delete a theme, and you can retrieve a specific theme or all themes. You can also hide or restore the default themes that come with SharePoint.
77+
78+
### AddTenantTheme public method
79+
Add a theme to the tenant.
80+
81+
__Namespace:__ Microsoft.Online.SharePoint.TenantAdministration.Tenant<br/>
82+
__Parameters:__ string name, string themeJson<br/>
83+
__Return type:__ ClientResult<bool>
84+
85+
### DeleteTenantTheme public method
86+
Delete a theme from the tenant.
87+
88+
__Namespace:__ Microsoft.Online.SharePoint.TenantAdministration.Tenant<br/>
89+
__Parameters:__ string name<br/>
90+
__Return type:__ void
91+
92+
### GetAllTenantThemes public method
93+
Retrieve all of the themes currently available in the tenant, including any custom themes that have been added. Default themes are only included if the __HideDefaultThemes__ property is __false__ (the default value).
94+
95+
__Namespace:__ Microsoft.Online.SharePoint.TenantAdministration.Tenant<br/>
96+
__Parameters:__ none<br/>
97+
__Return type:__ ClientObjectList<ThemeProperties>
98+
99+
### GetTenantTheme public method
100+
Retrieve a theme by name.
101+
102+
__Namespace:__ Microsoft.Online.SharePoint.TenantAdministration.Tenant<br/>
103+
__Parameters:__ string name<br/>
104+
__Return type:__ ThemeProperties
105+
106+
### HideDefaultThemes public property
107+
This property indicates whether the default themes ("out of the box" themes) are hidden in the theme picker user interface for modern pages. You might want to set this property to __true__ after defining custom themes, to allow only specific themes to be used.
108+
109+
__Namespace:__ Microsoft.Online.SharePoint.TenantAdministration.Tenant<br/>
110+
__Type:__ Boolean
111+
112+
### UpdateTenantTheme public method
113+
Update the settings for an existing theme.
114+
115+
__Namespace:__ Microsoft.Online.SharePoint.TenantAdministration.Tenant<br/>
116+
__Parameters:__ string name, string themeJson<br/>
117+
__Return type:__ ClientResult<bool>
118+
119+
## Methods of the Microsoft.Online.SharePoint.TenantManagement.Tenant class
120+
121+
These methods can be used to manage themes in a multi-tenant environment.
122+
123+
### AddTenantTheme public method
124+
Add a theme to the tenant.
125+
126+
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
127+
__Parameters:__ string name, string themeJson<br/>
128+
__Return type:__ ClientResult<bool>
129+
130+
### GetAllTenantThemes public method
131+
Retrieve all of the themes currently available in the tenant, including any custom themes that have been added. Default themes are only included if the __HideDefaultThemes__ property is __false__ (the default value).
132+
133+
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
134+
__Parameters:__ none<br/>
135+
__Return type:__ ClientObjectList<ThemeProperties>
136+
137+
### GetHideDefaultThemes public method
138+
Read the current setting for whether to hide default themes in the theme picker user interface.
139+
140+
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
141+
__Parameters:__ none<br/>
142+
__Return type:__ ClientResult<bool>
143+
144+
### GetTenantTheme public method
145+
Retrieve a theme by name.
146+
147+
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
148+
__Parameters:__ string name<br/>
149+
__Return type:__ ThemeProperties
150+
151+
### SetHideDefaultThemes public method
152+
Specify whether to hide default themes in the theme picker user interface.
153+
154+
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
155+
__Parameters:__ Boolean<br/>
156+
__Return type:__ void
157+
158+
### UpdateTenantTheme public method
159+
Update the settings for an existing theme.
160+
161+
__Namespace:__ Microsoft.Online.SharePoint.TenantManagement.Tenant<br/>
162+
__Parameters:__ string name, string themeJson<br/>
163+
__Return type:__ ClientResult<bool>
164+
165+
## Additional resources
166+
167+
* [SharePoint site theming overview](sharepoint-site-theming-overview.md)
168+
* [SharePoint site theming: JSON schema](sharepoint-site-theming-json-schema.md)
169+
* [SharePoint site theming: PowerShell commands](sharepoint-site-theming-powershell.md)
170+
* [SharePoint site theming: REST API](sharepoint-site-theming-rest-api.md)
171+
* [Using the Client Object Model](https://msdn.microsoft.com/en-us/library/ff798388.aspx)
172+
* [Common Programming Tasks in the Managed Client Object Model](https://msdn.microsoft.com/en-us/library/ee537013.aspx)

0 commit comments

Comments
 (0)