using the dpla api as community reps webinar august 19, 2014 a platform to build upon danielle...

33
Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plum [email protected] @dcplumer

Upload: evan-taylor

Post on 25-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Using the DPLA API as

Community Reps WebinarAugust 19, 2014

A PLATFORM TO BUILD UPON

Danielle Cunniff [email protected]@dcplumer

Page 2: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

THE API: ACCESS TOMILLIONS OF ITEMS,FOR ANY PURPOSE

Page 3: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

What is an API?

Application Programming Interface

. . . a set of functions or routines that accomplish a specific task

. . . a specification of how objects work in a given object-oriented language

. . . an implementation of a protocol

Page 4: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

APIs you may have used

• Have you ever:• Accessed one library catalog from within another

library catalog?• Z39.50

• Embedded a Google Books preview in a library catalog?• Google Book Search Embedded Viewer API

• Geocoded addresses and place names for display on a map?• GeoNames Search Webservice• Google Maps API Geocoding Service

Page 5: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA Apps• http://dp.la/apps/

Page 6: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA Search Widget• https://github.com/lfarrell/DPLA-Search-Widget• https://github.com/lfarrell/Wordpress-DPLA-Search-Wi

dget-Plugin

• Generates a search query that is sent to the DPLA Portal (http://dp.la)

Page 7: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

http://dp.la/search?q=Panda

Page 8: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Behind the magic curtain

1. User puts search term into HTML form

2. Form prepends DPLA search URL (http://dp.la/search?q=)

3. Clicking “search” sends query to DPLA API using HTTP GET

4. DPLA Portal opens in same page

For discussion for how to customize this widget, see http://www.dcplumer.com/2014/04/hacking-dpla-at-tcdl/

Page 9: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA API Search Widget• https://github.com/dcplumer/dpla-search-tutorial/

• Generates a search query that returns results on your own web page using the DPLA API.

Page 11: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Behind the magic curtain

1. User puts search term into PHP form

2. PHP prepends API search URL and appends API Key

3. Clicking “search” sends query to DPLA API using curl4. Get results back from DPLA

5. Interpret results using a PHP function called json_decode

6. Display results

For step-by-step discussion, see http://www.dcplumer.com/resources/handouts/dpla-api-tutorial-2/

Page 12: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA API Results

Note: Shown in Mozilla Firefox with JSONView Extension

api.dp.la/v2/items?q=panda&api_key=$YOUR_KEY(API query with API Key appended)

Page 13: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer
Page 14: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer
Page 15: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer
Page 16: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA API Key

See http://dp.la/info/developers/codex/policies/#get-a-key • Mac or Linux: Terminal (in Applications/Utilities)curl -v -XPOST http://api.dp.la/v2/api_key/[email protected]

• Windows: CuRL or something similar • Browser plugins:

• Poster (Firefox)• Postman (Chrome)

Page 17: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA API Key – Terminal Method

Page 18: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA API Key – Postman Method

• Install Postman from Chrome Web Store (free)• Enter Request URL: http://api.dp.la/v2/api_key/YOUR_EMAIL

• Select method POST• Click Send

Page 19: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA API Key – Postman Method

Page 20: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA API Key – Postman Method

Page 21: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA API Requests• Allows Boolean operators AND and OR plus wildcards (*)• Allows searching within fields (similar to refinements in

DPLA Portal)

• By Format• Contributor• Partner• By Date• By Language• By Location• By Subject

Page 23: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Searching within Fields• Any field in

sourceResource:• title• collection• stateLocatedIn• type• description• Subject

• Provider (Partner)• dataProvider

(Contributing Institution)

http://dp.la/info/developers/codex/requests/

Page 25: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Designing a DPLA Advanced Search• See http://europeana.eu/portal/widget/editor.html for ideas:

Page 26: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

DPLA Apps• http://dp.la/apps/

Page 27: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Getting Code

Page 28: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Getting Code

Page 29: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Getting Code

Page 30: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

Getting Code

API Key

API Query

Page 31: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

App Wishlist• http://dp.la/info/developers/ideas-and-projects/

Page 32: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

App Wishlist• http://dp.la/info/developers/ideas-and-projects/current-ideas/

Page 33: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer

visit [email protected]

@dpla