Library Information System: REST Web Service
Resources
This table provides a list of all the resources exposed by this REST web service:
Resource | Methods | Description |
Session
|
GET
|
This resource returns a unique session id that needs to get passed to the other requests
|
Author
|
GET
|
This resource contains information on authors in the library catalog
|
Book
|
GET
,
POST
,
PUT
,
DELETE
|
This resource contains information on books in the library catalog
|
Book Image
|
POST
|
|
Accessing Services
To access these REST web services, you need to use the following base URL:
https://libraryinformationsystem.org/services/RestService.svc/
You can specify the format of data that will be returned (XML or JSON) by passing the following HTTP Headers:
-
Content-Type: application/xml - Sends data in XML format
-
accept: application/xml - Returns data in XML format
-
Content-Type: application/json - Sends data in JSON format
-
accept: application/json - Returns data in JSON format
To authenticate with the web service there are two methods:
Finally if you need to call one of the GET methods from a web page in another domain
you need to use the special JSONP (JSON with Padding) syntax. This tells the web service to return
the data in the form of a JavaScript <script> tag so that it be can be called across web site domains safely.
To request the data in JSONP format, just add the following extra querystring parameter:
?callback=[name of callback function]
Session
URI |
Method |
Description |
session
|
GET
|
Returns the unique session id that is used to prevent different user's requests getting mixed up
|
Author
Book
Book Image
URI |
Method |
Description |
book/{id}/image
|
POST
|
Uploads a file and returns the byte count
|