Skip to content

Commit cc73fa4

Browse files
authored
Merge pull request #25790 from microsoftgraph/introduce-sharepoint-request-examples
Added descriptive introductions to site-get.md files.
2 parents 201bdb7 + 3bdc805 commit cc73fa4

File tree

2 files changed

+28
-151
lines changed

2 files changed

+28
-151
lines changed

api-reference/beta/api/site-get.md

Lines changed: 15 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -59,50 +59,16 @@ GET /groups/{group-id}/sites/root
5959
### Example 1: Get a site using the site ID
6060
#### Request
6161

62+
The following example shows a request that gets a site by its site ID. A site ID is the value of the **id** property of its **site** resource. For more information on the format of the site ID, see [site](../resources/site.md#id-property).
6263

63-
# [HTTP](#tab/http)
64-
<!-- { "blockType": "request", "name": "get-site" } -->
64+
<!-- { "blockType": "request", "name": "get-site", "sampleKeys": ["contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"] } -->
6565

6666
```msgraph-interactive
67-
GET /sites/{site-id}
67+
GET https://graph.microsoft.com/beta/sites/contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE
6868
```
6969

70-
# [C#](#tab/csharp)
71-
[!INCLUDE [sample-code](../includes/snippets/csharp/get-site-csharp-snippets.md)]
72-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
73-
74-
# [CLI](#tab/cli)
75-
[!INCLUDE [sample-code](../includes/snippets/cli/get-site-cli-snippets.md)]
76-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
77-
78-
# [Go](#tab/go)
79-
[!INCLUDE [sample-code](../includes/snippets/go/get-site-go-snippets.md)]
80-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
81-
82-
# [Java](#tab/java)
83-
[!INCLUDE [sample-code](../includes/snippets/java/get-site-java-snippets.md)]
84-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
85-
86-
# [JavaScript](#tab/javascript)
87-
[!INCLUDE [sample-code](../includes/snippets/javascript/get-site-javascript-snippets.md)]
88-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
89-
90-
# [PHP](#tab/php)
91-
[!INCLUDE [sample-code](../includes/snippets/php/get-site-php-snippets.md)]
92-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
93-
94-
# [PowerShell](#tab/powershell)
95-
[!INCLUDE [sample-code](../includes/snippets/powershell/get-site-powershell-snippets.md)]
96-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
97-
98-
# [Python](#tab/python)
99-
[!INCLUDE [sample-code](../includes/snippets/python/get-site-python-snippets.md)]
100-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
101-
102-
---
103-
10470
#### Response
105-
71+
The following example shows the response.
10672
<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->
10773

10874
```http
@@ -127,12 +93,16 @@ Content-type: application/json
12793

12894
### Example 2: Get a site by server relative URL
12995
#### Request
130-
<!-- { "blockType": "request", "name": "get-site-by-url", "scopes": "sites.read.all" } -->
96+
97+
The following example shows a request that gets a site by its hostname and server relative path.
98+
99+
<!-- { "blockType": "request", "name": "get-site-by-url", "scopes": "sites.read.all", "sampleKeys": ["contoso.sharepoint.com:/teams/1drvteam"] } -->
131100
```http
132-
GET https://graph.microsoft.com/v1.0/sites/{hostname}:/{server-relative-path}
101+
GET https://graph.microsoft.com/beta/sites/contoso.sharepoint.com:/teams/1drvteam
133102
```
134103

135104
#### Response
105+
The following example shows the response.
136106
<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->
137107
```http
138108
HTTP/1.1 200 OK
@@ -150,47 +120,16 @@ Content-type: application/json
150120

151121
### Example 3: Get the site of a group
152122
#### Request
153-
# [HTTP](#tab/http)
123+
The following example shows a request that gets a group's site by the **id** property of a [group](../resources/group.md).
124+
154125
<!-- { "blockType": "request", "name": "get-site-by-group"} -->
155126
```msgraph-interactive
156-
GET https://graph.microsoft.com/v1.0/groups/{group-id}/sites/root
127+
GET https://graph.microsoft.com/beta/groups/2C712604-1370-44E7-A1F5-426573FDA80A/sites/root
157128
```
158129

159-
# [C#](#tab/csharp)
160-
[!INCLUDE [sample-code](../includes/snippets/csharp/get-site-by-group-csharp-snippets.md)]
161-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
162-
163-
# [CLI](#tab/cli)
164-
[!INCLUDE [sample-code](../includes/snippets/cli/get-site-by-group-cli-snippets.md)]
165-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
166-
167-
# [Go](#tab/go)
168-
[!INCLUDE [sample-code](../includes/snippets/go/get-site-by-group-go-snippets.md)]
169-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
170-
171-
# [Java](#tab/java)
172-
[!INCLUDE [sample-code](../includes/snippets/java/get-site-by-group-java-snippets.md)]
173-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
174-
175-
# [JavaScript](#tab/javascript)
176-
[!INCLUDE [sample-code](../includes/snippets/javascript/get-site-by-group-javascript-snippets.md)]
177-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
178-
179-
# [PHP](#tab/php)
180-
[!INCLUDE [sample-code](../includes/snippets/php/get-site-by-group-php-snippets.md)]
181-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
182-
183-
# [PowerShell](#tab/powershell)
184-
[!INCLUDE [sample-code](../includes/snippets/powershell/get-site-by-group-powershell-snippets.md)]
185-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
186-
187-
# [Python](#tab/python)
188-
[!INCLUDE [sample-code](../includes/snippets/python/get-site-by-group-python-snippets.md)]
189-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
190-
191-
---
192-
193130
#### Response
131+
The following example shows the response.
132+
194133
<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->
195134
```http
196135
HTTP/1.1 200 OK

api-reference/v1.0/api/site-get.md

Lines changed: 13 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -63,49 +63,16 @@ GET /groups/{group-id}/sites/root
6363
### Example 1: Get a site using the site ID
6464
#### Request
6565

66+
The following example shows a request that gets a site by its site ID. A site ID is the value of the **id** property of its **site** resource. For more information on the format of the site ID, see [site](../resources/site.md#id-property).
6667

67-
# [HTTP](#tab/http)
68-
<!-- { "blockType": "request", "name": "get-site", "scopes": "sites.read.all" } -->
68+
<!-- { "blockType": "request", "name": "get-site", "scopes": "sites.read.all", "sampleKeys": ["contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"] } -->
6969

7070
```msgraph-interactive
71-
GET https://graph.microsoft.com/v1.0/sites/{site-id}
71+
GET https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE
7272
```
7373

74-
# [C#](#tab/csharp)
75-
[!INCLUDE [sample-code](../includes/snippets/csharp/get-site-csharp-snippets.md)]
76-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
77-
78-
# [CLI](#tab/cli)
79-
[!INCLUDE [sample-code](../includes/snippets/cli/get-site-cli-snippets.md)]
80-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
81-
82-
# [Go](#tab/go)
83-
[!INCLUDE [sample-code](../includes/snippets/go/get-site-go-snippets.md)]
84-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
85-
86-
# [Java](#tab/java)
87-
[!INCLUDE [sample-code](../includes/snippets/java/get-site-java-snippets.md)]
88-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
89-
90-
# [JavaScript](#tab/javascript)
91-
[!INCLUDE [sample-code](../includes/snippets/javascript/get-site-javascript-snippets.md)]
92-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
93-
94-
# [PHP](#tab/php)
95-
[!INCLUDE [sample-code](../includes/snippets/php/get-site-php-snippets.md)]
96-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
97-
98-
# [PowerShell](#tab/powershell)
99-
[!INCLUDE [sample-code](../includes/snippets/powershell/get-site-powershell-snippets.md)]
100-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
101-
102-
# [Python](#tab/python)
103-
[!INCLUDE [sample-code](../includes/snippets/python/get-site-python-snippets.md)]
104-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
105-
106-
---
107-
10874
#### Response
75+
The following example shows the response.
10976

11077
<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->
11178

@@ -126,12 +93,15 @@ Content-type: application/json
12693

12794
### Example 2: Get a site by server relative URL
12895
#### Request
129-
<!-- { "blockType": "request", "name": "get-site-by-url", "scopes": "sites.read.all" } -->
96+
The following example shows a request that gets a site by its hostname and server relative path.
97+
98+
<!-- { "blockType": "request", "name": "get-site-by-url", "scopes": "sites.read.all", "sampleKeys": ["contoso.sharepoint.com:/teams/1drvteam"] } -->
13099
```http
131-
GET https://graph.microsoft.com/v1.0/sites/{hostname}:/{server-relative-path}
100+
GET https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/teams/1drvteam
132101
```
133102

134103
#### Response
104+
The following example shows the response.
135105
<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->
136106
```http
137107
HTTP/1.1 200 OK
@@ -149,47 +119,15 @@ Content-type: application/json
149119

150120
### Example 3: Get the site of a group
151121
#### Request
152-
# [HTTP](#tab/http)
122+
The following example shows a request that gets a group's site by the **id** property of a [group](../resources/group.md).
123+
153124
<!-- { "blockType": "request", "name": "get-site-by-group"} -->
154125
```msgraph-interactive
155-
GET https://graph.microsoft.com/v1.0/groups/{group-id}/sites/root
126+
GET https://graph.microsoft.com/v1.0/groups/2C712604-1370-44E7-A1F5-426573FDA80A/sites/root
156127
```
157128

158-
# [C#](#tab/csharp)
159-
[!INCLUDE [sample-code](../includes/snippets/csharp/get-site-by-group-csharp-snippets.md)]
160-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
161-
162-
# [CLI](#tab/cli)
163-
[!INCLUDE [sample-code](../includes/snippets/cli/get-site-by-group-cli-snippets.md)]
164-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
165-
166-
# [Go](#tab/go)
167-
[!INCLUDE [sample-code](../includes/snippets/go/get-site-by-group-go-snippets.md)]
168-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
169-
170-
# [Java](#tab/java)
171-
[!INCLUDE [sample-code](../includes/snippets/java/get-site-by-group-java-snippets.md)]
172-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
173-
174-
# [JavaScript](#tab/javascript)
175-
[!INCLUDE [sample-code](../includes/snippets/javascript/get-site-by-group-javascript-snippets.md)]
176-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
177-
178-
# [PHP](#tab/php)
179-
[!INCLUDE [sample-code](../includes/snippets/php/get-site-by-group-php-snippets.md)]
180-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
181-
182-
# [PowerShell](#tab/powershell)
183-
[!INCLUDE [sample-code](../includes/snippets/powershell/get-site-by-group-powershell-snippets.md)]
184-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
185-
186-
# [Python](#tab/python)
187-
[!INCLUDE [sample-code](../includes/snippets/python/get-site-by-group-python-snippets.md)]
188-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
189-
190-
---
191-
192129
#### Response
130+
The following example shows the response.
193131
<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->
194132
```http
195133
HTTP/1.1 200 OK

0 commit comments

Comments
 (0)