当前位置:网站首页>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"
}
}
]
}
边栏推荐
- Calculate the odd sum of 1~n (1~100 as an example)
- Graduation summary
- [PaddleSeg 源码阅读] PaddleSeg 自定义数据类
- Don't disagree, this is the most powerful "language" of the Internet
- [paddleseg source code reading] paddleseg calculates Miou
- The property of judging odd or even numbers about XOR.
- If you have just joined a new company, don't be fired because of your mistakes
- CSP drawing
- JDBC advanced
- Smart subway | cloud computing injects wisdom into urban subway transportation
猜你喜欢
Explain AI accelerator in detail: why is this the golden age of AI accelerator?
MySQL one master multiple slaves + linear replication
PostgreSQL users cannot create table configurations by themselves
Katalon中控件的参数化
What kind of experience is it when the Institute earns 20000 yuan a month!
How about the ratings of 2022 Spring Festival Gala in all provinces? Map analysis helps you show clearly!
Reduce function under functools
Penetration practice - sqlserver empowerment
还原窗口位置的微妙之处
如何有效远程办公之我见 | 社区征文
随机推荐
[PaddleSeg 源码阅读] PaddleSeg计算Dice
拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
What kind of experience is it when the Institute earns 20000 yuan a month!
vue多级路由嵌套怎么动态缓存组件
Add IDM to Google browser
投资深度思考
Deep thinking on investment
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
Objective C attribute keyword
Unity移动端游戏性能优化简谱之 画面表现与GPU压力的权衡
Redis notes (I) Linux installation process of redis
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
Katalon framework tests web (XXI) to obtain element attribute assertions
Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption
GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
How to dynamically cache components in Vue multi-level route nesting
Calculate the odd sum of 1~n (1~100 as an example)
Future源碼一觀-JUC系列
pytest多进程/多线程执行测试用例
ctf-pikachu-XSS