python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

Reading/Creating contacts in sub-folders

Open MariusLuding opened this issue 3 years ago • 2 comments

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?

MariusLuding avatar Apr 11 '22 18:04 MariusLuding

Seems like a bug... don't know where the error is tho

alejcas avatar Apr 22 '22 09:04 alejcas

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...)

MariusLuding avatar Aug 18 '22 12:08 MariusLuding