Getting Started With Microsoft Graph API For Python Development (Set Up & Authentication)

Поділитися
Вставка
  • Опубліковано 11 вер 2024

КОМЕНТАРІ • 76

  • @mindfulmindfull178
    @mindfulmindfull178 Рік тому +2

    You are a champion. This saved me from days of running around in circles. Thank you 👊

    • @lonecoder_cro
      @lonecoder_cro Рік тому

      😂man I did a week research n just found this video like why msdn even existed if its not helpful when you need it

  • @MartianMoon
    @MartianMoon Рік тому +4

    I can't thank you enough for this. Been stuck putting so many hours trying to figure this out over the last week.
    Even ChatGPT/GPT4 couldn't help me with this one.
    Sent you some coffee money, first time I've ever done that for a UA-cam vid but you deserve it.
    Thank you again.

    • @jiejenn
      @jiejenn  Рік тому +1

      Appreciate the tip.
      By the way, this took me 3 months to finally figure it out 🤣

    • @MartianMoon
      @MartianMoon Рік тому +1

      @@jiejenn dude 3 months 😭😭😭
      You’re an absolute legend, thank you for sharing this with the world 🙏🏻

    • @satyamshukla1418
      @satyamshukla1418 Рік тому

      hi martianmoon and @jiejenn
      bro i am stuck with the following error-
      The code you entered has expired. Get a new code from the device you're trying to sign in to and try again.
      did u came accross this if u did help me out bro

    • @daieth4492
      @daieth4492 5 місяців тому

      i came from a suggestion from GPT4 to watch this video she is insane thank you @jieje

  • @alip4292
    @alip4292 Рік тому +4

    I want to have the script running in the background in an aws lambda, is there a way to eliminate the user having to log in?

  • @evraamsdonk7724
    @evraamsdonk7724 Рік тому +2

    Thank you! This is so much clearer than Microsoft's own documentation.

    • @jiejenn
      @jiejenn  Рік тому

      Glad video helped

    • @juliosouto9659
      @juliosouto9659 Рік тому

      Microsoft documentation are so long that are completely useless. Nobody has time to read a bible for using something.

  • @santhoshkumar995
    @santhoshkumar995 5 місяців тому

    Such a time saver. I should have watched this first before spending so much time. 😃

  • @mattchen4970
    @mattchen4970 11 місяців тому +1

    is there a way to bypass the manual login process (where you entered the code in the prompt)?

  • @TheJFMR
    @TheJFMR 2 роки тому +1

    Hello Jie Jenn, you are the master of the API integration haha.
    Thanks for this amazing tutorials.

    • @jiejenn
      @jiejenn  2 роки тому +4

      Thanks. The MS Graph API took me 8 months to figure it out how to use it properly 😂. I will probably make a follow-up video since I have better grasp of the API now.

    • @TheJFMR
      @TheJFMR 2 роки тому

      @@jiejenn there are some documentations that are pretty bad, they dont go straight to the point.
      Im integrating at work my app with a lot of apis and for example with GoToMeeting i still dont get the token properly. (It give me an error of not authenticated)
      Other examples are slack that they ask you to have https enabled (i used ngrok to setting Up locally).
      It took me a lot to realize i need to use ngrok to set Up locally and finally got It.
      In zoom they ask for a lot of documentation, in iCloud they ask you an Apple Id...
      Im having some headaches integrating Those APIS 😂

    • @TheJFMR
      @TheJFMR 2 роки тому

      @@jiejenn it would be nice if you make a tutorial of how to integrate gotomeeting api with python

  • @Mohammad-oe9wj
    @Mohammad-oe9wj 4 місяці тому

    bro i am stuck with the following error-
    The code you entered has expired. Get a new code from the device you're trying to sign in to and try again. can you tell me how to figure this out i am able to put my outllook mail and pass word after that the error is showing "That Microsoft account doesn't exist. Enter a different account or"

  • @quanticdev1071
    @quanticdev1071 Рік тому +1

    im trying to use this to gain access to my onenote pages so I can refine my notes using gpt-3 api

  • @OM-yn8pt
    @OM-yn8pt 3 місяці тому

    Amazing tutorial, no way I could find this with MS docs. Plus they write (deprecated) on half the useful methods

  • @mdbrable
    @mdbrable Рік тому +2

    It's unbelievable how if you want to use Todoist's API, you just copy the API Key from the settings and you're ready to go, but to work with Microsoft ToDo you have to go through all that BS.

    • @jiejenn
      @jiejenn  Рік тому

      Have to agree with you on this one.

  • @paulamar2174
    @paulamar2174 2 роки тому +3

    Do we have some ways to avoid having to log in? eg. if we want to run this as a background job for example (in a Gitlab CI/Jenkins job for example)

    • @jiejenn
      @jiejenn  2 роки тому +1

      That's something I am still trying to figure it out.

    • @__unknown___
      @__unknown___ Рік тому

      @@jiejennHave you figured it out? Is it possible?

    • @ananthup4740
      @ananthup4740 7 місяців тому

      ys@@__unknown___

  • @tahabandaw4691
    @tahabandaw4691 8 місяців тому

    amazing dude really thx

  • @juniorfagundes9140
    @juniorfagundes9140 2 роки тому

    thank you so much homie

  • @prasenjitmandal5486
    @prasenjitmandal5486 2 роки тому

    Amazing 👍

  • @jethrobizumuremyi9535
    @jethrobizumuremyi9535 2 роки тому +1

    For a script running in the background, how can you eliminate the user having to log in

    • @jiejenn
      @jiejenn  2 роки тому

      This is something I am still trying to figure out.

  • @conniezi3336
    @conniezi3336 2 роки тому

    Thank you for this series of videos!
    I am at enabling the scopes, but I can't find the options to permit OneDrive access. I am not sure if not enabling that would affect anything though, since it seems like you did successfully access to OneDrive in one of your later videos without worrying about the permission.

    • @jiejenn
      @jiejenn  2 роки тому +1

      Your suspicion is correct. Turns out you can manually assign the scope in the script directly without.

  • @tsunghsiwu
    @tsunghsiwu 2 роки тому

    thank you for sharing

  • @xizhenwang6246
    @xizhenwang6246 2 роки тому +1

    For the 2nd method, if the code is in a python (say Flask) web app, how to get the device 'code' or where user can get the device code?
    Also we rely on Microsoft Edge's company user profile (or the Windows Account extension in Chrome), so the authentication flow is transparent to my web app (I do not need to call msal.initiate_xxx_flow function to initiate authentication flow. How can I get the access_code or login user name?
    thank you!

    • @jiejenn
      @jiejenn  2 роки тому

      Method 2 is just OAuth2 protocol most Microsoft web services use. Users authenticate their account by providing their credential info.

    • @xizhenwang6246
      @xizhenwang6246 2 роки тому

      @@jiejenn thanks. by looking at your sample code, i understand the device code is user-independent? If so where to authenticate? or you mean user uses the One-time password code in the Authenticator mobile app (I tried but the web page ('verification_uri') does not recognize my One-time password code)
      also do you happen to have any ideas about my the other question?
      thanks.

  • @DilipDiwakarAricent
    @DilipDiwakarAricent 2 роки тому +1

    Thanks !! my app is running on schedule basis so what will be the best way to get access token. we can't use here browser.. do we have anything like managed identity

    • @jiejenn
      @jiejenn  2 роки тому +1

      If you want to use a client secret instead of the regular OAuth2 flow, then you will need to 1) replace scopes with graph.microsoft.com/.default and 2) grant admin consent for Default directory to the permission sets (this will be under application permissions). Just be warned that, not all the permissions are available under application permissions.

    • @paularayaviquez1096
      @paularayaviquez1096 2 роки тому

      @@jiejenn Hello your videos are great they have helped me a lot, can you make a little video showing this authentication without prompting the browser, thank you!!

    • @simonebollati5285
      @simonebollati5285 2 роки тому +1

      @@paularayaviquez1096 it would be very useful for me too. thx

    • @juliianriios9323
      @juliianriios9323 2 роки тому

      @@paularayaviquez1096 x2

  • @seanchang7072
    @seanchang7072 Рік тому +1

    謝謝!

  • @user-cg5gt3ox4i
    @user-cg5gt3ox4i 9 місяців тому

    ValueError: API does not accept frozenset({'offline_access', 'profile', 'openid'}) value as user-provided scopes
    Anything on this? anyone?

  • @Python_Griffin
    @Python_Griffin Рік тому

    Do I have to create an account on Azure? I only have my personal account on outlook and I want to use this API to download an excel file and use in to my application.
    To summarize, do I have to pay to use this Azure service ?

    • @jiejenn
      @jiejenn  Рік тому

      Yes you will have to create an Azure account

    • @Python_Griffin
      @Python_Griffin Рік тому

      @@jiejenn to use for this purpose that I mentioned, how much can cost ?

    • @jiejenn
      @jiejenn  Рік тому

      @@Python_Griffin Free

  • @zarbose5247
    @zarbose5247 Рік тому

    Hello. What is the Azure Cloud Environment you switched to?

    • @jiejenn
      @jiejenn  Рік тому

      Not sure if I follow your question. Can you be more specific?

  • @reynaldomalave
    @reynaldomalave 2 роки тому

    Thanks!!!

    • @jiejenn
      @jiejenn  2 роки тому

      Glad the video helped!

  • @obed818
    @obed818 2 роки тому

    Thanks this is pretty interesting! Also do you know why Facebook/ig api is also named graph, this is weird it isn’t linked i guess ?

    • @jiejenn
      @jiejenn  2 роки тому +1

      Could be just coincidence.

    • @obed818
      @obed818 2 роки тому

      @@jiejenn ah ok lol

  • @xizhenwang6246
    @xizhenwang6246 2 роки тому

    Authorization_codes are short lived, so how to make method 1 automated and really work?

    • @jiejenn
      @jiejenn  2 роки тому

      Maybe this video might help ua-cam.com/video/AjOfAQCZsJU/v-deo.html.

  • @TheVopek
    @TheVopek Рік тому

    Hey, great video, helped me a lot (to make a code a little bit easier i get the token by username/password) and seems like everything works :)
    I wonder if I can refresh the permissions of the app after the first web authentication. I added new permissions (such as One Note reads etc), but seems like it doesnt update and web authentication shows me that connection is refused (so I cant get to the site second timer)

    • @satyamshukla1418
      @satyamshukla1418 Рік тому

      did u face the problem of code expiration.

    • @TheVopek
      @TheVopek Рік тому +1

      @@satyamshukla1418 I have not

  • @enabrasool5227
    @enabrasool5227 Рік тому

    can this be done for presence api?

    • @jiejenn
      @jiejenn  Рік тому

      Not familiar with presence API, but if it is part of the Grape API ecosystem, then I don't see why not.

  • @prasenjitmandal5486
    @prasenjitmandal5486 2 роки тому

    Can you help me to connect with Salesforce through VBA code for creating a case on Salesforce

  • @RohitKumar-yz3eo
    @RohitKumar-yz3eo Рік тому

    Hi, I'm getting 401 in response could you please help.

    • @jiejenn
      @jiejenn  Рік тому

      Error 401 means unauthorized access detected. Makes sure you set up your app and provide the app detail correctly.

  • @DiegoLacerda-r6u
    @DiegoLacerda-r6u 29 днів тому

    Hi everyone, I'm creating a script that saves files to OneDrive for business purposes. How can I evaluate how much it will cost to do this? Based on my research, this seems to be within the scope of the free account, but I'm not confident. Could anyone with more expertise provide some guidance?

    • @jiejenn
      @jiejenn  29 днів тому +1

      @@DiegoLacerda-r6u for OneDrive, currently it is free with unlimited usage.

    • @DiegoLacerda-r6u
      @DiegoLacerda-r6u 28 днів тому

      @@jiejenn Thanks!

  • @neelpatel6404
    @neelpatel6404 2 роки тому

    Can you make tutorial with Sharepoint Online?

    • @jiejenn
      @jiejenn  2 роки тому

      I don't have experience with SharePoint unfortunately.

  • @satyamshukla1418
    @satyamshukla1418 Рік тому +1

    @jiejenn
    bro i am stuck with the following error-
    The code you entered has expired. Get a new code from the device you're trying to sign in to and try again. can you tell me how to figure this out i am able to put my outllook mail and pass word after that the error is showing

    • @eric_ma3812
      @eric_ma3812 Рік тому +1

      yes, same problem 😅

    • @kudintv4267
      @kudintv4267 11 місяців тому

      @@eric_ma3812 same :/

    • @Mohammad-oe9wj
      @Mohammad-oe9wj 4 місяці тому

      Same issue here, did you find a solution?