当前位置:网站首页>Msgraphmailbag - search only driveitems of file types
Msgraphmailbag - search only driveitems of file types
2022-07-04 04:00:00 【Justin-Liu】
In this article we will use Microsoft Graph Upper Microsoft Search API To get only files / The results of the document .
introduction
Let's consider how to use Microsoft Graph Upper Microsoft Search API To search for OneDrive or SharePoint File on / file . By default , When you specify driveItem Of entityType when , This will return the file 、 Folder 、 Pages and news . Here's one from Microsoft Graph An example of a resource manager , Used for query driveItem Content .
POST https://graph.microsoft.com/v1.0/search/query
{
"requests":[
{
"entityTypes":[
"driveItem"
],
"query":{
"queryString":"contoso"
}
}
]
}
The following figure is an example of the result , The first result is a web page file .
Solution
To filter only files / file , We can ask for query Elemental queryString Add any of the following to the properties (ContentType or ContentTypeId).
"query": {
"queryString": "test document AND ContentType:Document"
}
or
"query": {
"queryString": "test document AND ContentTypeId:0x0101*"
}
Let's take a look at the same environment , The result after applying the filter , Here's the picture , The first result is the file .
The final query used is
POST https://graph.microsoft.com/v1.0/search/query
{
"requests":[
{
"entityTypes":[
"driveItem"
],
"query":{
"queryString":"contoso AND ContentType:Document"
}
}
]
}
边栏推荐
- 【读书会第十三期】多媒体处理工具 FFmpeg 工具集
- Which product is better for 2022 annual gold insurance?
- Jenkins configures IP address access
- super_ Subclass object memory structure_ Inheritance tree traceability
- Tcpclientdemo for TCP protocol interaction
- New year's first race, submit bug reward more!
- JDBC 进阶
- 1289_FreeRTOS中vTaskSuspend()接口实现分析
- 智慧地铁| 云计算为城市地铁交通注入智慧
- what does ctrl + d do?
猜你喜欢

Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
![[PaddleSeg 源码阅读] PaddleSeg 自定义数据类](/img/88/37c535b371486db545abc392a685af.png)
[PaddleSeg 源码阅读] PaddleSeg 自定义数据类

Recursive structure

MySQL maxscale realizes read-write separation

渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密

图解网络:什么是热备份路由器协议HSRP?

Management and thesis of job management system based on SSM

Development of digital collection trading platform development of digital collection platform

Tcpclientdemo for TCP protocol interaction

渗透实战-SQLServer提权
随机推荐
Future源碼一觀-JUC系列
Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
支持首次触发的 Go Ticker
图解网络:什么是热备份路由器协议HSRP?
【愚公系列】2022年7月 Go教学课程 002-Go语言环境安装
Database SQL statement summary, continuous update
Typical applications of minimum spanning tree
Development of digital collection trading platform development of digital collection platform
1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
'2'>' 10'==true? How does JS perform implicit type conversion?
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
Leetcode51.n queen
三年进账35.31亿,这个江西老表要IPO了
新型数据中心,助力加快构建以数据为关键要素的数字经济
pytest多进程/多线程执行测试用例
AAAI2022 | Word Embeddings via Causal Inference: Gender Bias Reducing and Semantic Information Preserving
What are the virtual machine software? What are their respective functions?
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
1289_FreeRTOS中vTaskSuspend()接口实现分析
What kind of experience is it when the Institute earns 20000 yuan a month!