1

I am trying to add user using Microsoft graph API.

I have provided the consent for all the permissions required.

POST https://graph.microsoft.com/v1.0/users

Request body that is send to the post request.

{
    "accountEnabled": true,
    "displayName": "Adele Vance",
    "mailNickname": "AdeleV",
    "userPrincipalName": "[email protected]",
    "passwordProfile": {
        "forceChangePasswordNextSignIn": true,
        "password": "xWwvJ]6NMw+bWH-d"
    }
}

Error that is received in response

{
    "error": {
        "code": "",
        "message": "No HTTP resource was found that matches the request URI 'https://outlook.office365.com:444/profile/v1.0/users('CID:0ff49e4749deeaf2')/profile?api-version=AGSV1-internal'.",
        "innerError": {
            "date": "2021-02-04T10:41:56",
            "request-id": "025218e1-191c-464f-adf3-f0cdc5fcebfd",
            "client-request-id": "c071d220-2f14-d7fa-956e-cd45ccbdc735"
        }
    }
}

Is there something that I am missing?

I have also gone through the docs for adding user provided by Microsoft.

https://learn.microsoft.com/en-us/graph/api/user-post-users?view=graph-rest-1.0&tabs=http

6
  • The above looks perfectly fine to me Have you tested it in Graph Explorer Commented Feb 4, 2021 at 11:30
  • Did you execute multiple requests? Can you provide your code? Commented Feb 4, 2021 at 11:41
  • What is the exact request? Do you have single tenat or multitenant app? Commented Feb 4, 2021 at 11:44
  • I was able to add add user using an Organisation account but not through personal account. I was adding user using Microsoft Graph API. I have tested it on Graph Explorer as well. Commented Feb 4, 2021 at 12:48
  • It does not support Microsoft personal accounts. Commented Feb 4, 2021 at 13:24

2 Answers 2

1

What you said in the comment is correct, the document has detailed instructions, it does not support Microsoft personal accounts.

enter image description here

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

Comments

0

You will have to check the end point are you using to authorize in order to obtain the token.

If you are using a tenant specific end point

https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize? client_id=6731de76-14a6-49ae-97bc-6eba6914391e

Try replacing with the common endpoint

https://login.microsoftonline.com/common/oauth....

Comments

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.