User Tools

Site Tools


reviews:api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
reviews:api [2014/05/08 17:50]
jposeika [Input]
reviews:api [2016/11/25 14:34] (current)
jposeika [Input]
Line 21: Line 21:
 |action |**userRegister** |Yes | |action |**userRegister** |Yes |
 |account |Integer (10) |Yes | |account |Integer (10) |Yes |
 +|location |Variable characters (40) |Yes |
 +|api_key |Variable characters (40) |Yes |
 |nickname |Variable characters (50) |Yes | |nickname |Variable characters (50) |Yes |
 |email |Email address (100) |Yes | |email |Email address (100) |Yes |
 |password |Variable characters (20) |Yes | |password |Variable characters (20) |Yes |
 |library_card |Variable characters (40) |No | |library_card |Variable characters (40) |No |
-|location ​|Variable characters ​(40) |Yes | +|session_interval|Integer ​(6- in seconds|No (if empty, will apply default session length of 1440 seconds)| 
-|api_key |Variable characters ​(40) |Yes |+
  
  
Line 81: Line 83:
 |location|Variable characters (40)|Yes| |location|Variable characters (40)|Yes|
 |api_key|Variable characters (40)|Yes| |api_key|Variable characters (40)|Yes|
-|session_interval|Integer (6)|No|+|session_interval|Integer (6) - in seconds|No (if empty, will apply default session length of 1440 seconds)| 
  
 ==== Output ==== ==== Output ====
Line 112: Line 115:
 ==== Response code ==== ==== Response code ====
 |**Code** |**Code description** | |**Code** |**Code description** |
-|300|User logged in+|110|Response OK
-|310|Wrong email/​password| +|120|ISBN is empty|
-|315|User suspended| +
-|320|Empty password| +
-|330|Empty email|+
  
  
Line 383: Line 383:
 |location|Variable characters (40)|Yes| |location|Variable characters (40)|Yes|
 |api_key|Variable characters (40)|Yes| |api_key|Variable characters (40)|Yes|
-|session_id|varchar(32)|No|+|session_id|varchar(32)|No ​- if empty, will return default session interval|
 ==== Output ==== ==== Output ====
   * Format: XML, JSON   * Format: XML, JSON
Line 518: Line 518:
 |account|Integer (10)|Yes| | |account|Integer (10)|Yes| |
 |isbn|Variable characters (20)|Yes|10- or 13-character ISBN or other item ID| |isbn|Variable characters (20)|Yes|10- or 13-character ISBN or other item ID|
-|order|Integer (1)|No|Order reviews by (values): 1 - by newest, 2 - oldest, 3 - highest-rated,​ 4 - lowest-rated,​ 5 - most-useful,​ 6 - most-useful by advanced method|+|order|Integer (1)|No|Order reviews by (values): 1 - by newest, 2 - oldest, 3 - highest-rated,​ 4 - lowest-rated,​ 5 - most-useful,​ 6 - most-useful by advanced method, 7 - library'​s own reviews on top|
 |length|Integer (5)|No|Output length. If not specified - full review will be output| |length|Integer (5)|No|Output length. If not specified - full review will be output|
 |page_size|Integer (5)|No|How many reviews per page should be output, default 10| |page_size|Integer (5)|No|How many reviews per page should be output, default 10|
Line 624: Line 624:
  
  
 +</​code>​
 +
 +==== Response code ====
 +|**Code** |**Code description** |
 +|110|Response OK|
 +|120|ISBN is empty|
 +
 +
 +===== getProReviews:​ retrieving professional reviews for an item =====
 +This function allows retrieving professional reviews information on item by ISBNs (or other item ID)
 +==== Input ====
 +  * URL of XML output: https://​secure.chilifresh.com/​api/​reviews/​
 +  * URL of JSON output: https://​secure.chilifresh.com/​api/​reviews/​json/​
 +  * Method: GET
 +  * Parameters:
 +
 +|**Parameter** |**Type (size)** |**Mandatory** |**Description** |
 +|action|**getProReviews** |Yes| |
 +|account|Integer (10)|Yes| |
 +|location|Variable characters (40)|Yes|
 +|api_key|Variable characters (40)|Yes|
 +|isbn|Variable characters (20)|Yes|10- or 13-character ISBN or other item ID|
 +|page_size|Integer (5)|No|How many reviews per page should be output, default 10|
 +|page_number|Integer (5)|No|Which output page to show, default 1|
 +
 +  ​
 +**XML Retrieval example:**
 +<​code>​
 +https://​secure.chilifresh.com/​api/​reviews/?​isbn=0889652015&​account=20&​action=getProReviews&​api_key=1j132ioj12oij3
 +</​code>​
 +
 +**JSON Retrieval example:**
 +<​code>​
 +https://​secure.chilifresh.com/​api/​reviews/​json/?​isbn=0889652015&​account=20&​action=getProReviews&​api_key=1j132ioj12oij3
 +</​code>​
 +
 +==== Output ====
 +  * Format: XML, JSON
 +  * Blocks and elements:
 +
 +|**Block** |**Element** |**Type (size)**|**Exists** |**Description** |
 +|**Block //​response//​ starts**|||Always| |
 +|response|response_code|Integer (3)|Always|Response code from the table below|
 +|response|response_description|Text (255)|Always|Brief description of response code|
 +|response|response_time|Date&​time (D, d M Y H:​i:​s)|Always|Example:​ Wed, 26 Aug 2009 10:34:32|
 +|**Block //item// starts**|||If response code "​110"​| |
 +|item|isbn|Variable characters (20)|Always|Contains ISBN or other ID of an item|
 +|item|page_size|Integer (5)|Always|Number of reviews per page output|
 +|item|page_number|Integer (5)|Always|Current output page number|
 +|item|page_review_count|Integer (5)|Always|Number of reviews in current page|
 +|item|total_review_count|Integer (5)|Always|Total number of reviews for the item|
 +|**Block //item// ends**|||||
 +|**Block //results// starts**|||if //​item_count//​ larger than 0| |
 +|**Block //review// starts**|||if //​item_count//​ larger than 0| |
 +|review|review_id|Variable characters (10)|Always|ChiliFresh ID of the review|
 +|review|author_nickname|Variable characters (50)|Always|Nickname of the user posting the nickname|
 +|review|review_source|Variable characters (40)|Always|Full English name of review source|
 +|review|review_url|Variable characters (40)|Always|Full URL of the review source|
 +|review|review_country|Variable characters (2)|Always|Two-character code of the country of library where the review has been posted|
 +|review|review_date|Date & time (D, d M Y H:​i:​s)|No|Date and time of review posted adjusted to library'​s timezone, e.g., Tue, 26 Aug 2008 20:44:42|
 +|review|review_title|Variable characters (50)|No|Title of review set by user|
 +|review|review_text|Text (unlimited)|Always|Text of review, limited to 600 symbols + must add review_url as "Read full review"​|
 +|**Block //review// ends**|||||
 +|**Block //results// ends**|||||
 +|**Block //​response//​ ends**|||||
 +
 +
 +
 +**XML output example:**
 +<​code>​
 +<?xml version="​1.0"?>​
 +TO BE ADDED
 </​code>​ </​code>​
  
Line 1218: Line 1290:
 |630|Review ID not valid| |630|Review ID not valid|
 |60|Session invalid, expired or empty| |60|Session invalid, expired or empty|
 +
 +
 +===== remindReview:​ remind a user to write a review =====
 +This call sends user an e-mail notification with a link back to catalog to write a review for item. The purpose is to make this call when user checks item back into the library.
 +
 +==== Input ====
 +  * URL for XML output: https://​secure.chilifresh.com/​api/​reviews/​
 +  * URL for JSON output: https://​secure.chilifresh.com/​api/​reviews/​json/​
 +  * Method: POST
 +  * Parameters:
 +
 +|**Parameter** |**Type (size)** |**Mandatory** |
 +|action|**ramingReview** |Yes|
 +|account|Integer (10)|Yes|
 +|location|Variable characters (40)|Yes|
 +|api_key|Variable characters (40)|Yes|
 +|user_id|Integer (10)|Mandatory if //email// parameter is empty)|
 +|email|E-mail format|Mandatory if //user_id// parameter is empty|
 +|name|User'​s name|No|
 +|isbn|ISBN, UPC, ISSN or other item identifier|Yes|
 +
 +
 +
 +==== Output ====
 +  * Format: XML, JSON
 +  * Blocks and elements:
 +
 +|**Block** |**Element** |**Type (size)**|**Exists** |**Description** |
 +|**Block //​response//​ starts**|||Always| |
 +|response|response_code|Integer (3)|Always|Response code from the table below|
 +|response|response_description|Text (255)|Always|Brief description of response code|
 +|response|response_time|Date&​time (D, d M Y H:​i:​s)|Always|Example:​ Wed, 26 Aug 2009 10:34:32|
 +|**Block //​response//​ ends**|||||
 +
 +
 +
 +**XML output example:**
 +<​code>​
 +<?xml version="​1.0"?>​
 +<​response>​
 + <​response_code>​642</​response_code>​
 + <​response_description>​Reviews reminder sent successfully</​response_description>​
 + <​response_time>​Wed,​ 26 Jun 2014 14:​22:​05</​response_time>​
 +</​response>​
 +</​code>​
 +
 +==== Response code ====
 +|**Code** |**Code description** |
 +|641|Reviews reminder not sent due to internal error|
 +|642|Reviews reminder sent successfully|
 +|643|Supplied e-mail empty, invalid or user information does not contain valid e-mail|
 +|644|Item ID not provided|
 +|645|Library does not allow sending reviews reminders|
  
 ====== Review moderation functions ====== ====== Review moderation functions ======
Line 2070: Line 2195:
 |**Code** |**Code description** | |**Code** |**Code description** |
 |1001|Response OK| |1001|Response OK|
 +|60|Session invalid, expired or empty|
 +
 +===== ratingUserCheck:​ checks whether user has rated this item already =====
 +Checks whether user has rated particular items.
 +
 +==== Input ====
 +  * URL for XML output: https://​secure.chilifresh.com/​api/​reviews/​
 +  * URL for JSON output: https://​secure.chilifresh.com/​api/​reviews/​json/​
 +  * Method: GET
 +  * Parameters:
 +
 +|**Parameter** |**Type (size)** |**Mandatory** |
 +|action|**ratingUserCheck** |Yes|
 +|account|Integer (10)|Yes|
 +|isbn|Varchar (20)|Yes|
 +|session_id|Session ID|Yes|
 +|location|Variable characters (40)|Yes|
 +|api_key|Variable characters (40)|Yes|
 +
 +==== Output ====
 +  * Format: XML, JSON
 +  * Blocks and elements:
 +
 +**XML output example:**
 +<​code>​
 +<?xml version="​1.0"?>​
 +<​response>​
 + <​response_code>​100</​response_code>​
 + <​response_description>​Response OK</​response_description>​
 + <​rating_count>​1</​rating_count>​
 + <​response_time>​Wed,​ 26 Aug 2009 13:​20:​05</​response_time>​
 + <​rating>​4</​rating>​
 +</​response>​
 +</​code>​
 +
 +==== Response code ====
 +|**Code** |**Code description** |
 +|100|Response OK|
 +|120|ISBN is empty|
 |60|Session invalid, expired or empty| |60|Session invalid, expired or empty|
  
reviews/api.1399589415.txt.gz · Last modified: 2014/05/08 17:50 by jposeika