Skip to content

Commit

Permalink
docs: Fix example code for shared folder access. Fixes #1325
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Cederstrand committed Jul 29, 2024
1 parent 73a3b94 commit e8a811d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,21 @@ johns_account = Account(
```

If you want to impersonate an account and access a shared folder that this
account has access to, you need to specify the email adress of the shared
account has access to, you need to specify the email address of the shared
folder to access the folder:

```python
from exchangelib.folders import Calendar, SingleFolderQuerySet
from exchangelib.folders import Calendar, Folder, SingleFolderQuerySet
from exchangelib.properties import DistinguishedFolderId, Mailbox

shared_calendar = SingleFolderQuerySet(
account=johns_account,
folder=DistinguishedFolderId(
id=Calendar.DISTINGUISHED_FOLDER_ID,
mailbox=Mailbox(email_address="[email protected]"),
folder=Folder(
root=johns_account.root,
_distinguished_id=DistinguishedFolderId(
id=Calendar.DISTINGUISHED_FOLDER_ID,
mailbox=Mailbox(email_address="[email protected]"),
),
),
).resolve()
```
Expand Down

0 comments on commit e8a811d

Please sign in to comment.