Aleph Restful APIs Ori Miller June 2012.

29
Aleph Restful APIs Ori Miller June 2012

description

Table of contents Content Introduction EL Commons and the APIs Functions vs. resources JBoss and jlog Retrieval of record item Bibliographic information Retrieval of patron information Retrieval of circulation actions Unlike our competitors, we did not release a new revolutionized system every few years but rather took the evolutionary approach

Transcript of Aleph Restful APIs Ori Miller June 2012.

Page 1: Aleph Restful APIs Ori Miller June 2012.

Aleph Restful APIs

Ori Miller

June 2012

Page 2: Aleph Restful APIs Ori Miller June 2012.

2

Table of contents

Content

IntroductionEL Commons and the APIsFunctions vs. resourcesJBoss and jlog

Retrieval of record itemBibliographic information Retrieval of patron informationRetrieval of circulation actions

Page 3: Aleph Restful APIs Ori Miller June 2012.

3

Introduction• What is an API (Application Programming Interface)?

URL HTML

RESTful URL XML

Page 4: Aleph Restful APIs Ori Miller June 2012.

4

Introduction

Page 5: Aleph Restful APIs Ori Miller June 2012.

5

Introduction

Page 6: Aleph Restful APIs Ori Miller June 2012.

6

Introduction

The nice thing is that this URL can be sent from any software, not only Primo.Such as VuFind, or even your local institution web-site.

http://yezreelac.exlibris.co.il:1891/rest-dlf/patron/111111165/patronInformation/address

Page 7: Aleph Restful APIs Ori Miller June 2012.

7

Introduction• To see a full list of the Aleph Restful APIs:

http://www.exlibrisgroup.org/display/AlephOI/RESTful+APIs• An introduction to the Aleph Restful APIs (including

JBoss configuration) may be found at:http://www.exlibrisgroup.org/display/AlephOI/*Introduction+to+Aleph+RESTful+API

Page 8: Aleph Restful APIs Ori Miller June 2012.

8

Introduction• This presentation will not attempt to restate what is

already in the previously mentioned documents.• It will instead show actual examples via standard

URL, with a stress on the Restful API syntax.• The presentation is designed to be an accompaniment

to a real live lecture.

Page 9: Aleph Restful APIs Ori Miller June 2012.

9

Documentation Via EL Commons• Begin with the EL Commons CodeShare

Page 10: Aleph Restful APIs Ori Miller June 2012.

10

Via EL Commons• One way to arrive to information about the

RESTful APIs is to choose Aleph > Open Interfaces from within CodeShare

Page 11: Aleph Restful APIs Ori Miller June 2012.

11

Functions and Resources• From wikipedia:

See also: http://tomayko.com/writings/rest-to-my-wife

Page 12: Aleph Restful APIs Ori Miller June 2012.

12

Functions and Resources• We don’t need documentation. Only the URL:• http://yezreelac.exlibris.co.il:1891/rest-dlf/

• For POST / PUT / DELETE:• http://yezreelac.exlibris.co.il:1891/rest_test/test_rest.html

Page 13: Aleph Restful APIs Ori Miller June 2012.

13

Functions and Resources• The list of RESTful APIs contains both “functions” and

“resources”. • In general, verbs are “functions” and nouns are “resources”.

Thus:• “bookings” is a “resource” and has a corresponding URL: • http://il-aleph07:1893/rest-dlf/patron/00000036/circulationA

ctions/requests/bookings• “holds” is a “resource” and has a corresponding URL: • http://il-aleph07:1893/rest-dlf/patron/00000036/circulationA

ctions/requests/holds

• “Renew Loan” is a function. • It is activates, for example, when a patron renews his loans

from Primo

Page 14: Aleph Restful APIs Ori Miller June 2012.

14

JBoss and jlogFor the APIs to work, the JBoss must be running.There is information regarding JBoss configuration on EL commons at http://www.exlibrisgroup.org/display/AlephOI/*Introduction+to+Aleph+RESTful+APIAnd: How to Configure JBoss in Aleph.pdf (including: how to accept requests from specific IP address, and how to compress the XML)

The JBoss log files are in the jlog directory.

See KB 33999 if you the log disappeared after SP 20.2.6

aleph(a20_1)> alias jlog

cd $aleph_dev/ng/aleph/home/system/thirdparty/openserver/server/default/log

Page 16: Aleph Restful APIs Ori Miller June 2012.

16

Record items• If we remove the /items at the end of the URL … • http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/record

/USM01000052405/items• http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/record

/USM01000052405• Then we get a list of the possible additional URLs which may

be used for the API.• In this case the possibilities are “items” and “holdings” (as

we see in the next slide)

Page 17: Aleph Restful APIs Ori Miller June 2012.

17

Record items

Possibilities to use with the “record” parameter

Page 18: Aleph Restful APIs Ori Miller June 2012.

18

Bibliographic information• If we remove use the ?view=full option then we can see the

record in xml format• http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/record

/USM01000052405?view=full

Page 19: Aleph Restful APIs Ori Miller June 2012.

19

patron patronInformation address• http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/patron/31397

2002/patronInformation/address• This URL shows the address of the patron

Page 20: Aleph Restful APIs Ori Miller June 2012.

20

patron

• If the URL is changed so that only “patron” and the “patron ID appear” (patronInformation is removed) …

• http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/patron/313972002/patronInformation/address

• http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/patron/313972002/

• Then a list of all possible options to use with “patron” will appear (as we see on the next slide)

Page 21: Aleph Restful APIs Ori Miller June 2012.

21

patron

We see here four possible options which may be used with “patron”

Page 22: Aleph Restful APIs Ori Miller June 2012.

22

patron

• Each of the four options on the previous slide also may have additional options.

• For example the third option http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/patron/313972002/patronStatus/ gives two additional options: blocks and registration

Option one

Option two

Page 23: Aleph Restful APIs Ori Miller June 2012.

23

Patron patronStatus blocks• Here we are using patron, patronStatus and Blocks

Page 24: Aleph Restful APIs Ori Miller June 2012.

24

circulationActions cash• http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/patron/31397

2002/circulationActions/cash?institution=USM50• This URL shows cash transactions of the patron

Page 25: Aleph Restful APIs Ori Miller June 2012.

25

circulationActions cash• Note that the results also include a link to each

specific cash transaction

Page 26: Aleph Restful APIs Ori Miller June 2012.

26

circulationActions

• http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/patron/313972002/circulationActions/cash?institution=USM50

• http://il-aleph07.corp.exlibrisgroup.com:1893/rest-dlf/patron/313972002/circulationActions?institution=USM50

• If we remove the /cash from the URL …

• Then we will get a list of links to the possible options which may be used with circulationActions

Page 27: Aleph Restful APIs Ori Miller June 2012.

27

Options with circulationActions

Links to the three options which may be used with circulationActions

Page 28: Aleph Restful APIs Ori Miller June 2012.

POST, PUT and DELETELimit to IP and gzip

28

Page 29: Aleph Restful APIs Ori Miller June 2012.

Thank [email protected]