Giter Club home page Giter Club logo

Comments (6)

nigel-dewar avatar nigel-dewar commented on June 2, 2024 1

Hi Diane. Sorry this was my fault. I had not properly configured the callback endpoint, and so i was getting 400 bad request in debug, which made me beleive it a bug, but its just me being dumb. I realized only late last night and did no5 update/close this issue.

thanks for letting me know apponly is available on beta version.

By the way, i just want to say that the work you guys are doing there is amazing! The additional functionality you guys are building into graphapi is super powerful and impressive. Everytime i look and see new functionality and im like wow, these guys are really going for it. Thanks for all your hard work and thanks for keeping track of all these github repos.

cheers

from aspnet-webhooks-rest-sample.

DianeD avatar DianeD commented on June 2, 2024

Hi @nigel-dewar . Thanks for reporting this issue. Looking into it now.

from aspnet-webhooks-rest-sample.

DianeD avatar DianeD commented on June 2, 2024

Hi @nigel-dewar . App-only is supported on /beta.

Can you please provide your error message and the response headers (especially the request ID and date) for the create-subscription request? Also, was your callback endpoint ever called during the attempt?

from aspnet-webhooks-rest-sample.

nigel-dewar avatar nigel-dewar commented on June 2, 2024

Hi There , I have ensured that I have things correct, have obtained an App-only token for graph ap successfully, however it seems beta webhooks do not work.

FYI, I have given my application ALL rights in AZURE AD for Graph and Exchange endpoints, so no permission issues there.

I have correctly configured the ngrok return endpoint, that also is not an issue, and have tested that when I use a user (delegated token), things work just fine.

So here is what I have done and which should work but does not.

I obtain my app-only access token, And I go to create a subscription using my token as shown here

string subscriptionsEndpoint = "https://graph.microsoft.com/beta/subscriptions/";
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, subscriptionsEndpoint);
var subscription = new Subscription
{
Resource = "users/" + user.UserPrincipleName + "/mailFolders('Inbox')/messages",
ChangeType = "created",
NotificationUrl = ConfigurationManager.AppSettings["ida:NotificationUrl"],
ClientState = Guid.NewGuid().ToString(),
ExpirationDateTime = DateTime.UtcNow + new TimeSpan(0, 0, 4230, 0)
};

Notice that I have set the subscriptionsEndpoint to use the /beta/ version

Also please notice that I have set the Resource to use
Resource = "users/" + user.UserPrincipleName + "/mailFolders('Inbox')/messages" >> user.UserPrincipleName being the users email box I want to listen to

All should work, however I dont even get past base 1. I am getting 401 Unauthorized as a response when trying to post subscription request through.

Can anyone please shed some light on what I might be doing wrong. Cheers

from aspnet-webhooks-rest-sample.

DianeD avatar DianeD commented on June 2, 2024

Hi @nigel-dewar . Can you please provide us with the raw response, making sure to include the request ID and date? Then the product team can start investigating. If you use Fiddler, you can see this in the Raw tab of the response.

from aspnet-webhooks-rest-sample.

nigel-dewar avatar nigel-dewar commented on June 2, 2024

Hi @DianeD , I'm very sorry but I figured out what the issue was at 11pm last night. I had stupidly created the app only token using the service endpoint for outlook.com and not graph.microsoft.com!!!

When I realized I was like "OMG! How completely idiotic am I" !!!

Sorry to waste your time..... again.

Cheers, Nige

from aspnet-webhooks-rest-sample.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.