Connecting to Microsoft Graph API with Python msal library.

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

КОМЕНТАРІ • 28

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

    Thank you very much for this video. This is the most concise and concrete example of how to use MSAL with Python I've managed to find so far! Keep up the good work. Cheers

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

    Love you man, thanks! I think you are the only one that shows app only access for msal library haha.
    ---
    I was using msgraph sdk the new one, but that doesn't work with splunk's inbuilt python. Atleast I wasn't able to make it work.
    Hopefully msal should work!
    Have a nice life! :)

  • @cosmomind3373
    @cosmomind3373 9 місяців тому

    you earned a subscriber pal ! what a simplified video

  • @wimvangeyt3866
    @wimvangeyt3866 2 місяці тому

    Hi great and clear video. I have an error though. at the "access_token" in the if where access token in result. It states the error can not itterate over None type. This is maybe because the account =None?

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

    Sir how important is this. Thank you i m doing this with my project. Thank you so much.

  • @matiasbertona1811
    @matiasbertona1811 Місяць тому

    TE AMO CAPO CAPISIMOOOOOO

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

    Great video. Very helpful for us

  • @pranaydevarashetty1924
    @pranaydevarashetty1924 14 днів тому

    Does this include certficate based authentication ?

  • @oscargutierrez-by9xy
    @oscargutierrez-by9xy 5 місяців тому

    Thanks for the help! Great vid!

  • @emmanuelac6
    @emmanuelac6 9 місяців тому

    Thanks a lot for your help, your video saved me a lot of time!! If you mind, could you help me whit what API Permissions should I have to have access to Ms Planner projects? I'm working on a project using python to download that data to a Dataframe, apply some ETL and upload it to a different Database. Thanks!!

    • @pythonbites2244
      @pythonbites2244  9 місяців тому

      Once you are logged in there should be no problem in getting Microsoft Planner plans using Graph API. Keep in mind that in order to keep data in sync with your DB, you need some "sync" mechanism to be developed on your side. I don't see any "delta" on Plans nor Tasks. So it looks like a regular "pull" on data.

  • @marcelolastra4977
    @marcelolastra4977 2 місяці тому

    Hi thanks for your video. Do you know if its possible to send a chat message through this way? i mean using the API

    • @pythonbites2244
      @pythonbites2244  2 місяці тому

      Yes, you can. There is API end-point for that:
      learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http

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

    Hi How i can connect with sharepoint to read the files. if possible can you do the video on sharepoint access.

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

      Hi there. Great Idea. I will record such video shortly. High level instructions are below.
      Using Microsoft Graph API do the following
      1) Get Site ID using: "/sites/{site_url}" endpoint (learn.microsoft.com/en-us/graph/api/site-get?view=graph-rest-1.0&tabs=http). You need Site ID to get it's documentLibraries.
      2) Get Site Drives (documentLibraries) using "/sites/{siteId}/drives" (learn.microsoft.com/en-us/graph/api/drive-list?view=graph-rest-1.0&tabs=http)
      3) Download DriveItem (File) using "/drives/{drive-id}/root:/{item-path}:/content" (learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=http)

  • @shashikumartheenathayapara2985

    Thank you!

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

    Hi, is this approach will work where there is no outlook application.?

  • @eduardoalmeida4692
    @eduardoalmeida4692 9 місяців тому

    Hello great video. But I got this error, Do you Know how to fix it?
    raise Exception("No Access Token Found")
    Exception: No Access Token Found

    • @betallyoungattractive644
      @betallyoungattractive644 6 місяців тому

      did you solve it?

    • @eduardoalmeida4692
      @eduardoalmeida4692 6 місяців тому

      @@betallyoungattractive644 No, I gave up

    • @adamcodes716
      @adamcodes716 2 місяці тому

      Put print statements around every "result" or "response" variable. Your issue is most likely with a bad client id or secret

  • @k0.9486
    @k0.9486 Рік тому

    Why are you using the "acquire_token_silent method"? You don't have token cache set up in this file, you could remove all of that and simply use "acquire_token_for_client", and eliminate everything else pertaining to that token - without the cache it's pointless. Am I missing something?

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

      You are right. It's just a habit I have to do it like that. In this case, it's not needed. Overall I would recommend having cache it in your code as per: msal-python.readthedocs.io/en/latest/#msal.SerializableTokenCache.

  • @lakme4604
    @lakme4604 10 місяців тому +1

    this didn't helped me

    • @adamcodes716
      @adamcodes716 2 місяці тому

      Good to know. Please let everyone know what other videos that didn't help you on youtube. We are all very, very curious