How to call Post and Patch request for Microsoft Graph through dot net core code
up vote
0
down vote
favorite
I have already written the code for get all users method in dot net core that will get all users details from Microsoft Graph API. But i am unable to create/update/delete users through Microsoft graph API.
I am using
Uri Uri = new Uri("https://graph.microsoft.com/v1.0/users");
var httpResult = httpClient.GetStringAsync(Uri).Result;
for get all users.
microsoft-graph
add a comment |
up vote
0
down vote
favorite
I have already written the code for get all users method in dot net core that will get all users details from Microsoft Graph API. But i am unable to create/update/delete users through Microsoft graph API.
I am using
Uri Uri = new Uri("https://graph.microsoft.com/v1.0/users");
var httpResult = httpClient.GetStringAsync(Uri).Result;
for get all users.
microsoft-graph
1
Welcome to Stack Overflow! I strongly recommend reading "How do I ask a good question?" for some tips on getting started. Your question, as it stands today, is really broad and doesn't include any examples of what you have already tried and what errors/blockers you encountered.
– Marc LaFleur
Nov 9 at 16:56
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have already written the code for get all users method in dot net core that will get all users details from Microsoft Graph API. But i am unable to create/update/delete users through Microsoft graph API.
I am using
Uri Uri = new Uri("https://graph.microsoft.com/v1.0/users");
var httpResult = httpClient.GetStringAsync(Uri).Result;
for get all users.
microsoft-graph
I have already written the code for get all users method in dot net core that will get all users details from Microsoft Graph API. But i am unable to create/update/delete users through Microsoft graph API.
I am using
Uri Uri = new Uri("https://graph.microsoft.com/v1.0/users");
var httpResult = httpClient.GetStringAsync(Uri).Result;
for get all users.
microsoft-graph
microsoft-graph
edited Nov 9 at 18:14
James Z
11.1k71735
11.1k71735
asked Nov 9 at 12:26
sudhanshu Pal
124
124
1
Welcome to Stack Overflow! I strongly recommend reading "How do I ask a good question?" for some tips on getting started. Your question, as it stands today, is really broad and doesn't include any examples of what you have already tried and what errors/blockers you encountered.
– Marc LaFleur
Nov 9 at 16:56
add a comment |
1
Welcome to Stack Overflow! I strongly recommend reading "How do I ask a good question?" for some tips on getting started. Your question, as it stands today, is really broad and doesn't include any examples of what you have already tried and what errors/blockers you encountered.
– Marc LaFleur
Nov 9 at 16:56
1
1
Welcome to Stack Overflow! I strongly recommend reading "How do I ask a good question?" for some tips on getting started. Your question, as it stands today, is really broad and doesn't include any examples of what you have already tried and what errors/blockers you encountered.
– Marc LaFleur
Nov 9 at 16:56
Welcome to Stack Overflow! I strongly recommend reading "How do I ask a good question?" for some tips on getting started. Your question, as it stands today, is really broad and doesn't include any examples of what you have already tried and what errors/blockers you encountered.
– Marc LaFleur
Nov 9 at 16:56
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
According to your description, I assume you want to create/delete/update a user using the MS Graph API.
We can refer to this document to create/delete/update the user.
Using the endpoint POST /users
to create a user.
Using the endpoint PATCH /users/{id | userPrincipalName}
to update a user.
Using the endpoint DELETE /users/{id | userPrincipalName}
to delete a user.
First of all, we should have grant the permission for you application.
Yes, i have resolved the permission thing from Admin. Now, it's working fine.
– sudhanshu Pal
Nov 12 at 11:51
Please provide me sample for patch request for console application.
– sudhanshu Pal
Nov 16 at 11:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53225697%2fhow-to-call-post-and-patch-request-for-microsoft-graph-through-dot-net-core-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
According to your description, I assume you want to create/delete/update a user using the MS Graph API.
We can refer to this document to create/delete/update the user.
Using the endpoint POST /users
to create a user.
Using the endpoint PATCH /users/{id | userPrincipalName}
to update a user.
Using the endpoint DELETE /users/{id | userPrincipalName}
to delete a user.
First of all, we should have grant the permission for you application.
Yes, i have resolved the permission thing from Admin. Now, it's working fine.
– sudhanshu Pal
Nov 12 at 11:51
Please provide me sample for patch request for console application.
– sudhanshu Pal
Nov 16 at 11:38
add a comment |
up vote
0
down vote
accepted
According to your description, I assume you want to create/delete/update a user using the MS Graph API.
We can refer to this document to create/delete/update the user.
Using the endpoint POST /users
to create a user.
Using the endpoint PATCH /users/{id | userPrincipalName}
to update a user.
Using the endpoint DELETE /users/{id | userPrincipalName}
to delete a user.
First of all, we should have grant the permission for you application.
Yes, i have resolved the permission thing from Admin. Now, it's working fine.
– sudhanshu Pal
Nov 12 at 11:51
Please provide me sample for patch request for console application.
– sudhanshu Pal
Nov 16 at 11:38
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
According to your description, I assume you want to create/delete/update a user using the MS Graph API.
We can refer to this document to create/delete/update the user.
Using the endpoint POST /users
to create a user.
Using the endpoint PATCH /users/{id | userPrincipalName}
to update a user.
Using the endpoint DELETE /users/{id | userPrincipalName}
to delete a user.
First of all, we should have grant the permission for you application.
According to your description, I assume you want to create/delete/update a user using the MS Graph API.
We can refer to this document to create/delete/update the user.
Using the endpoint POST /users
to create a user.
Using the endpoint PATCH /users/{id | userPrincipalName}
to update a user.
Using the endpoint DELETE /users/{id | userPrincipalName}
to delete a user.
First of all, we should have grant the permission for you application.
answered Nov 12 at 2:10
Keen Jin
635116
635116
Yes, i have resolved the permission thing from Admin. Now, it's working fine.
– sudhanshu Pal
Nov 12 at 11:51
Please provide me sample for patch request for console application.
– sudhanshu Pal
Nov 16 at 11:38
add a comment |
Yes, i have resolved the permission thing from Admin. Now, it's working fine.
– sudhanshu Pal
Nov 12 at 11:51
Please provide me sample for patch request for console application.
– sudhanshu Pal
Nov 16 at 11:38
Yes, i have resolved the permission thing from Admin. Now, it's working fine.
– sudhanshu Pal
Nov 12 at 11:51
Yes, i have resolved the permission thing from Admin. Now, it's working fine.
– sudhanshu Pal
Nov 12 at 11:51
Please provide me sample for patch request for console application.
– sudhanshu Pal
Nov 16 at 11:38
Please provide me sample for patch request for console application.
– sudhanshu Pal
Nov 16 at 11:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53225697%2fhow-to-call-post-and-patch-request-for-microsoft-graph-through-dot-net-core-code%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Welcome to Stack Overflow! I strongly recommend reading "How do I ask a good question?" for some tips on getting started. Your question, as it stands today, is really broad and doesn't include any examples of what you have already tried and what errors/blockers you encountered.
– Marc LaFleur
Nov 9 at 16:56