User Tools

Site Tools


connections-api

Connections API features (preliminary)

Proposed implementation principles

  • 3 level integration:
    • API calls for getting XML/JSON data back for integrating in catalog - [API]
    • API calls that return dynamic URL for widget to open in light-box over catalog for particular user - [lightbox]
    • Dynamic widgets for particular user to place right in catalog - [widget]
  • Standard Connections and Reviews implementation in search results, item details pages and at ANY item information throughout catalog (like checked out items, reading history, etc.)
  • Search results enhancement using ChiliFresh data

Open issues

  • If and how do we implement looking at other user profiles in Connections?
  • How do we style widgets? Do we agree on dimensions and styles before?
  • What do we show to a user if Connections is not accessible (for whatever reason)?
  • How do we handle errors/conflicts of single-sign on, e.g., user logs on OPAC user account, but for some reason (incorrect identifier, inexistent user, etc.) does not get logged in Connections?
  • How do we ask users to write reviews on the items they check back in? E-mail them?
  • How do we handle users that already are ChiliFresh users and will have registered with the particular e-mail addresses?
  • How do we identify OPAC requests with user_key parameter? Can we set up specific OPAC IP(s)?

User functions

  • Register [API/widget/lightbox]
    • Using single sign-on [API]
    • Using username and password [API/widget/lightbox]
    • Using Twitter and Facebook [widget/lightbox]
  • Login [API/widget/lightbox]
    • Using single sign-on [API]
    • Using username and password [API/widget/lightbox]
    • Using Twitter and Facebook [widget/lightbox]
  • Sign-out [API]

getUserProfile: get user profile information

Get user profile information

Input

Parameter Type (size) Mandatory
actiongetUserProfile Yes
accountInteger (10)Yes
user_idInteger (10)If session_id empty
session_idIf user_id empty
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>2900</response_code>
 <response_description>User account</response_description>
 <response_time>Sat, 27 Dec 2014 17:23:23</response_time>
 <nickname>Administrator</nickname>
 <location>Mesa, Arizona, United States</location>
 <age>4</age>
 <avatar_small_img>http://chilifresh.com/userpic/small/blank.png</avatar_small_img>
 <avatar_large_img>http://chilifresh.com/userpic/large/blank.png</avatar_large_img>
 <last_login>2014-12-27 12:02:07</last_login>
 <current_read>
  <isbn>24640175</isbn>
  <title>Harry Potter and the goblet of fire</title>
  <author>by J.K. Rowling.</author>
  <cover>https://content.chilifresh.com/?size=SC&amp;isbn=24640175</cover>
 </current_read>
</response>

Response code

Code Code description
2900User profile information provided
2901Inexistent user or profile restrictions
61User not logged in or not specified
  • Get/edit user information [API/widget/lightbox]
    • Gender
    • City (gets from library's settings, but can edit)
    • State (gets from library's settings, but can edit)
    • Country (gets from library's settings, but can edit)
    • Favorite quote
    • Birth date + whether to show it on profile
    • Current read - ISBN/UPC
    • User picture (3 sizes, JPG, GIF or PNG)
    • Facebook integration (user ID for opening user's FB page)
    • Twitter integration (username for opening Twitter profile)
  • User's news / updates (API/widget can show new items since last session in each) [API/widget/lightbox]:
    • Reviews
    • Recommendations
    • Friending invitations
    • Comments (like other user posts on wall)
    • Messages (internal messaging)
    • Replies to user's posts in discussion groups
    • Book clubs that are about to start
  • User statistics (includes user's data + average for the same number for all of user's friends) [API/widget]:
    • Number of friends
    • Books on bookshelves
    • Reviews posted
    • Number of recommendations made
    • Number of comments on wall
  • User histories [API/widget/lightbox]:
    • Who visited user's profile (last 10 people)
    • Which profiles user visited (last 10 people)
    • Which items user last visited (last 10 items)
  • Get/set user interests - [API/lightbox]

Bookshelf functions

bookshelfCreate: create new user bookshelf

Creates a new user bookshelf

Input

Parameter Type (size) Mandatory
actionbookshelfCreate Yes
accountInteger (10)Yes
shelfnameVariable characters(50)Yes
defaultyes/noNo (default: no)
publicyes/noNo (default: no)
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callYes
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>2100</response_code>
 <response_description>Bookshelf created successfully</response_description>
 <response_time>Sat, 27 Dec 2014 13:02:20</response_time>
 <user_id>64</user_id>
 <shelf_id>22773</shelf_id>
 <shelf_name>APIshelf</shelf_name>
</response>

Response code

Code Code description
2100Bookshelf created successfully
2101Empty bookshelf name
60Session invalid, expired or empty

bookshelfDelete: delete an existing bookshelf of user

Delete an existing bookshelf of user

Input

Parameter Type (size) Mandatory
actionbookshelfDelete Yes
accountInteger (10)Yes
shelf_idInteger(10)Yes
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callYes
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>123</response_code>
 <response_description>Shelf deleted successfully</response_description>
 <response_time>Sat, 27 Dec 2014 13:51:32</response_time>
</response>

Response code

Code Code description
2200Shelf deleted successfully
2201Cannot delete bookshelf
60Session invalid, expired or empty

bookshelfChangeSettings: change settings of bookshelf

Changes settings of a bookshelf

Input

Parameter Type (size) Mandatory
actionbookshelfChangeSettings Yes
accountInteger (10)Yes
shelf_idInteger (10)Yes
defaultyes/noNo
publicyes/noNo
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callYes
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>2300</response_code>
 <response_description>Settings changed successfully</response_description>
 <response_time>Sat, 27 Dec 2014 15:30:23</response_time>
</response>

Response code

Code Code description
2300Settings changed successfully
2301Cannot change settings to bookshelf
60Session invalid, expired or empty

bookshelfAddItem: add an item to bookshelf

Add an item - book, CD, DVD, etc. - to an existing bookshelf

Input

Parameter Type (size) Mandatory
actionbookshelfAddItem Yes
accountInteger (10)Yes
shelf_idInteger (10)Yes
item_idISBN, UPC, ISSN, etc.Yes
cf_item_idInteger (10) - item identifier from CF databaseNo
item_titleVariable characters (100) - item titleOnly if adding unidentified item by item_id
item_authorVariable characters (100) - item authorOnly if adding unidentified item by item_id
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callYes
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>2400</response_code>
 <response_description>Item added to shelf successfully</response_description>
 <response_time>Sat, 27 Dec 2014 15:46:04</response_time>
</response>

Response code

Code Code description
2400Item added to shelf successfully
2401Cannot identify item
2402Cannot add item to bookshelf
2403Empty item identifier
60Session invalid, expired or empty

bookshelfRemoveItem: remove an item from an existing bookshelf

Remove an item from an existing bookshelf

Input

Parameter Type (size) Mandatory
actionbookshelfAddItem Yes
accountInteger (10)Yes
shelf_idInteger (10)Yes
item_idISBN, UPC, ISSN, etc.Yes
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callYes
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>2500</response_code>
 <response_description>Item removed successfully</response_description>
 <response_time>Sat, 27 Dec 2014 15:46:04</response_time>
</response>

Response code

Code Code description
2500Item removed successfully
2501Cannot remove item from bookshelf
60Session invalid, expired or empty

bookshelfListShelves: listing all shelves of a user

Listing all shelves of a user - whether logged in user, or not logged in

Input

Parameter Type (size) Mandatory
actionbookshelfListShelves Yes
accountInteger (10)Yes
user_idVariable characters (32)If session_id empty
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callIf user_id empty
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>2600</response_code>
 <response_description>Shelves listed successfully</response_description>
 <response_time>Sat, 27 Dec 2014 16:07:49</response_time>
 <user_id></user_id>
 <bookshelves>
  <bookshelf>
   <id>22761</id>
   <item_count>0</item_count>
   <shelf_title>Test shelf</name>
   <order>0</order>
   <default>no</default>
   <required>no</required>
   <public>no</public>
   <date>Sat, 27 Dec 2014 11:57:28</date>
  </bookshelf>
 </bookshelves>
</response>

Response code

Code Code description
2600Shelves listed successfully
61User not logged in or not specified

bookshelfListItems: list all items of some particular bookshelf

List all items of some particular bookshelf

Input

Parameter Type (size) Mandatory
actionbookshelfListItems Yes
accountInteger (10)Yes
shelf_idInteger (10)Yes
user_IdInteger (10)If session_id empty
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callIf user_id emtpy
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>2700</response_code>
 <response_description>Listing of bookshelf successful</response_description>
 <response_time>Sat, 27 Dec 2014 17:05:21</response_time>
 <user_id>231853</user_id>
 <shelf_id>22762</shelf_id>
 <shelf_title>APIshelf2</shelf_title>
 <item_count>4</item_count>
 <shelf_type>private</shelf_type>
 <shelf_type_description>Own, full access</shelf_type_description>
 <items>
  <item>
   <title>Motivated minds</title>
   <author>Deborah Stipek and Kathy Seal.</author>
   <isbn>0805063951</isbn>
   <item_id>3</item_id>
   <work_id>3</work_id>
   <date>Sat, 27 Dec 2014 15:41:28</date>
  </item>
 </items>
</response>

Response code

Code Code description
2700Listing of bookshelf successful
61User not logged in or not specified

bookshelfMoveItem: move an item from one bookshelf to another

Move an item from one bookshelf to another

Input

Parameter Type (size) Mandatory
actionbookshelfMoveItem Yes
accountInteger (10)Yes
from_shelfInteger (10)Yes
to_shelfInteger (10)Yes
item_idInteger (10)Yes
session_idYes
locationVariable characters (40)If applicable
api_keyVariable characters (40)Yes

Output

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>2800</response_code>
 <response_description>Item moved successfully</response_description>
 <response_time>Sat, 27 Dec 2014 17:16:55</response_time>
</response>

Response code

Code Code description
2800Item moved successfully
2801Could not move item to other bookshelf
2802Target shelf does not belong to session user
60Session invalid, expired or empty

Account-related errors

Error code Error description
0System error
1Invalid (empty) API key
2Invalid API key
3API key request limit reached
4API key deactivated
5Invalid API call
20Empty account ID
30Account does not exists
40Account suspended
50Action not specified
  • Show user's bookshelf [widget/lightbox] - the widget can be displayed just as on Connections

For all features [API/lightbox]:

  • Get bookshelves - there can be several created by user
  • Create / delete bookshelves
  • Get bookshelf items - get items on particular bookshelf, sort them by title, author
  • Add item to bookshelf - add items to particular bookshelf. There is “default bookshelf” setting
  • Remove item from bookshelf
  • Move item between bookshelves
  • Create bookshelf widget - create widget and then retrieve code snippet for posting on blog or Facebook page
  • Import items - import items from files from other services like Goodreads, Shelfari, etc.

Item functions

For all features [API/lightbox]:

  • Add item manually - if item does not show up in library's or Connections search results, add item manually by adding ISBN/UPC, title, author and cover
  • Set item as current read - user can set current read to display on profile
  • Get item information - title, author, ISBN, etc. that we may have
  • Get item users (users who have item on their bookshelves)
  • Item tagging - get, add tags for particular item, retrieve items by tags. Tags distinguished between user's own tags and other user tags
  • Follow/unfollow item - user can follow particular item and see who added item to bookshelf, recommended, reviewed it, etc.
  • Get followings - get a list of events on followed items
  • Get suggested items - Connections item recommendations based on particular item, other users having it on their bookshelves, other items other users have on their bookshelves, have reviewed, recommended, etc.
  • Get items other users visited who checked out particular item - like on Amazon - where you can see what other users bought after buying particular item
  • Get related users - get users that are similar to particular user based on their bookshelves, other items other users have on their bookshelves, have reviewed, recommended, etc.
  • Get related communities - get communities that are related as above
  • Get related book clubs - get book clubs that are related as above
  • Get related discussion groups - get discussion groups that are related as above
  • Get related chat rooms - get chat rooms that are related as above
  • Personal item details - when user started/ended reading, comments, etc. This is private, does not get shared
  • Novelist data - gets Novelist content for particular item from API

Friends / users functions

For all features [API/lightbox]:

  • Get user's friends + links to their profiles
  • Follow/unfollow other users
  • Online/offline parameter of user
  • Get “My followings” - which users/friends the user follows
  • Get followings - get a list of events on which friend or person user follows has done
  • Browse library users
  • View other user profile
  • Instant messaging with user online [if user online]
  • Send internal mail message to user
  • Invite a friend who is not yet on Connections
  • Shared items - which items on user bookshelves are in common

Item recommendation functions

For all features [API/lightbox]:

  • See all recommendations
  • Recommend item to user
  • Recommend item over e-mail

List functions

For all features [API/lightbox]:

  • Get communities list + search
  • Get book clubs list + search
  • Get discussion groups list + search
  • Get chat rooms list + search
  • Get tags list + search
  • Get friends + search
  • Get library's users + search

Specific functions

All features in [lightbox]:

  • Discussion groups - see all, favorites, join one, create one, etc.
  • Chat rooms - see all, favorites, join one, create one, etc.
  • Book clubs - see all, favorites, join one, create one, etc.
  • Communities - see all, favorites, join one, create one, etc.
  • Reference desk chat - talk to reference desk librarian
  • Internal messaging - see all sent/received messages, send a message to user
connections-api.txt · Last modified: 2014/12/27 16:29 by jposeika