How You Can Use The Microsoft Graph API in C#

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.พ. 2025
  • Join me in taking a look at how you can use the Graph API/SDK alongside C# in your projects. In this video we'll cover how to find the calls you need to make, what permissions you'll need, how to create an entreprise application, what packes are needed and a few examples of how you can call the API using the SDK in C#.
    We're using a client secret to connect as an application, in case you want to see how to create a multi tenant application with access to multiple tenants, let me know and i'll create a video on that.
    Source code used in the video: github.com/Blu...
    Graph X-Ray: graphxray.meri...
    Graph Permissions Explorer: graphpermissio...
    Support Merill for the awesome tools
    YT: / @merillx
    Twitter: / merill
    Authorization code flow:
    learn.microsof...
    learn.microsof...
    PowerShell commands for 99 year secret:
    $startDate = Get-Date
    $endDate = $startDate.AddYears(99)
    New-AzureADApplicationPasswordCredential -ObjectId "OBJECTID" -CustomKeyIdentifier "IMAP Secret" -StartDate $startDate -EndDate $endDate

ความคิดเห็น • 31

  • @sanseverino1833
    @sanseverino1833 ปีที่แล้ว +3

    This was a great video, I would like to see a video on multi tenant supported app registrations.

  • @KatoNamus
    @KatoNamus 8 หลายเดือนก่อน +2

    I really hope you haven't stopped making YT videos. I'm also in need of that multi tenant video, please.

  • @Jamibi
    @Jamibi 9 หลายเดือนก่อน +4

    Thank you for this. I was going around in circles with the Microsoft documentation but this helped a lot!
    I'll save my resignation letter for another day!

    • @bluehippotech
      @bluehippotech  9 หลายเดือนก่อน +1

      Haha I'm glad to hear it helped!

  • @simonkarlsson6198
    @simonkarlsson6198 5 หลายเดือนก่อน

    Simple and easy to follow. Thank you!

  • @natalyverner9316
    @natalyverner9316 11 หลายเดือนก่อน

    Thank you! Very useful!

  • @rupeshmore80
    @rupeshmore80 11 หลายเดือนก่อน +3

    Please can you create a video on how to authenticate using delegate permission

  • @larsness71
    @larsness71 10 หลายเดือนก่อน

    Thank you :) Nice introduction.

  • @ConnorCawley
    @ConnorCawley ปีที่แล้ว +1

    Can you do a video for multitenant?

  • @ludamala2015
    @ludamala2015 9 หลายเดือนก่อน

    Do you maybe know if I can send emails via GraphApi to recepient with email domain from third party providers like Gmail?

  • @achraftalaachraf7401
    @achraftalaachraf7401 7 หลายเดือนก่อน

    I want to retrieve data from microsoft viva using microsoftgraph api and place them on the console in c#. How is this possible ?

  • @puntoad6706
    @puntoad6706 ปีที่แล้ว +1

    Great Video!, Can you do a video creating a folder in One Drive with Microsoft Graph?

    • @bluehippotech
      @bluehippotech  ปีที่แล้ว

      Thanks for the kind words!
      In graph, onedrive is just the same as sharepoint so i would suggest taking a look at creating a folder in SharePoint with the graph api as shown in the below documentation.
      learn.microsoft.com/en-us/graph/api/driveitem-post-children?view=graph-rest-1.0&tabs=http

  • @tradizar1
    @tradizar1 2 หลายเดือนก่อน

    someone can help me building up the graphclient with an already authenticated user's token?

  • @rafaelavila8311
    @rafaelavila8311 ปีที่แล้ว

    great video mate!!
    do you know how to add new users with licence and then add new usert to group?

    • @bluehippotech
      @bluehippotech  ปีที่แล้ว

      Thanks for watching the video!
      I would suggest looking at the ms documentation, they have examples on all three of those things.
      learn.microsoft.com/en-us/graph/api/user-post-users?view=graph-rest-1.0&tabs=http
      learn.microsoft.com/en-us/graph/api/user-assignlicense?view=graph-rest-1.0&tabs=http
      learn.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http

  • @domaine75atutube
    @domaine75atutube 7 หลายเดือนก่อน

    thanks for your video, can you make a video on how to upload a file to a SharePoint with MSGraph in C#?

    • @bluehippotech
      @bluehippotech  7 หลายเดือนก่อน

      Hmm that's not a bad idea for a short video. There's two graph endpoints for uploading files to sharepoint/onedrive, one for small files and one for big files

    • @domaine75atutube
      @domaine75atutube 7 หลายเดือนก่อน

      @@bluehippotech Can you give me those two endpoints?

  • @myaloy
    @myaloy ปีที่แล้ว

    I followed your video closely and went through all the steps. I get an error in GraphHandler row 33: return await GraphClient.Users[userPrincipalName].GetAsync() Error: Microsoft.Graph.Models.ODataErrors.ODataError: 'Exception of type 'Microsoft.Graph.Models.ODataErrors.ODataError' was thrown.' but no further information. What can be done to find it and correct it. Thanks

    • @bluehippotech
      @bluehippotech  ปีที่แล้ว

      Maybe no user could be found with said user principal name?
      Try returning all users instead and see if the connection works properly

    • @benjaminvenezia1944
      @benjaminvenezia1944 7 หลายเดือนก่อน

      same error

    • @kimmo6623
      @kimmo6623 4 หลายเดือนก่อน

      Any solutions to this? i get also ODataError :(

    • @kimmo6623
      @kimmo6623 4 หลายเดือนก่อน

      I got detailed error desc: insufficient privileges to complete the operation

    • @bluehippotech
      @bluehippotech  4 หลายเดือนก่อน

      I would suggest trying to return all users or checking the permissions on the app registration

  • @peterbates4696
    @peterbates4696 ปีที่แล้ว

    How do I get all of the columns in a SharePoint list and their data? . Thank you

    • @bluehippotech
      @bluehippotech  ปีที่แล้ว +1

      You would get the list using graph, the documentation on lists in SharePoint is quite good.
      learn.microsoft.com/en-us/graph/api/list-get?view=graph-rest-1.0&tabs=csharp

  • @Matstarx25
    @Matstarx25 ปีที่แล้ว

    Can you use the Graph API without a paid subscription to Azure?

    • @bluehippotech
      @bluehippotech  ปีที่แล้ว

      I'm not quite sure what the purpose would be. If you're just testing stuff you can make a dev tenant, otherwise without a subscription it would be empty

  • @ammarwaseem1040
    @ammarwaseem1040 ปีที่แล้ว

    LOVE YOU