Uma das seguintes permissões é obrigatória para chamar esta API. Para saber mais, incluindo como escolher permissões, confira Permissões.
Tipo de permissão
Permissões (da com menos para a com mais privilégios)
Delegado (conta corporativa ou de estudante)
User.ReadWrite, User.ReadWrite.All
Delegado (conta pessoal da Microsoft)
User.ReadWrite, User.ReadWrite.All
Aplicativo
User.ReadWrite.All
Solicitação HTTP
POST /me/profile/awards
POST /users/{id | userPrincipalName}/profile/awards
Cabeçalhos de solicitação
Nome
Descrição
Autorização
{token} de portador. Obrigatório.
Content-Type
application/json. Obrigatório.
Corpo da solicitação
No corpo da solicitação, fornece uma representação JSON do objeto personAward.
A tabela a seguir mostra as propriedades que são possíveis de definir ao criar um novo objeto personAward no perfil de um usuário.
Propriedade
Tipo
Descrição
allowedAudiences
Cadeia de caracteres
As audiências que são capazes de ver os valores contidos na entidade. Herdado do itemFacet. Os valores possíveis são: 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);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
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);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
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];
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
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);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
//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)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
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
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não dão suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.