列出 schemaExtension
命名空间:microsoft.graph
获取租户中的 schemaExtension 对象列表。 架构扩展可以是InDevelopment``Available,也可以Deprecated包括架构扩展:
- 由你在当前租户中拥有的任何应用创建。
- 由标记为
Available.. 的其他应用拥有。
- 由其他开发人员从其他租户创建,并标记为
Available。 这不同于仅返回租户特定数据的其他 API。 基于架构扩展定义创建的扩展数据特定于租户,只能由显式授予权限的应用访问。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
User.Read、Application.Read.All |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| 应用程序 |
Application.Read.All |
HTTP 请求
GET /schemaExtensions
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
| Content-Type |
application/json |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回一个 200 OK 响应代码和 schemaExtension 对象集合。
示例
请求
以下示例演示如何通过筛选特定扩展的唯一 ID,在所有可访问的扩展之间进行查找。
GET https://graph.microsoft.com/v1.0/schemaExtensions?$filter=id%20eq%20'graphlearn_test'
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var schemaExtensions = await graphClient.SchemaExtensions
.Request()
.Filter("id eq 'graphlearn_test'")
.GetAsync();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let schemaExtensions = await client.api('/schemaExtensions')
.filter('id eq \'graphlearn_test\'')
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/schemaExtensions?$filter=id%20eq%20'graphlearn_test'"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphSchemaExtension *schemaExtension = [[MSGraphSchemaExtension alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
SchemaExtensionCollectionPage schemaExtensions = graphClient.schemaExtensions()
.buildRequest()
.filter("id eq 'graphlearn_test'")
.get();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestParameters := &msgraphsdk.SchemaExtensionsRequestBuilderGetQueryParameters{
Filter: "id%20eq%20'graphlearn_test'",
}
options := &msgraphsdk.SchemaExtensionsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
result, err := graphClient.SchemaExtensions().GetWithRequestConfigurationAndResponseHandler(options, nil)
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.SchemaExtensions
Get-MgSchemaExtension -Filter "id eq 'graphlearn_test'"
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档。
响应
这是一个示例响应。注意:为提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"id":"graphlearn_test",
"description": "Yet another test schema",
"targetTypes": [
"User", "Group"
],
"status": "InDevelopment",
"owner": "24d3b144-21ae-4080-943f-7067b395b913",
"properties": [
{
"name": "testName",
"type": "String"
}
]
}
]
}
另请参阅