using the dpla api as community reps webinar august 19, 2014 a platform to build upon danielle...
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/1.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/2.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/3.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/4.jpg)
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 6: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/6.jpg)
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 8: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/8.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/9.jpg)
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 10: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/10.jpg)
Working example at http://www.dcplumer.com/dpla-search/dpla-api-search.php
http://api.dp.la/v2/items?q=panda&api_key=$YOUR_KEY
![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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/11.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/12.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/13.jpg)
![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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/14.jpg)
![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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/15.jpg)
![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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/16.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/17.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/18.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/19.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/20.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/21.jpg)
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 22: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/22.jpg)
DPLA API Requesthttp://api.dp.la/v2/items?sourceResource.title=panda&sourceResource.type=image&api_key=$YOUR_KEY
![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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/23.jpg)
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 24: Using the DPLA API as Community Reps Webinar August 19, 2014 A PLATFORM TO BUILD UPON Danielle Cunniff Plumer danielle@dcplumer.com @dcplumer](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/24.jpg)
Discovering Facet Optionshttp://api.dp.la/v2/items?sourceResource.title=panda&facets=sourceResource.type,provider.name&api_key=$YOUR_KEY
Facet: Type
Facet: Provider Name
![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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/25.jpg)
Designing a DPLA Advanced Search• See http://europeana.eu/portal/widget/editor.html for ideas:
![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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/27.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/28.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/29.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/30.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/31.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022062421/56649ddf5503460f94ad9829/html5/thumbnails/32.jpg)
App Wishlist• http://dp.la/info/developers/ideas-and-projects/current-ideas/