Hello Arpan Parekh | Redian Software India,
Thank you for reaching out to Microsoft Support!
It sounds like you're encountering a permissions issue when trying to delete other users' contacts. Here are a few things you can check and try:
- Permissions: Ensure that your app has the necessary permissions. While you mentioned having
readWrite
permissions, double-check that these permissions are correctly configured for deleting contacts. - Ownership: Verify if the contacts you are trying to delete are owned by the user or if they are part of a shared or global address list. Contacts in a global address list or shared contacts might have restrictions.
- API Endpoint: Make sure you are using the correct API endpoint. For deleting a contact, the endpoint should be:
Ensure that theDELETE /users/{user-id}/contactFolders/{contactfolder-id}/contacts/{contact-id}
user-id
,contactfolder-id
andcontact-id
are correctly specified. Also check whether the contactfolder is existing or not. - Error Details: The error message
ErrorCannotDeleteObject
suggests that the object might be protected or linked to another object that prevents deletion. Check if there are any dependencies or links that need to be resolved before deletion.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.