Jump to content
Jasonjac2

anyone working with MS Graph API - OneNote, OneDriveForBusiness

Recommended Posts

Hi,

I have an immediate need to create folders, files and then create links and passwords for MS OneDrive for Business.  I also have a pet project idea for drilling into OneNote.  I have briefly looked at the MS Graph API for this and googles stack overflow, MS forums, GITHub.  I have definitely not exhausted my time on this, BUT before committing to it I need to ensure I know how much effort it will be to get up to speed and pull together any resources.   So:

- is anyone driving MS Graph from Delphi (10.x (I am on the latest)). 

- can you share any code examples

- Any Gotchas

- Can you point me at any good resources or repos?

 

For the primary usecase - based on some driver file / data I need to:

- create a folder structure - not on the PC, but straight to Sharepoint (office 365) / OneDrive for business

- upload files 

- create links & passwords to the folder that can be shared via e-mail (link via e-mail, password via another mechanism)

-- these would be given to external intended recipients

- probably about 75 folders, between 20 & 500 files in each, probably zipped for convenient download

 

Secondary

- to be able to report / track shares on folders, for audit

- be able to track access

- be able to cancel the shares

- be able to tear it all down

 

OneNote Project - I'll cover that another time.

 

TIA if you are still reading. 

Regards

Jason.

 

Share this post


Link to post

I had a look at it, but never got started because it did not support my use case*. The REST api documentation seemed very ok.

Example: Working with files in Microsoft Graph - Microsoft Graph v1.0 | Microsoft Docs

 

However, I found it unnecessary difficult to get started because you had to register an "app permission" on your companies Office 365. I was able to do that (altough I have no special permissions), but still found everything around that unecessary difficult if you're not a SharePoint administrator.

 

* I wanted to upload files to Sharepoint anonymously, which it does not support. OneDrive for Business, however, has a feature called "request files" but it seems unavailable from Graph.

Share this post


Link to post

I was able to work with it on Delphi 10.4 using REST components but man MS Graph API is such a complicated api. lol Maybe because when I started on it, they were just starting to unify their API into MS Graph. Got referred to multiple documentations. So some data being pulled is from Graph API and others are the previous versions. We decided to stop development and let MS work on it (let it mature perhaps) hahaha

Share this post


Link to post
On 6/3/2021 at 3:46 PM, Der schöne Günther said:

I had a look at it, but never got started because it did not support my use case*. The REST api documentation seemed very ok.

Example: Working with files in Microsoft Graph - Microsoft Graph v1.0 | Microsoft Docs

 

However, I found it unnecessary difficult to get started because you had to register an "app permission" on your companies Office 365. I was able to do that (altough I have no special permissions), but still found everything around that unecessary difficult if you're not a SharePoint administrator.

 

* I wanted to upload files to Sharepoint anonymously, which it does not support. OneDrive for Business, however, has a feature called "request files" but it seems unavailable from Graph.

Thanks, I have used the Graph API helper in their online dev tools, which is great at testing out API calls, but still haven't managed to invest the time to build out any Delphi code for it.

 

5 minutes ago, misc_bb said:

I was able to work with it on Delphi 10.4 using REST components but man MS Graph API is such a complicated api. lol Maybe because when I started on it, they were just starting to unify their API into MS Graph. Got referred to multiple documentations. So some data being pulled is from Graph API and others are the previous versions. We decided to stop development and let MS work on it (let it mature perhaps) hahaha

Hi thanks for the input, when did you look at the MS Docs? I found the API explorer app pretty good, just not put the effort into getting hooked up to the point of being able to issue commands and interpret the results.

Share this post


Link to post

This is a sample test app with MS Graph. Not sure if there's a new version recently with MS Graph, if there is some parameters might change. This is just a simple app just for me to test if I can retrieved an expected JSON result.

TestMSGraph.zip

Edited by misc_bb
  • Like 1

Share this post


Link to post

Thanks misc_bb, I only just re-found this.  I was wondering if anyone else had any more experience now (a few months later).  I am about to start again on it I think.

Regards,

Share this post


Link to post

If anyone is looking at this again. I would agree that its a complex API to get working. Mainly due to permissions.

This is a useful tool - https://developer.microsoft.com/en-us/graph/graph-explorer

You can log in as a user and run multiple API calls to see examples of how they work and if they work. This takes some of the guessing away from "did I set it up right".

 

The Overview of the Microsoft Graph https://docs.microsoft.com/en-us/graph/overview is also pretty good. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×