1
1
---
2
2
title : GetById REST method
3
3
description : Gets or updates information about a hub site.
4
- ms.date : 06/28/2022
4
+ ms.date : 03/17/2023
5
5
ms.localizationpriority : medium
6
6
---
7
7
@@ -30,8 +30,6 @@ POST /_api/HubSites/GetById
30
30
| Content-Type| application/json;odata=verbose;charset=utf-8|
31
31
| x-requestdigest| The appropriate digest for current site.|
32
32
33
- <br />
34
-
35
33
When using POST to update a hub site with new information, use the following additional header values:
36
34
37
35
| Header | Value |
@@ -63,8 +61,7 @@ For GET, no request body is needed. When using POST to update a hub site with ne
63
61
#### Sample request
64
62
65
63
``` HTTP
66
- GET
67
- https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-499c-92db-38800eefbe44'
64
+ GET https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-499c-92db-38800eefbe44'
68
65
```
69
66
70
67
#### Sample response
@@ -73,19 +70,19 @@ https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-49
73
70
74
71
``` JSON
75
72
{
76
- "@odata.context" : " https://contoso.sharepoint.com/_api/$metadata#hubsites/$entity" ,
77
- "@odata.type" : " #SP.HubSite" ,
78
- "@odata.id" : " https://contoso.sharepoint.com/_api/HubSites/GetById" ,
79
- "@odata.etag" : " \" 3\" " ,
80
- "@odata.editLink" : " HubSites/GetById" ,
81
- "Description" : null ,
82
- "ID" : " f93eff08-5806-499c-92db-38800eefbe44" ,
83
- "LogoUrl" : " https://contoso.sharepoint.com/sites/marketing/SiteAssets/__hubLogo____hubLogo__.png" ,
84
- "SiteId" : " f93eff08-5806-499c-92db-38800eefbe44" ,
85
- "SiteUrl" : " https://contoso.sharepoint.com/sites/marketing" ,
86
- "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>" ,
87
- "TenantInstanceId" : " 00000000-0000-0000-0000-000000000000" ,
88
- "Title" : " "
73
+ "@odata.context" : " https://contoso.sharepoint.com/_api/$metadata#hubsites/$entity" ,
74
+ "@odata.type" : " #SP.HubSite" ,
75
+ "@odata.id" : " https://contoso.sharepoint.com/_api/HubSites/GetById" ,
76
+ "@odata.etag" : " \" 3\" " ,
77
+ "@odata.editLink" : " HubSites/GetById" ,
78
+ "Description" : null ,
79
+ "ID" : " f93eff08-5806-499c-92db-38800eefbe44" ,
80
+ "LogoUrl" : " https://contoso.sharepoint.com/sites/marketing/SiteAssets/__hubLogo____hubLogo__.png" ,
81
+ "SiteId" : " f93eff08-5806-499c-92db-38800eefbe44" ,
82
+ "SiteUrl" : " https://contoso.sharepoint.com/sites/marketing" ,
83
+ "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>" ,
84
+ "TenantInstanceId" : " 00000000-0000-0000-0000-000000000000" ,
85
+ "Title" : " "
89
86
}
90
87
```
91
88
@@ -94,8 +91,7 @@ https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-49
94
91
#### Sample request
95
92
96
93
``` HTTP
97
- POST
98
- https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-499c-92db-38800eefbe44'
94
+ POST https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-499c-92db-38800eefbe44'
99
95
```
100
96
101
97
#### Sample response
@@ -110,6 +106,28 @@ https://contoso.sharepoint.com/_api/HubSites/GetById?hubSiteId='f93eff08-5806-49
110
106
}
111
107
```
112
108
109
+ ### Associate a hub with another hub (parent hub association)
110
+
111
+ #### Sample request
112
+
113
+ ``` HTTP
114
+ POST https://contoso.sharepoint.com/_api/HubSites/GetById('f93eff08-5806-499c-92db-38800eefbe44')
115
+ ```
116
+
117
+ ``` JSON
118
+ {
119
+ "__metadata" : { "type" : " SP.HubSite" },
120
+ "Title" :" Marketing hub site" ,
121
+ "LogoUrl" : " https://contoso.sharepoint.com/sites/marketing/SiteAssets/__hubLogo____hubLogo__.png" ,
122
+ "Description" : " Hub site for marketing coordination" ,
123
+ "ParentHubSiteId" :" 269da5d4-6a9e-45a5-9502-a74d14977293"
124
+ }
125
+ ```
126
+
127
+ #### Sample response
128
+
129
+ ** Status code:** 204
130
+
113
131
## See also
114
132
115
133
- [ Hub site REST API] ( hub-site-rest-api.md )
0 commit comments