Skip to content

Commit

Permalink
Merge pull request #25924 from microsoftgraph/main
Browse files Browse the repository at this point in the history
Merge to publish.
  • Loading branch information
Lauragra authored Dec 14, 2024
2 parents 403ae38 + 65ee90b commit 84eb0bc
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 153 deletions.
91 changes: 15 additions & 76 deletions api-reference/beta/api/site-get.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,50 +59,16 @@ GET /groups/{group-id}/sites/root
### Example 1: Get a site using the site ID
#### Request

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).

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

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

# [C#](#tab/csharp)
[!INCLUDE [sample-code](../includes/snippets/csharp/get-site-csharp-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [CLI](#tab/cli)
[!INCLUDE [sample-code](../includes/snippets/cli/get-site-cli-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Go](#tab/go)
[!INCLUDE [sample-code](../includes/snippets/go/get-site-go-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Java](#tab/java)
[!INCLUDE [sample-code](../includes/snippets/java/get-site-java-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [JavaScript](#tab/javascript)
[!INCLUDE [sample-code](../includes/snippets/javascript/get-site-javascript-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [PHP](#tab/php)
[!INCLUDE [sample-code](../includes/snippets/php/get-site-php-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [PowerShell](#tab/powershell)
[!INCLUDE [sample-code](../includes/snippets/powershell/get-site-powershell-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Python](#tab/python)
[!INCLUDE [sample-code](../includes/snippets/python/get-site-python-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

---

#### Response

The following example shows the response.
<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->

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

### Example 2: Get a site by server relative URL
#### Request
<!-- { "blockType": "request", "name": "get-site-by-url", "scopes": "sites.read.all" } -->

The following example shows a request that gets a site by its hostname and server relative path.

<!-- { "blockType": "request", "name": "get-site-by-url", "scopes": "sites.read.all", "sampleKeys": ["contoso.sharepoint.com:/teams/1drvteam"] } -->
```http
GET https://graph.microsoft.com/v1.0/sites/{hostname}:/{server-relative-path}
GET https://graph.microsoft.com/beta/sites/contoso.sharepoint.com:/teams/1drvteam
```

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

### Example 3: Get the site of a group
#### Request
# [HTTP](#tab/http)
The following example shows a request that gets a group's site by the **id** property of a [group](../resources/group.md).

<!-- { "blockType": "request", "name": "get-site-by-group"} -->
```msgraph-interactive
GET https://graph.microsoft.com/v1.0/groups/{group-id}/sites/root
GET https://graph.microsoft.com/beta/groups/2C712604-1370-44E7-A1F5-426573FDA80A/sites/root
```

# [C#](#tab/csharp)
[!INCLUDE [sample-code](../includes/snippets/csharp/get-site-by-group-csharp-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [CLI](#tab/cli)
[!INCLUDE [sample-code](../includes/snippets/cli/get-site-by-group-cli-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Go](#tab/go)
[!INCLUDE [sample-code](../includes/snippets/go/get-site-by-group-go-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Java](#tab/java)
[!INCLUDE [sample-code](../includes/snippets/java/get-site-by-group-java-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [JavaScript](#tab/javascript)
[!INCLUDE [sample-code](../includes/snippets/javascript/get-site-by-group-javascript-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [PHP](#tab/php)
[!INCLUDE [sample-code](../includes/snippets/php/get-site-by-group-php-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [PowerShell](#tab/powershell)
[!INCLUDE [sample-code](../includes/snippets/powershell/get-site-by-group-powershell-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Python](#tab/python)
[!INCLUDE [sample-code](../includes/snippets/python/get-site-by-group-python-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

---

#### Response
The following example shows the response.

<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->
```http
HTTP/1.1 200 OK
Expand Down
88 changes: 13 additions & 75 deletions api-reference/v1.0/api/site-get.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,49 +63,16 @@ GET /groups/{group-id}/sites/root
### Example 1: Get a site using the site ID
#### Request

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).

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

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

# [C#](#tab/csharp)
[!INCLUDE [sample-code](../includes/snippets/csharp/get-site-csharp-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [CLI](#tab/cli)
[!INCLUDE [sample-code](../includes/snippets/cli/get-site-cli-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Go](#tab/go)
[!INCLUDE [sample-code](../includes/snippets/go/get-site-go-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Java](#tab/java)
[!INCLUDE [sample-code](../includes/snippets/java/get-site-java-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [JavaScript](#tab/javascript)
[!INCLUDE [sample-code](../includes/snippets/javascript/get-site-javascript-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [PHP](#tab/php)
[!INCLUDE [sample-code](../includes/snippets/php/get-site-php-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [PowerShell](#tab/powershell)
[!INCLUDE [sample-code](../includes/snippets/powershell/get-site-powershell-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Python](#tab/python)
[!INCLUDE [sample-code](../includes/snippets/python/get-site-python-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

---

#### Response
The following example shows the response.

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

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

### Example 2: Get a site by server relative URL
#### Request
<!-- { "blockType": "request", "name": "get-site-by-url", "scopes": "sites.read.all" } -->
The following example shows a request that gets a site by its hostname and server relative path.

<!-- { "blockType": "request", "name": "get-site-by-url", "scopes": "sites.read.all", "sampleKeys": ["contoso.sharepoint.com:/teams/1drvteam"] } -->
```http
GET https://graph.microsoft.com/v1.0/sites/{hostname}:/{server-relative-path}
GET https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/teams/1drvteam
```

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

### Example 3: Get the site of a group
#### Request
# [HTTP](#tab/http)
The following example shows a request that gets a group's site by the **id** property of a [group](../resources/group.md).

<!-- { "blockType": "request", "name": "get-site-by-group"} -->
```msgraph-interactive
GET https://graph.microsoft.com/v1.0/groups/{group-id}/sites/root
GET https://graph.microsoft.com/v1.0/groups/2C712604-1370-44E7-A1F5-426573FDA80A/sites/root
```

# [C#](#tab/csharp)
[!INCLUDE [sample-code](../includes/snippets/csharp/get-site-by-group-csharp-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [CLI](#tab/cli)
[!INCLUDE [sample-code](../includes/snippets/cli/get-site-by-group-cli-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Go](#tab/go)
[!INCLUDE [sample-code](../includes/snippets/go/get-site-by-group-go-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Java](#tab/java)
[!INCLUDE [sample-code](../includes/snippets/java/get-site-by-group-java-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [JavaScript](#tab/javascript)
[!INCLUDE [sample-code](../includes/snippets/javascript/get-site-by-group-javascript-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [PHP](#tab/php)
[!INCLUDE [sample-code](../includes/snippets/php/get-site-by-group-php-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [PowerShell](#tab/powershell)
[!INCLUDE [sample-code](../includes/snippets/powershell/get-site-by-group-powershell-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

# [Python](#tab/python)
[!INCLUDE [sample-code](../includes/snippets/python/get-site-by-group-python-snippets.md)]
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]

---

#### Response
The following example shows the response.
<!-- { "blockType": "response", "@type": "microsoft.graph.site", "truncated": true } -->
```http
HTTP/1.1 200 OK
Expand Down
4 changes: 2 additions & 2 deletions concepts/migrate-azure-ad-graph-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ If you own an application's source code, search for the `https://graph.windows.n

## As an IT admin, how do I identify apps in my tenant that use Azure AD Graph?

Use one of the following three methods to identify apps in your tenant with a dependency on Azure AD Graph.
Use the following four methods to identify apps in your tenant with a dependency on Azure AD Graph. Method 1 and 2 identify your apps that use Azure AD Graph based on the actual app activities while method 3 and 4 use static app configuration and consent status. You can combine these methods to find apps that have a dependency on Azure AD Graph.

### Method 1: Through network proxy logs

Expand All @@ -67,7 +67,7 @@ Check your network server traffic logs through a filter proxy for any apps calli

:::image type="content" source="/graph/images/aadgraph-to-msgraph-migration/RequestedAPI-AAD.png" alt-text="Filter apps that use Azure AD Graph." border="true":::

### Method 3: Use a PowerShell script
### Method 4: Use a PowerShell script

Download and run [this PowerShell script](https://github.com/microsoft/AzureADGraphApps). Use this method to retrieve apps with their home directory in your tenant and apps with their home directories in other tenants.

Expand Down
12 changes: 12 additions & 0 deletions concepts/sdks/create-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,36 @@ The client ID is the app registration ID that is generated when you [register yo

:::code language="csharp" source="./snippets/dotnet/src/SdkSnippets/Snippets/CreateClients.cs" id="DeviceCodeSnippet":::

> Include `using` statements for `Azure.Identity` and `Microsoft.Graph` to run this code.
# [Go](#tab/go)

:::code language="go" source="./snippets/go/src/snippets/create_clients.go" id="DeviceCodeSnippet":::

> Include `"github.com/Azure/azure-sdk-for-go/sdk/azidentity"` and `graph "github.com/microsoftgraph/msgraph-sdk-go"` in your import block to run this code.
# [Java](#tab/java)

:::code language="java" source="./snippets/java/app/src/main/java/snippets/CreateClients.java" id="DeviceCodeSnippet":::

> Include `import` statements for `com.azure.identity.DeviceCodeCredential`, `com.azure.identity.DeviceCodeCredentialBuilder`, and `com.microsoft.graph.serviceclient.GraphServiceClient` to run this code.
# [PHP](#tab/php)

:::code language="php" source="./snippets/php/snippets/CreateClients.php" id="AuthorizationCodeSnippet":::

> Include `use` statements for `Microsoft\Graph\GraphRequestAdapter`, `Microsoft\Graph\GraphServiceClient`, and `Microsoft\Kiota\Abstractions\Authentication\BaseBearerTokenAuthenticationProvider` to run this code.
# [Python](#tab/python)

:::code language="python" source="./snippets/python/src/snippets/create_clients.py" id="DeviceCodeSnippet":::

> Include `import` statements for `DeviceCodeCredential` from `azure.identity` and `GraphServiceClient` from `msgraph.graph_service_client` to run this code.
# [TypeScript](#tab/typescript)

:::code language="typescript" source="./snippets/typescript/src/snippets/createClients.ts" id="DeviceCodeSnippet":::

> Include `import` statements for `DeviceCodeCredential` from `@azure/identity`, `Client` from `@microsoft/microsoft-graph-client`, and `TokenCredentialAuthenticationProvider` from `@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials` to run this code.
---

0 comments on commit 84eb0bc

Please sign in to comment.