Skip to content

Commit 9c22df2

Browse files
davidchesnutVesaJuvonen
authored andcommitted
hub site docs (SharePoint#1492)
* added overview sp hub site * minor edits * rest api work in progress * draft doc for HubSites API * added GetById draft * hub site draft docs * toc and minor updates * fixing filename typo * fixing typos in filenames * typos in filenames fixes * draft REST docs for hub * added hub REST content * fix links * moved hub site docs to features * reworking create and overview * minor update * relocating some minor content * edit * Update hub-site-powershell.md * updates from feedback * fixes from feedback * fixed url
1 parent 708e756 commit 9c22df2

15 files changed

+929
-1
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: SP.HubSites.CanCreate REST method
3+
description: SP.HubSites.CanCreate REST method
4+
ms.date: 2/26/2018
5+
---
6+
7+
# SP.HubSites.CanCreate
8+
9+
> [!IMPORTANT]
10+
> The hub sites feature is currently in preview and is subject to change. It is not currently supported for use in production environments.
11+
12+
Returns whether the current user can create a hub site. Only tenant admins can create hub sites.
13+
14+
## HTTP request
15+
16+
```
17+
GET /_api/SP.HubSites.CanCreate
18+
```
19+
20+
## URI Parameters
21+
22+
None
23+
24+
## Request headers
25+
26+
| Header | Value |
27+
|--------|-------|
28+
|Accept|application/json;odata=verbose|
29+
|Content-Type|application/json;odata=verbose;charset=utf-8|
30+
|x-requestdigest|The appropriate digest for current site|
31+
32+
## Request body
33+
34+
Do not supply a request body for this method.
35+
36+
## Responses
37+
38+
| Name | Type |Description|
39+
|--------|---------|-----------|
40+
|200 OK | [SPHubSiteCanCreate](#sphubsitecancreate) |Success |
41+
42+
## Examples
43+
44+
### Check if you can create hub sites
45+
46+
#### Sample Request
47+
48+
```HTTP
49+
GET
50+
https://contoso.sharepoint.com/sites/marketing/_api/SP.HubSites.CanCreate
51+
```
52+
53+
#### Sample Response
54+
**Status code:** 200
55+
56+
```JSON
57+
{
58+
"@odata.context": "https://contoso.sharepoint.com/sites/marketing/_api/$metadata#Edm.Boolean",
59+
"value": true
60+
}
61+
```
62+
63+
## Definitions
64+
| [SPHubSiteCanCreate](#sphubsitecancreate) | Indicates if you have permissions to create a hub site.|
65+
66+
### SPHubSiteCanCreate
67+
Indicates if you have permissions to create a hub site.
68+
69+
|Name |Type |Description |
70+
|------|--------|-------------|
71+
|value |Boolean | **true** if you have permissions to create a hub site; otherwise, **false**. |

docs/features/REST-getbyid-method.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: GetById REST method
3+
description: GetById REST method
4+
ms.date: 2/26/2018
5+
---
6+
7+
# GetById
8+
9+
> [!IMPORTANT]
10+
> The hub sites feature is currently in preview and is subject to change. It is not currently supported for use in production environments.
11+
12+
Gets or updates information about a hub site.
13+
14+
## HTTP request
15+
16+
```
17+
GET /_api/HubSites/GetById
18+
POST /_api/HubSites/GetById
19+
```
20+
21+
## URI Parameters
22+
23+
|Name |In |Required|Type|Description|
24+
|-----|---|--------|----|-----------|
25+
|hubSiteId|query|True|string|The ID of the hub site to get information about.|
26+
27+
## Request headers
28+
29+
| Header | Value |
30+
|--------|-------|
31+
|Accept|application/json;odata=verbose|
32+
|Content-Type|application/json;odata=verbose;charset=utf-8|
33+
|x-requestdigest|The appropriate digest for current site|
34+
35+
When using POST to update a hub site with new information, use the following additional header values:
36+
37+
| Header | Value |
38+
|--------|-------|
39+
|X-HTTP-Method| MERGE |
40+
|If-Match| \* |
41+
42+
## Request body
43+
44+
For GET, no request body is needed. When using POST to update a hub site with new information, use the following body.
45+
46+
|Name |Required |Type |Description |
47+
|---------|---------|---------|---------|
48+
|Title | no | string | The display name of the hub. |
49+
|LogoUrl | no | string | The URL of a logo to use in the hub site navigation. |
50+
|Description | no | string | A description of the hub site. |
51+
52+
## Responses
53+
54+
| Name | Type | Description|
55+
|--------|-------|------------|
56+
|200 OK|[SPHubSite](REST-sphubsite-type.md) |Hub site information successfully returned.|
57+
|204 No Content| | Hub site was updated.|
58+
59+
## Examples
60+
61+
### Get a hub site
62+
63+
#### Sample Request
64+
65+
```HTTP
66+
GET
67+
https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-499c-92db-38800eefbe44'
68+
```
69+
70+
#### Sample Response
71+
**Status code:** 200
72+
73+
```JSON
74+
{
75+
"@odata.context": "https://contoso.sharepoint.com/_api/$metadata#hubsites/$entity",
76+
"@odata.type": "#SP.HubSite",
77+
"@odata.id": "https://contoso.sharepoint.com/_api/HubSites/GetById",
78+
"@odata.etag": "\"3\"",
79+
"@odata.editLink": "HubSites/GetById",
80+
"Description": null,
81+
"ID": "f93eff08-5806-499c-92db-38800eefbe44",
82+
"LogoUrl": "https://contoso.sharepoint.com/sites/marketing/SiteAssets/__hubLogo____hubLogo__.png",
83+
"SiteId": "f93eff08-5806-499c-92db-38800eefbe44",
84+
"SiteUrl": "https://contoso.sharepoint.com/sites/marketing",
85+
"Targets": "<acl><ace identityName=\"c:0t.c|tenant|0d4b97fc-37fb-4db3-84f3-d34243a3afac\" displayName=\"0t.c|tenant|0d4b97fc-37fb-4db3-84f3-d34243a3afac\" sid=\"\" binaryIdType=\"1\" binaryId=\"YzowdC5jfHRlbmFudHwwZDRiOTdmYy0zN2ZiLTRkYjMtODRmMy1kMzQyNDNhM2FmYWM=\" allowRights=\"1\" denyRights=\"0\" /></acl>",
86+
"TenantInstanceId": "00000000-0000-0000-0000-000000000000",
87+
"Title": ""
88+
}
89+
```
90+
91+
### Update a hub site
92+
93+
#### Sample Request
94+
95+
```HTTP
96+
POST
97+
https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-499c-92db-38800eefbe44'
98+
```
99+
100+
#### Sample Response
101+
**Status code:** 204
102+
103+
```JSON
104+
{
105+
"Title": "Marketing hub site",
106+
"LogoUrl": "https://contoso.sharepoint.com/sites/marketing/SiteAssets/__hubLogo____hubLogo__.png",
107+
"Description": "Hub site for marketing coordination"
108+
}
109+
```
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: HubSiteData REST method
3+
description: HubSiteData REST method
4+
ms.date: 2/26/2018
5+
---
6+
7+
# HubSiteData
8+
9+
> [!IMPORTANT]
10+
> The hub sites feature is currently in preview and is subject to change. It is not currently supported for use in production environments.
11+
12+
Get hub site data for the current web.
13+
14+
## HTTP request
15+
16+
```
17+
GET /_api/web/HubSiteData
18+
```
19+
20+
## URI Parameters
21+
22+
|Name |In |Required|Type|Description|
23+
|-----|---|--------|----|-----------|
24+
|forceRefresh|query|False|boolean|Default value is false. If false, data is returned from the server's cache. If true, the cache is refreshed with latest updates. Use this if you just made changes and need to see the changes right away.|
25+
26+
## Request headers
27+
28+
| Header | Value |
29+
|--------|-------|
30+
|Accept|application/json;odata=verbose|
31+
|Content-Type|application/json;odata=verbose;charset=utf-8|
32+
|x-requestdigest|The appropriate digest for current site|
33+
34+
## Request body
35+
36+
Do not supply a request body for this method.
37+
38+
## Responses
39+
40+
| Name | Type | Description|
41+
|--------|-------|------------|
42+
|200 OK|SPHubSiteData |OK|
43+
44+
## Examples
45+
46+
### Get hub site data for marketing web
47+
48+
#### Sample Request
49+
50+
```HTTP
51+
GET
52+
https://contoso.sharepoint.com/sites/marketing/_api/web/HubSiteData(true)
53+
```
54+
55+
#### Sample Response
56+
**Status code:** 200
57+
58+
```JSON
59+
{
60+
"themeKey": null,
61+
"name": "marketing",
62+
"url": "https://contoso.sharepoint.com/sites/marketing",
63+
"logoUrl": "https://contoso.sharepoint.com/sites/marketing/SiteAssets/__hubLogo.jpg",
64+
"usesMetadataNavigation": false,
65+
"navigation": [
66+
{
67+
"Id": 2006,
68+
"Title": "online team",
69+
"Url": "https://spdfcontosodemo2.sharepoint.com/sites/online-advertising",
70+
"IsDocLib": false,
71+
"IsExternal": false,
72+
"ParentId": 1002,
73+
"ListTemplateType": 0,
74+
"Children": []
75+
}
76+
]
77+
}
78+
```

docs/features/REST-hubsites-method.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: HubSites REST method
3+
description: HubSites REST method
4+
ms.date: 2/26/2018
5+
---
6+
7+
# HubSites
8+
9+
> [!IMPORTANT]
10+
> The hub sites feature is currently in preview and is subject to change. It is not currently supported for use in production environments.
11+
12+
Gets information about all hub sites which the current user can access.
13+
14+
## HTTP request
15+
16+
```
17+
GET /_api/HubSites
18+
```
19+
20+
## URI Parameters
21+
22+
There are no parameters for this method.
23+
24+
## Request headers
25+
26+
| Header | Value |
27+
|--------|-------|
28+
|Accept|application/json;odata=verbose|
29+
|Content-Type|application/json;odata=verbose;charset=utf-8|
30+
|x-requestdigest|The appropriate digest for current site|
31+
32+
## Request body
33+
34+
Do not supply a request body for this method.
35+
36+
## Responses
37+
38+
| Name | Type | Description|
39+
|--------|-------|------------|
40+
|200 OK|SPHubSiteCollection |OK|
41+
42+
43+
## Examples
44+
45+
### Get list of hub sites
46+
47+
#### Sample Request
48+
49+
```HTTP
50+
GET
51+
https://contoso.sharepoint.com/_api/HubSites
52+
```
53+
54+
#### Sample Response
55+
**Status code:** 200
56+
57+
```JSON
58+
{
59+
"@odata.context": "https://contoso.sharepoint.com/_api/$metadata#hubsites",
60+
"value": [
61+
{
62+
"@odata.type": "#SP.HubSite",
63+
"@odata.id": "https://contoso.sharepoint.com/_api/SP.HubSite9dbd0488-5d8d-4ce6-941e-e5650bc216f4",
64+
"@odata.etag": "\"2\"",
65+
"@odata.editLink": "SP.HubSite9dbd0488-5d8d-4ce6-941e-e5650bc216f4",
66+
"Description": null,
67+
"ID": "82e8cb67-c4f1-4b38-80aa-0342294f5ece",
68+
"LogoUrl": "https://contoso.sharepoint.com/sites/ContosoTravelMarketing/SiteAssets/__hubLogo____hubLogo__.png",
69+
"SiteId": "82e8cb67-c4f1-4b38-80aa-0342294f5ece",
70+
"SiteUrl": "https://contoso.sharepoint.com/sites/ContosoTravelMarketing",
71+
"Targets": null,
72+
"TenantInstanceId": "00000000-0000-0000-0000-000000000000",
73+
"Title": "Contoso Travel Marketing"
74+
},
75+
{
76+
"@odata.type": "#SP.HubSite",
77+
"@odata.id": "https://contoso.sharepoint.com/_api/SP.HubSitee3e23fc3-870c-4de1-89c0-85b378e42b2e",
78+
"@odata.etag": "\"1\"",
79+
"@odata.editLink": "SP.HubSitee3e23fc3-870c-4de1-89c0-85b378e42b2e",
80+
"Description": null,
81+
"ID": "d8ab01e9-1634-44dd-91fe-1e6ff8385c34",
82+
"LogoUrl": "https://contoso.sharepoint.com/sites/ContosoDepartment/SiteAssets/__sitelogo__keep_calm_hit_refresh.png",
83+
"SiteId": "d8ab01e9-1634-44dd-91fe-1e6ff8385c34",
84+
"SiteUrl": "https://contoso.sharepoint.com/sites/ContosoDepartment",
85+
"Targets": null,
86+
"TenantInstanceId": "00000000-0000-0000-0000-000000000000",
87+
"Title": "Contoso Department Hub"
88+
}
89+
]
90+
}
91+
```

0 commit comments

Comments
 (0)