Выберите разрешение или разрешения, помеченные как наименее привилегированные для этого API. Используйте более привилегированное разрешение или разрешения только в том случае, если это требуется приложению. Дополнительные сведения о делегированных разрешениях и разрешениях приложений см. в разделе Типы разрешений. Дополнительные сведения об этих разрешениях см. в справочнике по разрешениям.
Тип разрешения
Разрешения с наименьшими привилегиями
Более высокие привилегированные разрешения
Делегированные (рабочая или учебная учетная запись)
В тексте запроса укажите представление объекта аббревиатуры в формате JSON.
В следующей таблице показаны свойства, доступные при создании аббревиатуры.
Свойство
Тип
Описание
description
String
Краткое описание аббревиатуры, которая предоставляет пользователям дополнительные сведения об аббревиатуре и о том, что она означает. Наследуется от searchAnswer.
displayName
String
Фактическая краткая форма или аббревиатура. Наследуется от searchAnswer.
standsFor
String
Что означает аббревиатура.
state
microsoft.graph.search.answerState
Состояние аббревиатуры. Возможные значения: published, draft, excluded, unknownFutureValue.
webUrl
String
URL-адрес страницы или веб-сайта, куда пользователи могут перейти для получения дополнительных сведений об аббревиатуре. Наследуется от searchAnswer.
Отклик
В случае успешного 201 Created выполнения этот метод возвращает код ответа с идентификатором созданной аббревиатуры.
POST https://graph.microsoft.com/v1.0/search/acronyms
Content-Type: application/json
{
"displayName": "DNN",
"standsFor": "Deep Neural Network",
"description": "A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers.",
"webUrl": "http://microsoft.com/deep-neural-network",
"state": "draft"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.Search;
var requestBody = new Acronym
{
DisplayName = "DNN",
StandsFor = "Deep Neural Network",
Description = "A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers.",
WebUrl = "http://microsoft.com/deep-neural-network",
State = AnswerState.Draft,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Search.Acronyms.PostAsync(requestBody);
mgc search acronyms create --body '{\
"displayName": "DNN",\
"standsFor": "Deep Neural Network",\
"description": "A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers.",\
"webUrl": "http://microsoft.com/deep-neural-network",\
"state": "draft"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodelssearch "github.com/microsoftgraph/msgraph-sdk-go/models/search"
//other-imports
)
requestBody := graphmodelssearch.NewAcronym()
displayName := "DNN"
requestBody.SetDisplayName(&displayName)
standsFor := "Deep Neural Network"
requestBody.SetStandsFor(&standsFor)
description := "A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers."
requestBody.SetDescription(&description)
webUrl := "http://microsoft.com/deep-neural-network"
requestBody.SetWebUrl(&webUrl)
state := graphmodels.DRAFT_ANSWERSTATE
requestBody.SetState(&state)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
acronyms, err := graphClient.Search().Acronyms().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.search.Acronym acronym = new com.microsoft.graph.models.search.Acronym();
acronym.setDisplayName("DNN");
acronym.setStandsFor("Deep Neural Network");
acronym.setDescription("A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers.");
acronym.setWebUrl("http://microsoft.com/deep-neural-network");
acronym.setState(com.microsoft.graph.models.search.AnswerState.Draft);
com.microsoft.graph.models.search.Acronym result = graphClient.search().acronyms().post(acronym);
const options = {
authProvider,
};
const client = Client.init(options);
const acronym = {
displayName: 'DNN',
standsFor: 'Deep Neural Network',
description: 'A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers.',
webUrl: 'http://microsoft.com/deep-neural-network',
state: 'draft'
};
await client.api('/search/acronyms')
.post(acronym);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\Search\Acronym;
use Microsoft\Graph\Generated\Models\Search\AnswerState;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Acronym();
$requestBody->setDisplayName('DNN');
$requestBody->setStandsFor('Deep Neural Network');
$requestBody->setDescription('A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers.');
$requestBody->setWebUrl('http://microsoft.com/deep-neural-network');
$requestBody->setState(new AnswerState('draft'));
$result = $graphServiceClient->search()->acronyms()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Search
$params = @{
displayName = "DNN"
standsFor = "Deep Neural Network"
description = "A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers."
webUrl = "http://microsoft.com/deep-neural-network"
state = "draft"
}
New-MgSearchAcronym -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.search.acronym import Acronym
from msgraph.generated.models.answer_state import AnswerState
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Acronym(
display_name = "DNN",
stands_for = "Deep Neural Network",
description = "A deep neural network is a neural network with a certain level of complexity, a neural network with more than two layers.",
web_url = "http://microsoft.com/deep-neural-network",
state = AnswerState.Draft,
)
result = await graph_client.search.acronyms.post(request_body)