python-o365
python-o365 copied to clipboard
Reading/Creating contacts in sub-folders
Hey,
Getting a folder a user has is easy with the adressbookOfUser.get_folder(folder_name=etc.) When writing a new contact to that, the new contact does not end up in the child-folder, but rather in the parent:
subfolder = addressbook.get_folder(folder_name='NameOfSubFolderInOutlook')
new_contact = subfolder.new_contact()
new_contact.name = 'TestyUser'
new_contact.save()
-> TestUser is found in the Contact-Root and not in the folder "NameOfSubFolderInOutlook"
The same is true for when trying to get/create contacts inside the subfolder, list folder inside the subfolder etc. That means that I can create a sub-folder, but cant add contacts to it? Or is this just an error on my side?
Seems like a bug... don't know where the error is tho
I have a suspicion, how do you try to save that subfolder-attribute? It has to be done with the folder-ID in the POST-URL /v1.0/users/{account_name}/contactfolders/{subfolder_ID}/contacts and not just via the parent ID-Field in the JSON-request. (I don't really get what that field is supposed to be used for...)