Home

Graph API - validate mail nickname

%3CLINGO-SUB%20id%3D%22lingo-sub-390597%22%20slang%3D%22en-US%22%3EGraph%20API%20-%20validate%20mail%20nickname%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-390597%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20Folks%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eanybody%20who%20can%20me%20Point%20in%20the%20Right%20direction%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20check%20a%20mail%20nickname%20for%20creating%20an%20Office%20365%20Group%20via%20Graph%20API%20before%20the%20Group%20will%20be%20created%2C%20so%20that%20the%20requester%20could%20Change%20the%20nickname%2C%20if%20it%C2%B4s%20unavailable.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20found%20out%2C%20that%20you%20could%20do%20this%20via%20directoryObject%2FvalidateProperties%20(%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmicrosoft-graph-docs%2Fblob%2Fmaster%2Fapi-reference%2Fbeta%2Fapi%2Fdirectoryobject-validateproperties.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CFONT%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmicrosoft-graph-docs%2Fblob%2Fmaster%2Fapi-reference%2Fbeta%2Fapi%2Fdirectoryobject-validateproperties.md%3C%2FFONT%3E%3C%2FA%3E).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20tried%20to%20test%20that%20via%20Graph%20Explorer%20but%20I%20do%20not%20get%20it%20to%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20goal%20is%20to%20implement%20this%20in%20my%20flow%20for%20requesting%20and%20creating%20a%20new%20Team%20in%20Office%20365.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-390597%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20AD%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391591%22%20slang%3D%22en-US%22%3ERe%3A%20Graph%20API%20-%20validate%20mail%20nickname%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391591%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3661%22%20target%3D%22_blank%22%3E%40Andreas%20Schl%C3%BCter%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUser-ID%20%3A%20The%20UserID%20is%20Id%20of%20the%20user%20who%20is%20going%20to%20create%20group.%20Most%20probably%2C%20it%20should%20be%20the%20current%20user%2C%20so%20you%20can%20get%20it%20(%22id%22%20property)%20from%20%22me%22%20endpoint%20(%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%3C%2FA%3E).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EmailNickName%20%3A%20The%20mailNickName%20is%20nothing%20but%20the%20mail%20alias%20for%20the%20new%20group%20that%20you%20are%20going%20to%20create%20(for%20ex%3A%20if%20you%20want%20your%20new%20group%20email%20address%20like%20%22o365Group%40contoso.com%22%20-%20then%20here%20'o365Group'%20is%20nickname).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391456%22%20slang%3D%22en-US%22%3ERe%3A%20Graph%20API%20-%20validate%20mail%20nickname%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391456%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F38365%22%20target%3D%22_blank%22%3E%40Kevin%20Morgan%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethank%20you%20very%20much%20for%20your%20Input!%3C%2FP%3E%3CP%3EWhat%20User-ID%20do%20I%20have%20to%20take%20for%20%22onBehalfofUser%22%3F%3C%2FP%3E%3CP%3EAnd%20how%20do%20you%20check%20the%20mail%20nickname%20against%20the%20Directory%3F%20Maybe%2C%20the%20nickname%20is%20not%20in%20use%20for%20a%20Group%20but%20otherwise%20for%20a%20distributionlist%20or%20an%20alias%20of%20a%20user%3F%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391247%22%20slang%3D%22en-US%22%3ERe%3A%20Graph%20API%20-%20validate%20mail%20nickname%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391247%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3661%22%20target%3D%22_blank%22%3E%40Andreas%20Schl%C3%BCter%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHave%20you%20tried%20this%20under%20beta%20endpoint%2C%20seems%20this%20api%20still%20not%20supported%20in%20production%20endpoint%20(v1.0)%20and%20the%20reference%20you%20mentioned%20here%20also%20pointing%20to%20the%20beta%20endpoint.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBoth%20success%20(mailNickName%20available)%20and%20failure%20(mailNickName%20already%20used)%20cases%20are%20working%20fine%20for%20me%20in%20Graph%20Explorer.%20Attached%20the%20results.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20you%20have%20mentioned%20about%20Flow%2C%20hope%20you%20can%20use%20the%20Status%20Code%20(Success%3A%20204)%20to%20move%20forward%20through%20Flow.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391057%22%20slang%3D%22en-US%22%3ERe%3A%20Graph%20API%20-%20validate%20mail%20nickname%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391057%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3661%22%20target%3D%22_blank%22%3E%40Andreas%20Schl%C3%BCter%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20title%3D%22PowerApps%20%E2%80%93%20Custom%20Connectors%22%20href%3D%22https%3A%2F%2Finnanis.com%2F2019%2F03%2F29%2Fpowerapps-custom-connectors%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPowerApps%20%E2%80%93%20Custom%20Connectors%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20article%20explains%20creating%20a%20custom%20connector%20using%20Office%20365%20graph%20APIs%20and%20later%20integrating%20it%20with%20PowerApps%20and%20you%20can%20find%20your%20query%20as%20well.%26nbsp%3B%20Happy%20reading..%3C%2FP%3E%3C%2FLINGO-BODY%3E
Andreas Schlüter
New Contributor

Hey Folks,

 

anybody who can me Point in the Right direction?

 

I want to check a mail nickname for creating an Office 365 Group via Graph API before the Group will be created, so that the requester could Change the nickname, if it´s unavailable.

 

I have found out, that you could do this via directoryObject/validateProperties (https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/api-reference/beta/api/directoryo...).

 

I have tried to test that via Graph Explorer but I do not get it to work.

 

The goal is to implement this in my flow for requesting and creating a new Team in Office 365.

 

Thank you!

4 Replies

@Andreas Schlüter 

 

PowerApps – Custom Connectors

 

This article explains creating a custom connector using Office 365 graph APIs and later integrating it with PowerApps and you can find your query as well.  Happy reading..

@Andreas Schlüter 

 

Have you tried this under beta endpoint, seems this api still not supported in production endpoint (v1.0) and the reference you mentioned here also pointing to the beta endpoint.

 

Both success (mailNickName available) and failure (mailNickName already used) cases are working fine for me in Graph Explorer. Attached the results.

 

Since you have mentioned about Flow, hope you can use the Status Code (Success: 204) to move forward through Flow.

@Kevin Morgan,

 

thank you very much for your Input!

What User-ID do I have to take for "onBehalfofUser"?

And how do you check the mail nickname against the Directory? Maybe, the nickname is not in use for a Group but otherwise for a distributionlist or an alias of a user?

Thanks!

@Andreas Schlüter 

 

User-ID : The UserID is Id of the user who is going to create group. Most probably, it should be the current user, so you can get it ("id" property) from "me" endpoint (https://graph.microsoft.com/v1.0/me).

 

mailNickName : The mailNickName is nothing but the mail alias for the new group that you are going to create (for ex: if you want your new group email address like "o365Group@contoso.com" - then here 'o365Group' is nickname).

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies