Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:27:01+00:00 2026-06-05T15:27:01+00:00

I would like to access skyDrive using PHP. I want to retreive list of

  • 0

I would like to access skyDrive using PHP.
I want to retreive list of files and folders, download, upload and delete files.

I’ve got a microsoft dev clientID and clientSecret.

Can anybody get me started with connecting to skyDrive with OAuth and making use of the API?

Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:27:02+00:00Added an answer on June 5, 2026 at 3:27 pm

    This is actually quite a broad question. Here’s hopefully something that will get you started.

    1. Have a look at SkyDrives REST API.
    2. You could use PHP cURL to perform the GET’s and POST’s.
    3. Use json_decode() to create a map of the received data.
    4. For any data you send, create maps in PHP and convert them to JSON using json_encode().

    Try the API

    Here is an interactive API you can try out live to see the responses.


    Making requests

    Example (taken from other SO Answer):

    $url = 'POST https://apis.live.net/v5.0/me/skydrive/files';
    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL, $url);
    curl_setopt($ch,CURLOPT_POSTFIELDS, array('access_token' => TOKEN, 'name' => 'file', 'filename' => "@HelloWorld.txt"));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $result = curl_exec($ch);
    curl_close($ch);
    

    Request types: http://msdn.microsoft.com/en-us/library/live/hh243648.aspx#http_verbs

    I also recommend you have a look at curl_setopt() to better understand how to do the different types of requests you’ll be needing, using cURL. (Also this answer on SO has some good explanation on POST vs GET using cURL.)


    File object

    • DELETE FILES:

      To delete a file, make a DELETE request to /FILE_ID.

    • UPLOAD FILES:

      To create a new File resource, you can either make a POST request to /FOLDER_ID/files, a POST request to the /UPLOAD_LOCATION for the target folder, or a PUT request to /FOLDER_ID/files/.

    • DOWNLOAD FILES:

      To get properties for a File resource, make a GET request to /FILE_ID (the target file ID).

      • The File resource will contain the URL from which to download the file from SkyDrive in the source field.

    Folder object

    • RETRIEVE LIST OF FILES:

      To get the root Folder resource by using the Live Connect REST API, make a GET request to either /me/skydrive or /USER_ID/skydrive.

      To get a subfolder resource, make a GET request to /FOLDER_ID.

    • CREATE FOLDERS:

      To create a new Folder resource, make a POST request to /FOLDER_ID. Pass the name and description attributes in the request body

    • DELETE FOLDERS:

      To delete a folder, make a DELETE request to /FOLDER_ID.


    OAuth 2.0

    My experience with OAuth is unfortunately limited. I can only provide some relevant links and advice which I hope will help.

    Review the Protocol Overview and consider if you want to implement something yourself, or use a library. Quick Google search gives me:

    • http://code.google.com/p/google-api-php-client/wiki/OAuth2
    • http://code.google.com/p/oauth2-php/
    • http://php.net/manual/en/book.oauth.php

    Some other potentially useful links and guides:

    • See PHP section of http://oauth.net/code/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to access a MySQL database using PHP. Can someone please explain
We have a project (Web/PHP) where we would like users to access their files,
I've got a website hosted on my IIS and I would like to access
I would like to access recent files that I had opened and then closed
I would like to access a PHP file whose name has UTF-8 characters in
I would like to access the list of functions and their descriptions that is
I would like to Access Play! Framework application over the LAN using different IP's
I would like to access members of objects contained in a list of such
I would like to access the Rails session secret programmatically (I am using it
I would like to access information on the logical drives on my computer using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.