Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Ian Svoboda
Ian Svoboda
16,639 Points

How can I use the OneDrive API to display photos on my webpage?

Summary/Purpose

I'm trying to get all the photos from a specific, public OneDrive album and display them to my webpage using the OneDrive API. The purpose here is to use the images in this album to populate a gallery on one of the site's pages.

Issues

I've done some reading on the developer page and it certainly seems possible. I'm getting stuck on access tokens however.

From what I can gather, it looks like i'd need to authenticate to retrieve this type of data (i.e. sign in, provide access token, then get the data). I would ideally like to bypass this since the album folder isn't private but I'm lost on where to start.

I don't want someone to do this for me of course, I'm just looking for some "experienced direction".

About me

I have very little experience with APIs but I am familiar with HTML, CSS, PHP, and Javascript/jQuery.

I'll be happy to answer any additional questions needed.

Dave McFarland
Dave McFarland
Treehouse Teacher

Hi Ian Svoboda

Can you post a link (or links) to the developer pages for OneDrive?

Ian Svoboda
Ian Svoboda
16,639 Points

My bad I should've included that originally! http://msdn.microsoft.com/en-us/library/dn631839.aspx

I was looking under Scopes and Permissions (http://msdn.microsoft.com/en-us/library/dn631845.aspx) and I believe I found the methods/objects I can use, such as "Photo" (http://msdn.microsoft.com/en-us/library/hh243648.aspx#photo) but I'm still kind of stuck.

Really appreciate the help here!