Using The NPR API To Share Your Work

We’re implementing a new WordPress plugin to “ingest” StateImpact posts into the NPR API and, thus, your stations’ sites.

Most of our states have been pushing posts to the API since launch. But the plugin that we’d been using had limited functionality. Kevin Moylan and others at NPR Digital Services have been working on developing a new plugin that works much better. And, now, it is ready to launch.

Here’s what you can expect to transfer nicely from WordPress to Core Publisher using v1.5 of the plugin:

  • Regular posts (including bylines and excerpts)
  • Inline Images (including captions and credits). All images in the post will be sent to the API regardless of the “can distribute” flag in the WordPress Media Library. 
  • Audio (see instructions below)
  • Video embeds (and other iFrames that can be inserted into posts)

Features that won’t transfer nicely (many of which you can still recreate manually in Core Publisher by following these instructions) include:

  • Maps (either the Fusion Tables Map custom post type or ones inserted with iframes)
  • JiffyPosts (and other custom post types)
  • Sortable tables: The post text will make it but the table will be stripped out.
  • Slideshows: The images will appear in the body of the post, however. If you want to include these, you’ll need to recreate them directly in the CP-side post.
  • Updates: Posts are sent to the API when they’re first published. To update a post in the API, you should unpublish and then republish the post.
  • DocumentCloud (The documents themselves won’t appear in CorePublisher, but a link to the document will be inserted in its place. There is a better way to do this if you’re willing to rebuild the post in CorePublisher. The documentation can be found here.)
  • Formatting for images, related content modules and other elements will be different.

Publishing data elements and slideshows in Core Publisher

If a data element or slideshow is a key feature of a post, those posts will need to be built individually, outside of the API ingest system. Maps will need to be added as iframes. Sortable tables simply don’t work in Core Publisher, but static tables will (also with an iframe). Slideshows and jiffy posts can be created through the Core Publisher interface. For more on making your favorite StateImpact features work in Core Publisher, check out this toolbox post.

How to make sure audio links make it to the API

One of the attractions to using the API is that your broadcast stories can be syndicated digitally. But we’ve found that you have to follow a specific workflow to get your audio stories into the API.

  1. Your audio mp3 file must be hosted in the WordPress Media Library. This is a change from past recommendations.   
  2. You must upload your mp3 file at the same time that you insert it into the post. Audio files that are already in the Media Library before you click “Add Media” will not get sent to the API.

Pulling StateImpact posts into your station’s Core Publisher site

For information on how to bring stories into Core Publisher from the API, contact your station’s web editor. You’ll need to know your StateImpact API “OrgID,” which is different from your station’s API OrgID.

Leave a Reply

Your email address will not be published. Required fields are marked *