Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Defining OAuth Scope Inline Within the API Documentation

DZone's Guide to

Defining OAuth Scope Inline Within the API Documentation

Kin Lane is a huge fan of the creative ways people are evolving upon interactive documentation and making learning about APIs a hands-on experience wherever possible.

· Integration Zone ·
Free Resource

The new Gartner Critical Capabilities report explains how APIs and microservices enable digital leaders to deliver better B2B, open banking and mobile projects.

I am working on a project using the YouTube API and came across their inline OAut 2.0 scopes, which allow you to explore what the API does as you are browsing the API docs. I am a huge fan of what interactive documentation like Swagger UI and Apiary brought to the table, but I'm an even bigger fan of the creative ways people are evolving upon the concept, making learning about APIs a hands-on, interactive experience wherever possible.

To kick off my education of the YouTube API, I started playing with the search endpoint for the Youtube Data API. As I was playing with it, I noticed the had an API explorer allowing me to call the search method and see the live data.

Once I clicked on the "Authorize requests using OAuth 2.0" slider, I got a popup that gave me options for selecting OAuth 2.0s copies that would be applied by the API explorer when I make API calls.

The inline OAuth is simple, intuitive, and what I needed to define my API consumption in line within the YouTube API documentation. I didn't have to write any code or jump through a bunch of classic OAuth hoops. It gives me what I need for OAuth, right in the documentation: simple OAuth is something you don't see very often.

I'm a supporter of more API documentation being an attractive static HTML layout like this, with little interactive modules embedded throughout the API docs. I'm also interested in seeing more web literacy being thrown in at this layer as well, pulling common web concepts and specification details, and providing popups, tooltips, and other inline API design learning opportunities.

I'm adding YouTube's approach to OAuth to my list of approaches to a modular approach to delivering interactive API documentation for use in future storytelling.

The new Gartner Critical Capabilities for Full Lifecycle API Management report shows how CA Technologies helps digital leaders with their B2B, open banking, and mobile initiatives. Get your copy from CA Technologies.

Topics:
integration ,oauth ,youtube ,api

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}