Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
UserActivity.ReadWrite.CreatedByApp
Not available.
Delegated (personal Microsoft account)
UserActivity.ReadWrite.CreatedByApp
Not available.
Application
Not supported.
Not supported.
HTTP request
DELETE /me/activities/{id}
Request headers
Name
Type
Description
Authorization
string
Bearer {token}. Required.
Request body
No request body.
Response
If successful, this method returns the 204 No Content response code if the activity was deleted.
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Me.Activities["{userActivity-id}"].DeleteAsync();
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.me().activities().byUserActivityId("{userActivity-id}").delete();
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->me()->activities()->byUserActivityId('userActivity-id')->delete()->wait();
Import-Module Microsoft.Graph.CrossDeviceExperiences
# A UPN can also be used as -UserId.
Remove-MgUserActivity -UserId $userId -UserActivityId $userActivityId
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedere https://aka.ms/ContentUserFeedback.