Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Aktualisieren sie die Eigenschaften eines linkedResource-Objekts .
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
✅ |
✅ |
❌ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
Tasks.ReadWrite |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Tasks.ReadWrite |
Nicht verfügbar. |
| Application |
Nicht unterstützt |
Nicht unterstützt |
HTTP-Anforderung
PATCH /me/todo/lists/{todoTaskListId}/tasks/{taskId}/linkedResources/{linkedResourcesId}
PATCH /users/{id|userPrincipalName}/todo/lists/{todoTaskListId}/tasks/{taskId}/linkedResources/{linkedResourcesId}
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des linkedResource-Objekts an.
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die beim Aktualisieren von linkedResource erforderlich sind.
| Eigenschaft |
Typ |
Beschreibung |
| id |
Zeichenfolge |
Vom Server generierte ID für die verknüpfte Entität, die von der Entität geerbt wurde |
Antwort
Bei erfolgreicher Ausführung gibt die Methode einen 200 OK Antwortcode und ein aktualisiertes linkedResource-Objekt im Antworttext zurück.
Beispiele
Anforderung
PATCH https://graph.microsoft.com/beta/me/todo/lists/dfsdc-f9dfdfs-dcsda9/tasks/e2dc-f9cce2-dce29/linkedResources/f9cddce2-dce2-f9cd-e2dc-cdf9e2dccdf9
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.linkedResource",
"webUrl": "http://microsoft.com",
"applicationName": "Microsoft",
"displayName": "Microsoft"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new LinkedResource
{
OdataType = "#microsoft.graph.linkedResource",
WebUrl = "http://microsoft.com",
ApplicationName = "Microsoft",
DisplayName = "Microsoft",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Todo.Lists["{todoTaskList-id}"].Tasks["{todoTask-id}"].LinkedResources["{linkedResource-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewLinkedResource()
webUrl := "http://microsoft.com"
requestBody.SetWebUrl(&webUrl)
applicationName := "Microsoft"
requestBody.SetApplicationName(&applicationName)
displayName := "Microsoft"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
linkedResources, err := graphClient.Me().Todo().Lists().ByTodoTaskListId("todoTaskList-id").Tasks().ByTodoTaskId("todoTask-id").LinkedResources().ByLinkedResourceId("linkedResource-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
LinkedResource linkedResource = new LinkedResource();
linkedResource.setOdataType("#microsoft.graph.linkedResource");
linkedResource.setWebUrl("http://microsoft.com");
linkedResource.setApplicationName("Microsoft");
linkedResource.setDisplayName("Microsoft");
LinkedResource result = graphClient.me().todo().lists().byTodoTaskListId("{todoTaskList-id}").tasks().byTodoTaskId("{todoTask-id}").linkedResources().byLinkedResourceId("{linkedResource-id}").patch(linkedResource);
const options = {
authProvider,
};
const client = Client.init(options);
const linkedResource = {
'@odata.type': '#microsoft.graph.linkedResource',
webUrl: 'http://microsoft.com',
applicationName: 'Microsoft',
displayName: 'Microsoft'
};
await client.api('/me/todo/lists/dfsdc-f9dfdfs-dcsda9/tasks/e2dc-f9cce2-dce29/linkedResources/f9cddce2-dce2-f9cd-e2dc-cdf9e2dccdf9')
.version('beta')
.update(linkedResource);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\LinkedResource;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new LinkedResource();
$requestBody->setOdataType('#microsoft.graph.linkedResource');
$requestBody->setWebUrl('http://microsoft.com');
$requestBody->setApplicationName('Microsoft');
$requestBody->setDisplayName('Microsoft');
$result = $graphServiceClient->me()->todo()->lists()->byTodoTaskListId('todoTaskList-id')->tasks()->byTodoTaskId('todoTask-id')->linkedResources()->byLinkedResourceId('linkedResource-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Users
$params = @{
"@odata.type" = "#microsoft.graph.linkedResource"
webUrl = "http://microsoft.com"
applicationName = "Microsoft"
displayName = "Microsoft"
}
# A UPN can also be used as -UserId.
Update-MgBetaUserTodoListTaskLinkedResource -UserId $userId -TodoTaskListId $todoTaskListId -TodoTaskId $todoTaskId -LinkedResourceId $linkedResourceId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.linked_resource import LinkedResource
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = LinkedResource(
odata_type = "#microsoft.graph.linkedResource",
web_url = "http://microsoft.com",
application_name = "Microsoft",
display_name = "Microsoft",
)
result = await graph_client.me.todo.lists.by_todo_task_list_id('todoTaskList-id').tasks.by_todo_task_id('todoTask-id').linked_resources.by_linked_resource_id('linkedResource-id').patch(request_body)
Antwort
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.linkedResource",
"id": "f9cddce2-dce2-f9cd-e2dc-cdf9e2dccdf9",
"webUrl": "http://microsoft.com",
"applicationName": "Microsoft",
"displayName": "Microsoft",
"externalId": "dk9cddce2-dce2-f9dd-e2dc-cdf9e2dccdf9"
}