0

I'm using the Microsoft.Graph NuGet package v1.4 to connect to Microsoft Graph. Setting up the connection works fine and I'm able to connect and retrieve my contacts:

var client = AuthenticationHelper.GetAuthenticatedClient();
var contacts = await client.Me.Contacts.Request().GetAsync();

This works like a charm and I'm able to retrieve my contacts. Now I'm looking to delete some of my contacts ( my duplicates in fact ). The REST methods are there:

Described here:

DELETE https://graph.windows.net/myorganization/contacts/{object_id}[?api-version]

But I'm not able to do it through the NuGet package. Is this not implemented in the .NET API?

1 Answer 1

1

Looks like you are mixing and matching a few things here. So in Microsoft Graph, we have the notion of personal (or my) contacts. which you are able to find with the nuget package - it should support delete too. But then you are looking at the Azure AD Graph contacts API documentation, which is different (and is about organizational contacts only).
The documentation you want is here: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/contact

If you also want to manage organizational contacts (different from personal contacts), this is only available in /beta (preview) and is not exposed through the Microsoft Graph nuget (since we currently only expose v1.0 GA API through the client libraries). I just noticed that while we have org contacts documented (in GitHub), it's not in the table of contents, so I'll file a bug for this.

UPDATE (based on comment): Please see https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/contact_delete for info on deleting personal contacts. This should also be available through the client library, my guess is through a DeleteAsync() method on a selected contact. Hope this helps,

Sign up to request clarification or add additional context in comments.

1 Comment

Hi Dan - Thanks for your response. Sorry - I copied the wrong REST call but I'm aware of the difference in organisational contacts and my contacts. Could you help me in a direction for 'it should support delete too' - because I don't know what method to call to achieve this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.