How You Can Use The Microsoft Graph API in C#

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • 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
  • Навчання та стиль

КОМЕНТАРІ • 30

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

    Thank you :) Nice introduction.

  • @rupeshmore80
    @rupeshmore80 7 місяців тому +3

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

  • @KatoNamus
    @KatoNamus 4 місяці тому +2

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

  • @sanseverino1833
    @sanseverino1833 10 місяців тому +3

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

  • @achraftalaachraf7401
    @achraftalaachraf7401 3 місяці тому

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

  • @ConnorCawley
    @ConnorCawley 8 місяців тому +1

    Can you do a video for multitenant?

  • @ludamala2015
    @ludamala2015 4 місяці тому

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

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

    LOVE YOU

  • @Jamibi
    @Jamibi 4 місяці тому +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  4 місяці тому +1

      Haha I'm glad to hear it helped!

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

    Simple and easy to follow. Thank you!

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

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

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

      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

  • @domaine75atutube
    @domaine75atutube 3 місяці тому

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

    • @bluehippotech
      @bluehippotech  3 місяці тому

      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 3 місяці тому

      @@bluehippotech Can you give me those two endpoints?

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

    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  8 місяців тому

      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 3 місяці тому

      same error

    • @kimmo6623
      @kimmo6623 9 днів тому

      Any solutions to this? i get also ODataError :(

    • @kimmo6623
      @kimmo6623 9 днів тому

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

    • @bluehippotech
      @bluehippotech  9 днів тому

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

  • @Matstarx25
    @Matstarx25 10 місяців тому

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

    • @bluehippotech
      @bluehippotech  10 місяців тому

      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

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

    Thank you! Very useful!

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

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

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

      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

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

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

    • @bluehippotech
      @bluehippotech  11 місяців тому +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