0

I have a MS- Onedrive business account. I need to connect my onedrive to my webpage, to view folders, download files, etc. How can I intergrage Onedrive with my webpage using PHP? Can anyone help me?

Sᴀᴍ Onᴇᴌᴀ
  • 8,218
  • 8
  • 36
  • 58
user2801829
  • 1
  • 1
  • 2

3 Answers3

2

The OneDrive File picker might be your best bet if you simply want to get list of files, folder location, and downloand/update files from OneDrive. This uses the JavaScript API so you'll need to incorporate that into your site. Setup is pretty simple. Register your application at https://account.live.com/developers/applications to get important info to authenticate/authorize the user and make calls to the service (i.e. client_id, client_secret, etc.) then take a look at the sample code at https://msdn.microsoft.com/en-us/library/dn659733.aspx. If this is for OneDrive for Business, you want to look at https://msdn.microsoft.com/en-us/office/office365/api/files-rest-operations. Hope that helps.

Toan-Nguyen
  • 321
  • 1
  • 3
1

I don't think they have an API for PHP, you might have to use JavaScript if you want to follow an API. Have a look at this.

You can still use PHP but you will have to build it from zero. Take advantage of the HTTP requests, click here.

Here is an example in PHP for the old name Skydrive

André Ferraz
  • 1,511
  • 11
  • 29
  • Thanks a lot Andre. I have visited this URL http://onedrive.github.io/README.htm .but i cannot understand hos to start.Could you please give me any sample code ? My requirement is : When i click on a button i want to access to my one drive .I have a email address & password only of onedrive – user2801829 Feb 26 '15 at 09:29
1

You may want to have a look at the OneDrive SDK for PHP. It's GPLed, supporting the latest OneDrive specifications, and the API is straightforward to get started within minutes.

Have a look at the examples provided and/or comments in the source code for some examples.

Disclaimer: I'm the author of this library.

Krizalys
  • 121
  • 5
  • Can you explain why PHP 5.6 is the minimum requirement and if I try to use it with PHP 5.5. would it just not work at all, or would only a specific feature not work? Just asking because an upgrade in PHP may not be possible but I'm wondering if your library would still mostly work with PHP 5.5. – Vincent Feb 14 '21 at 02:05