Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie im Artikel zum Thema Berechtigungen.
Berechtigungstyp
Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)
Delegiert (Geschäfts-, Schul- oder Unikonto)
User.ReadWrite, User.ReadWrite.All
Delegiert (persönliches Microsoft-Konto)
User.ReadWrite, User.ReadWrite.All
Anwendung
User.ReadWrite.All
HTTP-Anforderung
POST /me/profile/awards
POST /users/{id | userPrincipalName}/profile/awards
Anforderungsheader
Name
Beschreibung
Authorization
Bearer {token}. Erforderlich.
Content-Type
application/json. Erforderlich.
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des personAward-Objekts an.
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die festgelegt werden können, wenn ein neues personAward-Objekt im Profileines Benutzers erstellt wird.
Eigenschaft
Typ
Beschreibung
allowedAudiences
Zeichenfolge
Die Zielgruppen, die in der Lage sind, die in der Entität enthaltenen Werte anzuzeigen. Geerbt von itemFacet. Mögliche Werte: me, family, contacts, groupMembers, organization, federatedOrganizations, everyone, unknownFutureValue.
POST https://graph.microsoft.com/beta/me/profile/awards
Content-Type: application/json
{
"description": "Lifetime Achievement award from the International Association of Branding Managers",
"displayName": "Lifetime Achievement Award For Excellence in Branding",
"issuedDate": "Date",
"issuingAuthority": "International Association of Branding Management",
"thumbnailUrl": "https://iabm.io/sdhdfhsdhshsd.jpg",
"webUrl": "https://www.iabm.io"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var personAward = new PersonAward
{
Description = "Lifetime Achievement award from the International Association of Branding Managers",
DisplayName = "Lifetime Achievement Award For Excellence in Branding",
IssuedDate = new Date(1900,1,1),
IssuingAuthority = "International Association of Branding Management",
ThumbnailUrl = "https://iabm.io/sdhdfhsdhshsd.jpg",
WebUrl = "https://www.iabm.io"
};
await graphClient.Me.Profile.Awards
.Request()
.AddAsync(personAward);
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
const options = {
authProvider,
};
const client = Client.init(options);
const personAward = {
description: 'Lifetime Achievement award from the International Association of Branding Managers',
displayName: 'Lifetime Achievement Award For Excellence in Branding',
issuedDate: 'Date',
issuingAuthority: 'International Association of Branding Management',
thumbnailUrl: 'https://iabm.io/sdhdfhsdhshsd.jpg',
webUrl: 'https://www.iabm.io'
};
await client.api('/me/profile/awards')
.version('beta')
.post(personAward);
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/me/profile/awards"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphPersonAward *personAward = [[MSGraphPersonAward alloc] init];
[personAward setDescription:@"Lifetime Achievement award from the International Association of Branding Managers"];
[personAward setDisplayName:@"Lifetime Achievement Award For Excellence in Branding"];
[personAward setIssuedDate:@"Date"];
[personAward setIssuingAuthority:@"International Association of Branding Management"];
[personAward setThumbnailUrl:@"https://iabm.io/sdhdfhsdhshsd.jpg"];
[personAward setWebUrl:@"https://www.iabm.io"];
NSError *error;
NSData *personAwardData = [personAward getSerializedDataWithError:&error];
[urlRequest setHTTPBody:personAwardData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
PersonAward personAward = new PersonAward();
personAward.description = "Lifetime Achievement award from the International Association of Branding Managers";
personAward.displayName = "Lifetime Achievement Award For Excellence in Branding";
personAward.issuedDate = new DateOnly(1900,1,1);
personAward.issuingAuthority = "International Association of Branding Management";
personAward.thumbnailUrl = "https://iabm.io/sdhdfhsdhshsd.jpg";
personAward.webUrl = "https://www.iabm.io";
graphClient.me().profile().awards()
.buildRequest()
.post(personAward);
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewPersonAward()
description := "Lifetime Achievement award from the International Association of Branding Managers"
requestBody.SetDescription(&description)
displayName := "Lifetime Achievement Award For Excellence in Branding"
requestBody.SetDisplayName(&displayName)
issuedDate := "Date"
requestBody.SetIssuedDate(&issuedDate)
issuingAuthority := "International Association of Branding Management"
requestBody.SetIssuingAuthority(&issuingAuthority)
thumbnailUrl := "https://iabm.io/sdhdfhsdhshsd.jpg"
requestBody.SetThumbnailUrl(&thumbnailUrl)
webUrl := "https://www.iabm.io"
requestBody.SetWebUrl(&webUrl)
result, err := graphClient.Me().Profile().Awards().Post(requestBody)
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.
Import-Module Microsoft.Graph.People
$params = @{
Description = "Lifetime Achievement award from the International Association of Branding Managers"
DisplayName = "Lifetime Achievement Award For Excellence in Branding"
IssuedDate = "Date"
IssuingAuthority = "International Association of Branding Management"
ThumbnailUrl = "https://iabm.io/sdhdfhsdhshsd.jpg"
WebUrl = "https://www.iabm.io"
}
# A UPN can also be used as -UserId.
New-MgUserProfileAward -UserId $userId -BodyParameter $params
Wichtig
Microsoft Graph SDKs verwenden standardmäßig die Version 1.0 der API und unterstützen nicht alle Typen, Eigenschaften und APIs, die in der Betaversion verfügbar sind. Ausführliche Informationen zum Zugreifen auf die Beta-API mit dem SDK finden Sie unter Verwenden der Microsoft Graph-SDKs mit der Beta-API.