Maintain control of your Microsoft 365 data
Post Reply
disk91
Influencer
Posts: 24
Liked: 2 times
Joined: Feb 18, 2021 9:42 am
Full Name: Paul
Contact:

Exchange mailbox/Folder item search always return empty response

Post by disk91 »

Hello,
Another issue I have: where using "https://%s:%d/%s/restoreSessions/%s/organization/mailboxes/%s/folders/%s/action",
With a body like : {"search":{"query":"subject:Test4"}}
I receives an empty response from the VBO (whatever the query is basically)
result : {
"offset": 0,
"limit": 30,
"results": [],
"_links": {
"self": {
"href": "..."
}
}
}

But if I browse the Items in the same folder, I get items with "subject": "Test4",
nielsengelen
Product Manager
Posts: 5796
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Exchange mailbox/Folder item search always return empty response

Post by nielsengelen »

Are you 100% sure the folderId is the correct one? Do you see those items listed under the folder if u verify it against "get /v5/RestoreSessions/{restoreSessionId}/organization/mailboxes/{mailboxId}/items" (where u can specify the folderId)? For ease of use, you can use the built-in Swagger to test it.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
disk91
Influencer
Posts: 24
Liked: 2 times
Joined: Feb 18, 2021 9:42 am
Full Name: Paul
Contact:

Re: Exchange mailbox/Folder item search always return empty response

Post by disk91 »

Response from Get Items In Folder (this is myAPI, but as you can see the Ids are the same (parametrization in my http test file)
GET http://localhost:8080/browse/{{restoreS ... tems/0/20/ HTTP/1.1
[
{
"from": "xxx",
"id": "LgAAAEYAAAAWAAAAAAAAALTXFZOxxxQ_DIvZRpiFDg_1lOCdAAAAAAjE",
"sent": 1622122787000,
"subject": "Test4",
"to": "xxxx"
}
]


Response from the Search
GET http://localhost:8080/browse/{{restoreS ... ct%3ATest4 HTTP/1.1
[]
nielsengelen
Product Manager
Posts: 5796
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Exchange mailbox/Folder item search always return empty response

Post by nielsengelen »

I see your URL has 0/20 at the end, can u explain what this part would be? Is this your pagination?

Did you by any chance try the same flow in the built-in Swagger? I can't see anything wrong with your JSON search payload so it should work if it is the correct folder.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
disk91
Influencer
Posts: 24
Liked: 2 times
Joined: Feb 18, 2021 9:42 am
Full Name: Paul
Contact:

Re: Exchange mailbox/Folder item search always return empty response

Post by disk91 »

This is my pagination you right. Here is the call to VBO
https://XXXXX:4443/v5/restoreSessions/c ... AAA/action

{"search":{"query":"subject:Test4"}}
nielsengelen
Product Manager
Posts: 5796
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Exchange mailbox/Folder item search always return empty response

Post by nielsengelen »

The JSON parameter is correct from the looks of it. I would suggest trying it using the built-in Swagger and see if that outcome is the same (empty result).

What do u get if u just use "subject:Test" (so drop the 4)?
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
disk91
Influencer
Posts: 24
Liked: 2 times
Joined: Feb 18, 2021 9:42 am
Full Name: Paul
Contact:

Re: Exchange mailbox/Folder item search always return empty response

Post by disk91 »

Yes I did test with different fields, Test string ...
What do you mean by built-in swagger ?
nielsengelen
Product Manager
Posts: 5796
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Exchange mailbox/Folder item search always return empty response

Post by nielsengelen »

I'm sorry, I should have explained this. Within the ribbon, you can go to console and then open Swagger to perform REST API endpoint testing directly.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests