当前位置:网站首页>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"
}
}
]
}
边栏推荐
- MySQL maxscale realizes read-write separation
- [.NET + mqtt]. Mise en œuvre de la communication mqtt dans l'environnement net 6 et démonstration de code pour l'abonnement et la publication de messages bilatéraux du serveur et du client
- Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption
- mysql数据库的存储
- STM32 external DHT11 display temperature and humidity
- Jenkins configures IP address access
- My opinion on how to effectively telecommute | community essay solicitation
- Pandora IOT development board learning (HAL Library) - Experiment 6 independent watchdog experiment (learning notes)
- Want to do something in production? Then try these redis commands
- Database SQL statement summary, continuous update
猜你喜欢

Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure

ctf-pikachu-CSRF
![[paddleseg source code reading] paddleseg custom data class](/img/88/37c535b371486db545abc392a685af.png)
[paddleseg source code reading] paddleseg custom data class

微信公众号网页授权

What kind of experience is it when the Institute earns 20000 yuan a month!

Easy to win insert sort

Redis notes (I) Linux installation process of redis

What are the virtual machine software? What are their respective functions?

Es network layer

1289_FreeRTOS中vTaskSuspend()接口实现分析
随机推荐
Katalon使用script实现查询List大小
What are the virtual machine software? What are their respective functions?
JVM family -- heap analysis
What kind of experience is it when the Institute earns 20000 yuan a month!
Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption
The new data center helps speed up the construction of a digital economy with data as a key element
How to dynamically cache components in Vue multi-level route nesting
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!
深度优先搜索简要讲解(附带基础题)
Explain AI accelerator in detail: why is this the golden age of AI accelerator?
[PaddleSeg 源码阅读] PaddleSeg计算Dice
Deep thinking on investment
National standard gb28181 protocol platform easygbs fails to start after replacing MySQL database. How to deal with it?
思考的小记录
Zigzag scan
Sales management system of lightweight enterprises based on PHP
Pytest multi process / multi thread execution test case
Typical applications of minimum spanning tree
Eh, the log time of MySQL server is less than 8h?