You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -785,16 +785,16 @@ for message in messages: # 100 loops with 4 requests to the api server
785
785
786
786
#### The Query helper
787
787
788
-
When using the Office 365API you can filter some fields.
788
+
When using the Office 365API you can filter, order, select, expand or search on some fields.
789
789
This filtering is tedious asis using [Open Data Protocol (OData)](http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html).
790
790
791
791
Every `ApiComponent` (such as`MailBox`) implements a new_query method that will return a `Query` instance.
792
-
This `Query` instance can handle the filtering (andsortingandselecting) very easily.
792
+
This `Query` instance can handle the filtering, sorting, selecting, expanding andsearch very easily.
793
793
794
794
For example:
795
795
796
796
```python
797
-
query= mailbox.new_query()
797
+
query= mailbox.new_query()# you can use the shorthand: mailbox.q()
You can also search content. As said in the graph docs:
825
+
826
+
> You can currently search only message and person collections. A $search request returns up to 250 results. You cannot use $filteror$orderby in a search request.
827
+
828
+
> If you do a search on messages and specify only a value without specific message properties, the search is carried out on the default search properties of from, subject, and body.
829
+
830
+
```python
831
+
# searching is the easy part ;)
832
+
query= mailbox.q().search('george best is da boss')
833
+
messages= mailbox.get_messages(query=query)
834
+
```
835
+
824
836
#### Request Error Handling
825
837
826
838
Whenever a Request error raises, the connection object will raise an exception.
0 commit comments