Importing RAML API Representations to Create API Monitors

The point of RAML (the RESTful API Modeling Language) is to make it “easy to manage the whole API lifecycle from design to sharing.” If you’ve created a RAML representation for your API, you can easily create an API Science monitor that checks the status of that API, using API Science’s RAML import capability.

In this post, we’ll use a Facebook RAML API specification to create a new API Science monitor.

To get started, log into your API Science account, and click the “Import” link at the top of the page:

api-science-home-page-menus

Scroll down to the “RAML” section and click the “Import From RAML” button:

import-from-raml-button

In this example, we’ll import a RAML specification from a URL:

raml-import-facebook-url

Here’s what this RAML file looks like:

#%RAML 0.8
title: Facebook Graph API
baseUri: "https://graph.facebook.com"
"/{node}": 
  uriParameters:
    node:
      description: "Details for node (ex: a user, group, page)."
      type: string
  get:
    description: "Get a single node."
    responses:
      200:
        body:
            application/json:

Clicking the “Import” button brings us to the import Facebook Graph API page:

raml-facebook-graph-api

Clicking the “GET” tab opens a detailed view of the API:

raml-facebook-graph-api-detail

Entering a “node” value is required. If you enter a node, then you can click the “GET” button to retrieve the normal response to the request (assuming the API is currently up). Here’s the upper portion of the result when I enter “whitehouse” in the “node” field and click the “GET” button:

raml-facebook-graph-response-top

Clicking the “Monitor on API Science” button creates your API Science monitor for the Facebook Graph API:

raml-facebook-graph-monitor-created

Clicking the link beneath “New Monitor Created” brings you to the summary page for your new API Science Facebook Graph API monitor:

facebook-graph-monitor-summary

We’ve now created a new API Science monitor by importing a RAML file from a URL.

–Kevin Farnham