User Tools

Site Tools


reviews:api

Table of Contents

Reviews API

Using Reviews API you can implement reviews into your library's OPAC, web page, iPhone app or anywhere else. It has output available in XML and JSON.

Please note:

  • parameter account in the documentation is your library's ChiliFresh account ID
  • parameter location is particular location's variable
  • parameter api_key is the unique API key needed to be submitted with all requests. You can manage and get API keys by logging on to the Admin Panel (http://chilifresh.com) and going to the “API Keys” option on the General tab

Reviews user functions

userRegister: register a user for writing reviews

This function allows registering a user for posting reviews

Input

Parameter Type (size) Mandatory
action userRegister Yes
account Integer (10) Yes
location Variable characters (40) Yes
api_key Variable characters (40) Yes
nickname Variable characters (50) Yes
email Email address (100) Yes
password Variable characters (20) Yes
library_card Variable characters (40) No
session_intervalInteger (6) - in secondsNo (if empty, will apply default session length of 1440 seconds)

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
responseuser_idInteger (10)If response_code is “200”ChiliFresh user ID
responsesession_idVariable chars (100)If response_code is “200”Logged in user's session ID
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>200</response_code>
 <response_description>User registered</response_description>
 <response_time>Wed, 26 Aug 2009 13:17:31</response_time>
 <user_id>3455</user_id>
 <session_id>896de1f873893451f4d69881bb1b3362</session_id>
</response>

Response code

Code Code description
200User registered
210Nickname already taken
220Inappropriate email format
230Email already used
240Empty email
250Empty nickname
260Empty password

userLogin: login of a registered user

This function allows logging in a registered user for posting reviews

Input

Parameter Type (size) Mandatory
actionuserLogin Yes
accountInteger (10)Yes
emailEmail address (100)Yes
passwordVariable characters (20)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes
session_intervalInteger (6) - in secondsNo (if empty, will apply default session length of 1440 seconds)

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
responseuser_idInteger (10)If response_code is “300”ChiliFresh user ID
responsesession_idVariable chars (100)If response_code is “300”Logged in user's session ID
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>300</response_code>
 <response_description>User logged in</response_description>
 <response_time>Wed, 26 Aug 2009 13:20:05</response_time>
 <user_id>84</user_id>
 <session_id>896de1f873893451f4d69881bb1b3362</session_id>
</response>

Response code

Code Code description
110Response OK
120ISBN is empty

userLogout: log-out of a logged in user

This function allows logging out a logged in user

Input

Parameter Type (size) Mandatory
actionuserLogout Yes
accountInteger (10)Yes
session_idVariable characters (100)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (4)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>1000</response_code>
 <response_description>User logout OK</response_description>
 <response_time>Wed, 26 Aug 2009 14:20:05</response_time>
</response>

Response code

Code Code description
1000User logout OK
60Session invalid, expired or empty

userGetPassword: reset password for user

This function allows resetting a password of a registered user

Input

Parameter Type (size) Mandatory
actionuserGetPassword Yes
accountInteger (10)Yes
emailE-mail address (100)If nickname empty
nicknameVariable characters (20)If email empty
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>700</response_code>
 <response_description>Password reset and sent sucessfully</response_description>
 <response_time>Wed, 26 Aug 2009 13:28:18</response_time>
</response>

Response code

Code Code description
700Password reset and sent sucessfully
710Password not sent due to internal error
720No such user
730Supplied email not valid
740Both email and nickname empty

userChangePassword: change password for user

This function allows changing the password of a registered, logged-in user

Input

Parameter Type (size) Mandatory
actionuserChangePassword Yes
accountInteger (10)Yes
current_passwordVariable characters (20)Yes
new_passwordVariable characters (20)Yes
new_password_repeatedVariable characters (20)Yes
session_idVariable characters (20)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>801</response_code>
 <response_description>E-mail changed successfully</response_description>
 <response_time>Wed, 26 Aug 2009 13:40:14</response_time>
</response>

Response code

Code Code description
800Password changed successfully
810Current password does not match
820New and repeated passwords do not match
830Current password empty
840New password empty
850Repeated password empty
60Session invalid, expired or empty

userChangeNickname: change nickname for user

This function allows changing the nickname of a registered, logged-in user

Input

Parameter Type (size) Mandatory
actionuserChangeNickname Yes
accountInteger (10)Yes
current_passwordVariable characters (20)Yes
new_nicknameVariable characters (40)Yes
session_idVariable characters (20)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>802</response_code>
 <response_description>Nickname changed successfully</response_description>
 <response_time>Wed, 26 Aug 2009 13:40:14</response_time>
</response>

Response code

Code Code description
802Nickname changed successfully
812Current password does not match
832Current password empty
842New nickname empty
852Nickname already taken
60Session invalid, expired or empty

userChangeEmail: change e-mail for user

This function allows changing the email of a registered, logged-in user

Input

Parameter Type (size) Mandatory
actionuserChangePassword Yes
accountInteger (10)Yes
current_passwordVariable characters (20)Yes
new_emailVariable characters (100)Yes
session_idVariable characters (20)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>800</response_code>
 <response_description>Password changed successfully</response_description>
 <response_time>Wed, 26 Aug 2009 13:40:14</response_time>
</response>

Response code

Code Code description
801Password changed successfully
811Current password does not match
831Current password empty
841New mail empty
851Incorrect email format
861Email address already used
60Session invalid, expired or empty

Reviews general functions

Ratings user functions

getSessionExpirationInterval: providing session length

This function specifies session length

Input

Parameter Type (size) Mandatory
actiongetSessionExpirationInterval Yes
accountInteger (10)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes
session_idvarchar(32)No - if empty, will return default session interval

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
responseintervalInteger (10)AlwaysSession length
responseunitVarchar (20)AlwaysSession interval unit
Block response ends

XML output example:

<response>
  <response_code>123</response_code>
  <response_description>Session interval length</response_description>
  <response_time>Wed, 06 Nov 2013 11:28:55</response_time>
  <interval>1440</interval>
  <unit>seconds</unit>
</response>

Response code

Code Code description
123Session interval length

getRatings: retrieving ratings on number of items at once

This function allows retrieving ratings information on several items at once for comma-separated ISBNs

Input

Parameter Type (size) Mandatory
actiongetRatings Yes
accountInteger (10)Yes
isbnComma-separated 10- or 13-character ISBN or other item IDNo
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

XML Retrieval example:

https://secure.chilifresh.com/api/reviews/?isbn=0889652015,0790783517,0060598786&account=20&action=getRatings&api_key=1j132ioj12oij3

JSON Retrieval example:

https://secure.chilifresh.com/api/reviews/json/?isbn=0889652015,0790783517,0060598786&account=20&action=getRatings&api_key=1j132ioj12oij3

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block header startsIf response_code is “100”
headerrating_iconURL (100)NoUser-defined rating icon URL
headeritem_countInteger (3)YesCount of comma-separated ISBNs received and recognized
Block header ends
Block results startsif item_count larger than 0
Block item startsif item_count larger than 0, for every item
itemisbnVariable characters (20)AlwaysContains ISBN or other ID of an item
itemreview_countInteger (4)AlwaysNumber of reviews for an item with ID in isbn
itemsuggest_countInteger (4)if review_count larger than 0Number of how many users submitting reviews would suggest this item to a friend for an item with ID in isbn
itemrating_countInteger (4)Number of ratings for an item with ID in isbn
itemaverage_ratingDecimal (1,2)if review_count larger than 0Average rating for an item with ID in isbn
itempermanent_urlURL (100)AlwaysPermanent URL to reviews of the item with ID in isbn
Block item ends
Block results ends
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>100</response_code>
 <response_description>Response OK</response_description>
 <response_time>Wed, 26 Aug 2009 11:14:34</response_time>
 <header>
  <rating_icon>http://chilifresh.com/ratingicons/red_star.gif</rating_icon>
  <item_count>3</item_count>
 </header>
 <results>
  <item>
   <isbn>0889652015</isbn>
   <review_count>0</review_count>
   <permanent_url>http://chilifresh.com/reviews/?varA=20&amp;varB=book&amp;varC=0889652015</permanent_url>
  </item>
  <item>
   <isbn>0790783517</isbn>
   <review_count>3</review_count>
   <suggest_count>3</suggest_count>
   <rating_count>4</rating_count>
   <average_rating>4.67</average_rating>
   <permanent_url>http://chilifresh.com/reviews/?varA=20&amp;varB=book&amp;varC=0790783517</permanent_url>
  </item>
  <item>
   <isbn>0060598786</isbn>
   <review_count>0</review_count>
   <permanent_url>http://chilifresh.com/reviews/?varA=20&amp;varB=book&amp;varC=0060598786</permanent_url>
  </item>
 </results>
</response>

Response code

Code Code description
100Response OK

getReviews: retrieving reviews for an item

This function allows retrieving reviews information on item by ISBNs (or other item ID)

Input

Parameter Type (size) Mandatory Description
actiongetReviews Yes
accountInteger (10)Yes
isbnVariable characters (20)Yes10- or 13-character ISBN or other item ID
orderInteger (1)NoOrder 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
lengthInteger (5)NoOutput length. If not specified - full review will be output
page_sizeInteger (5)NoHow many reviews per page should be output, default 10
page_numberInteger (5)NoWhich output page to show, default 1
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

XML Retrieval example:

https://secure.chilifresh.com/api/reviews/?isbn=0889652015&account=20&action=getReviews&api_key=1j132ioj12oij3

JSON Retrieval example:

https://secure.chilifresh.com/api/reviews/json/?isbn=0889652015&account=20&action=getReviews&api_key=1j132ioj12oij3

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block header startsIf rating_icon not empty and response code “110”
headerrating_iconURL (100)If rating_icon not emptyUser-defined rating icon URL
Block header ends
Block item startsIf response code “110”
itemisbnVariable characters (20)AlwaysContains ISBN or other ID of an item
itempage_sizeInteger (5)AlwaysNumber of reviews per page output
itempage_numberInteger (5)AlwaysCurrent output page number
itempage_review_countInteger (5)AlwaysNumber of reviews in current page
itemtotal_review_countInteger (5)AlwaysTotal number of reviews for the item
itemsuggest_countInteger (5)AlwaysNumber of users posting reviews would suggest this item to a friend
itemaverage_ratingDecimal (1,2)AlwaysAverage rating for the item
itempermanent_urlURL (100)AlwaysPermanent URL to the reviews of the item in \\isbn
field
Block item ends
Block results startsif item_count larger than 0
Block review startsif item_count larger than 0
reviewreview_idInteger (10)AlwaysChiliFresh ID of the review
reviewauthor_nicknameVariable characters (50)AlwaysNickname of the user posting the nickname
reviewuser_idInteger (10)If registered userChiliFresh user ID if user registered, not appearing for anonymous reviews
reviewreview_cityVariable characters (40)AlwaysFull English name of city of library where the review has been posted
reviewreview_stateVariable characters (40)AlwaysFull English name of state of library where the review has been posted
reviewreview_countryVariable characters (2)AlwaysTwo-character code of the country of library where the review has been posted
reviewreview_dateDate & time (D, d M Y H:i:s)AlwaysDate and time of review posted adjusted to library's timezone, e.g., Tue, 26 Aug 2008 20:44:42
reviewreview_titleVariable characters (50)AlwaysTitle of review set by user
reviewreview_textText (unlimited)AlwaysText of review
reviewreview_ratingInteger (1)AlwaysRating of a review set by the user
reviewreview_suggestInteger (1)AlwaysShows if the user would suggest this item to a friend (1 - yes, 0 - no)
reviewreview_usefulInteger (5)AlwaysShows the sum of user useful / not useful responses (may be negative if more “not useful”) about the review
reviewreview_useful_yesInteger (5)AlwaysShows a number of users considering review to be useful
reviewreview_useful_noInteger (5)AlwaysShows a number of users considering review not to be useful
reviewreview_languageVariable characters (10)AlwaysChiliFresh internal code of languages, “eng” for English - others to follow here.
reviewsimilar_item_isbnVariable characters (20)If review for similar item10- or 13-character ISBN of the item, or other code IF review written for (other) similar item, not this particular ISBN/code
Block review ends
Block results ends
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>110</response_code>
 <response_description>Response OK</response_description>
 <response_time>Wed, 26 Aug 2009 11:35:08</response_time>
 <header>
  <rating_icon>http://chilifresh.com/ratingicons/red_star.gif</rating_icon>
 </header>
 <item>
  <isbn>0790783517</isbn>
  <page_size>10</page_size>
  <page_number>1</page_number>
  <page_review_count>3</page_review_count>
  <total_review_count>3</total_review_count>
  <suggest_count>3</suggest_count>
  <average_rating>4.67</average_rating>
  <permanent_url>http://chilifresh.com/reviews/?varA=20&amp;varB=book&amp;varC=0790783517</permanent_url>
 </item>
 <results>
  <review>
   <review_id>4917</review_id>
   <author_nickname>More Potter</author_nickname>
   <user_id>1446</author_uid>
   <review_city>Santa Monica</review_city>
   <review_state>California</review_state>
   <review_country>US</review_country>
   <review_date>Tue, 26 Aug 2008 20:44:42</review_date>
   <review_title>More Potter</review_title>
   <review_text>Great film!</review_text>
   <review_rating>4</review_rating>
   <review_suggest>1</review_suggest>
   <review_useful>0</review_useful>
   <review_useful_yes>0</review_useful_yes>
   <review_useful_no>0</review_useful_no>
   <review_language>eng</review_language>
  </review>
 </results>
</response>

Response code

Code Code description
110Response OK
120ISBN 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

Parameter Type (size) Mandatory Description
actiongetProReviews Yes
accountInteger (10)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes
isbnVariable characters (20)Yes10- or 13-character ISBN or other item ID
page_sizeInteger (5)NoHow many reviews per page should be output, default 10
page_numberInteger (5)NoWhich output page to show, default 1

XML Retrieval example:

https://secure.chilifresh.com/api/reviews/?isbn=0889652015&account=20&action=getProReviews&api_key=1j132ioj12oij3

JSON Retrieval example:

https://secure.chilifresh.com/api/reviews/json/?isbn=0889652015&account=20&action=getProReviews&api_key=1j132ioj12oij3

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block item startsIf response code “110”
itemisbnVariable characters (20)AlwaysContains ISBN or other ID of an item
itempage_sizeInteger (5)AlwaysNumber of reviews per page output
itempage_numberInteger (5)AlwaysCurrent output page number
itempage_review_countInteger (5)AlwaysNumber of reviews in current page
itemtotal_review_countInteger (5)AlwaysTotal number of reviews for the item
Block item ends
Block results startsif item_count larger than 0
Block review startsif item_count larger than 0
reviewreview_idVariable characters (10)AlwaysChiliFresh ID of the review
reviewauthor_nicknameVariable characters (50)AlwaysNickname of the user posting the nickname
reviewreview_sourceVariable characters (40)AlwaysFull English name of review source
reviewreview_urlVariable characters (40)AlwaysFull URL of the review source
reviewreview_countryVariable characters (2)AlwaysTwo-character code of the country of library where the review has been posted
reviewreview_dateDate & time (D, d M Y H:i:s)NoDate and time of review posted adjusted to library's timezone, e.g., Tue, 26 Aug 2008 20:44:42
reviewreview_titleVariable characters (50)NoTitle of review set by user
reviewreview_textText (unlimited)AlwaysText 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:

<?xml version="1.0"?>
TO BE ADDED

Response code

Code Code description
110Response OK
120ISBN is empty

getUserReviews: get reviews of particular registered user

This function allows retrieving reviews for any registered user

Input

Parameter Type (size) Mandatory Description
actiongetUserReviews Yes
accountInteger (10)Yes
user_idInteger (10)YesChiliFresh internal user ID
orderInteger (1)NoOrder reviews by (values): 1 - by newest, 2 - oldest, 3 - highest-rated, 4 - lowest-rated, 5 - most-useful
lengthInteger (5)NoOutput length. If not specified - full review will be output
page_sizeInteger (5)NoHow many reviews per page should be output, default 10
page_numberInteger (5)NoWhich output page to show, default 1
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

XML Retrieval example:

https://secure.chilifresh.com/api/reviews/?user_id=84&account=20&action=getUserReviews&api_key=1j132ioj12oij3

JSON Retrieval example:

https://secure.chilifresh.com/api/reviews/json/?user_id=84&account=20&action=getUserReviews&api_key=1j132ioj12oij3

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block header startsIf rating_icon not empty and response code “110”
headerrating_iconURL (100)If rating_icon not emptyUser-defined rating icon URL
Block header ends
Block user startsIf response code “130”
useruser_idInteger (10)AlwaysChiliFresh internal user ID
useruser_nicknameVariable characters (20)AlwaysUser's nickname
useruser_cityVariable characters (40)AlwaysUser's library's city
useruser_stateVariable characters (40)AlwaysUser's library's state
useruser_countryCharacters (2)AlwaysUser's library's country
userpage_sizeInteger (5)AlwaysNumber of reviews per page output
userpage_numberInteger (5)AlwaysCurrent output page number
userpage_review_countInteger (5)AlwaysNumber of reviews in current page
usertotal_review_countInteger (5)AlwaysTotal number of reviews for the item
userpermanent_urlURL (100)AlwaysPermanent URL to the reviews of the item in isbn field
Block user ends
Block results startsif item_count larger than 0
Block review startsif item_count larger than 0
reviewreview_idInteger (10)AlwaysChiliFresh ID of the review
reviewitem_isbnVariable characters (20)Always10- or 13-character ISBN, or other ID of item
reviewreview_dateDate & time (D, d M Y H:i:s)AlwaysDate and time of review posted adjusted to library's timezone, e.g., Tue, 26 Aug 2008 20:44:42
reviewreview_titleVariable characters (50)AlwaysTitle of review set by user
reviewreview_textText (unlimited)AlwaysText of review
reviewreview_ratingInteger (1)AlwaysRating of a review set by the user
reviewreview_suggestInteger (1)AlwaysShows if the user would suggest this item to a friend (1 - yes, 0 - no)
reviewreview_usefulInteger (5)AlwaysShows the sum of user useful / not useful responses (may be negative if more “not useful”) about the review
reviewreview_useful_yesInteger (5)AlwaysShows a number of users considering review to be useful
reviewreview_useful_noInteger (5)AlwaysShows a number of users considering review not to be useful
reviewreview_languageVariable characters (10)AlwaysChiliFresh internal code of languages, “eng” for English - others to follow here.
Block review ends
Block results ends
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>130</response_code>
 <response_description>Response OK</response_description>
 <response_time>Wed, 26 Aug 2009 15:30:17</response_time>
 <header>
  <rating_icon>http://chilifresh.com/ratingicons/red_star.gif</rating_icon>
 </header>
 <user>
  <user_id>84</user_id>
  <user_nickname>The Juris</user_nickname>
  <user_city>Hooksett</user_city>
  <user_state>New Hampshire</user_state>
  <user_country>US</user_country>
  <page_size>1</page_size>
  <page_number>2</page_number>
  <page_review_count>1</page_review_count>
  <total_review_count>2</total_review_count>
  <permanent_url>http://chilifresh.com/reviews/?varA=20&amp;varB=reviewer&amp;varC=84</permanent_url>
 </user>
 <results>
  <review>
   <review_id>200</review_id>
   <item_isbn>006073132X</item_isbn>
   <review_date>Wed, 26 Sep 2007 18:28:18</review_date>
   <review_title>One great book</review_title>
   <review_text>This is a one great book! Suggested reading for anyone.</review_text>
   <review_rating>4</review_rating>
   <review_suggest>1</review_suggest>
   <review_useful>3</review_useful>
   <review_useful_yes>4</review_useful_yes>
   <review_useful_no>1</review_useful_no>   
   <review_language>eng</review_language>
  </review>
 </results>
</response>

Response code

Code Code description
130Response OK
140User ID is empty
150Such user does not exist

getUserReviewsAll: get all reviews of particular registered user

This function allows retrieving all reviews in different statuses for any registered and logged in user

Input

Parameter Type (size) Mandatory Description
actiongetUserReviews Yes
accountInteger (10)Yes
session_idVariable characters (35)YesValid ChiliFresh session
orderInteger (1)NoOrder reviews by (values): 1 - by newest (default), 2 - oldest, 3 - highest-rated, 4 - lowest-rated, 5 - most-useful
review_statusInteger (1)NoRetrieve reviews only in status: 1 - Awaiting moderation, 2 - Suspended, 3 - Rejected, 4 - Accepted, 5 - Unmoderated (will return all if empty)
lengthInteger (5)NoOutput length. If not specified - full review will be output
page_sizeInteger (5)NoHow many reviews per page should be output, default 10
page_numberInteger (5)NoWhich output page to show, default 1
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block header startsIf rating_icon not empty and response code “110”
headerrating_iconURL (100)If rating_icon not emptyUser-defined rating icon URL
Block header ends
Block user startsIf response code “130”
useruser_idInteger (10)AlwaysChiliFresh internal user ID
useruser_nicknameVariable characters (20)AlwaysUser's nickname
useruser_cityVariable characters (40)AlwaysUser's library's city
useruser_stateVariable characters (40)AlwaysUser's library's state
useruser_countryCharacters (2)AlwaysUser's library's country
userpage_sizeInteger (5)AlwaysNumber of reviews per page output
userpage_numberInteger (5)AlwaysCurrent output page number
userpage_review_countInteger (5)AlwaysNumber of reviews in current page
usertotal_review_countInteger (5)AlwaysTotal number of reviews for the item
userpermanent_urlURL (100)AlwaysPermanent URL to the reviews of the item in isbn field
Block user ends
Block results startsif item_count larger than 0
Block review startsif item_count larger than 0
reviewreview_idInteger (10)AlwaysChiliFresh ID of the review
reviewreview_statusVariable characters (30)AlwaysReview status - Awaiting moderation, Suspended, Rejected, Accepted or Unmoderated
reviewitem_isbnVariable characters (20)Always10- or 13-character ISBN, or other ID of item
reviewreview_dateDate & time (D, d M Y H:i:s)AlwaysDate and time of review posted adjusted to library's timezone, e.g., Tue, 26 Aug 2008 20:44:42
reviewreview_titleVariable characters (50)AlwaysTitle of review set by user
reviewreview_textText (unlimited)AlwaysText of review
reviewreview_ratingInteger (1)AlwaysRating of a review set by the user
reviewreview_suggestInteger (1)AlwaysShows if the user would suggest this item to a friend (1 - yes, 0 - no)
reviewreview_usefulInteger (5)AlwaysShows the sum of user useful / not useful responses (may be negative if more “not useful”) about the review
reviewreview_useful_yesInteger (5)AlwaysShows a number of users considering review to be useful
reviewreview_useful_noInteger (5)AlwaysShows a number of users considering review not to be useful
reviewreview_languageVariable characters (10)AlwaysChiliFresh internal code of languages, “eng” for English - others to follow here.
Block review ends
Block results ends
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>130</response_code>
 <response_description>Response OK</response_description>
 <response_time>Wed, 26 Aug 2009 15:30:17</response_time>
 <header>
  <rating_icon>http://chilifresh.com/ratingicons/red_star.gif</rating_icon>
 </header>
 <user>
  <user_id>84</user_id>
  <user_nickname>The Juris</user_nickname>
  <user_city>Hooksett</user_city>
  <user_state>New Hampshire</user_state>
  <user_country>US</user_country>
  <page_size>1</page_size>
  <page_number>2</page_number>
  <page_review_count>1</page_review_count>
  <total_review_count>2</total_review_count>
  <permanent_url>http://chilifresh.com/reviews/?varA=20&amp;varB=reviewer&amp;varC=84</permanent_url>
 </user>
 <results>
  <review>
   <review_id>200</review_id>
   <item_isbn>006073132X</item_isbn>
   <review_date>Wed, 26 Sep 2007 18:28:18</review_date>
   <review_title>One great book</review_title>
   <review_text>This is a one great book! Suggested reading for anyone.</review_text>
   <review_rating>4</review_rating>
   <review_suggest>1</review_suggest>
   <review_useful>3</review_useful>
   <review_useful_yes>3</review_useful_yes>
   <review_useful_no>0</review_useful_no>   
   <review_language>eng</review_language>
  </review>
 </results>
</response>

Response code

Code Code description
60Session invalid, expired or empty
130Response OK
150Such user does not exist

addUseful: add whether review was useful or not

This feature allows submitting whether a particular review was useful or not.

Input

Parameter Type (size) Mandatory Comment
actionaddUseful Yes
review_idReview IDYes
usefulOption: true/falseYes
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callsYes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
   <response_code>875</response_code>
   <response_description>Useful accepted</response_description>
   <response_time>Tue, 23 Aug 2011 21:41:43</response_time>
   <captcha_code>C993</captcha_code>
   <session_id>be2ed1d0b7620853956a275b26b25586</session_id>
</response>

Response code

Code Code description
875Useful accepted
876Useful not accepted
60Session invalid, expired or empty

reviewReportAbuse: report inappropriate reviews

This feature allows reporting inappropriate review content, which automatically submits review for moderation. One user has a limit of submitting 5 abuse reports per day.

Input

Parameter Type (size) Mandatory Comment
actionreviewReportAbuse Yes
accountLibrary IDYes
review_idID of a review to report abuse onYes
abuse_descriptionText Yes
session_idChiliFresh session IDYesCan be session from createUserSession (non-logged-in user) or from userLogin (logged-in registered user)
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
   <response_code>1100</response_code>
   <response_description>Review abuse report accepted</response_description>
   <response_time>Tue, 23 Aug 2011 21:41:43</response_time>
</response>

Response code

Code Code description
1100Review abuse report accepted
60Session invalid, expired or empty
1101Review ID invalid or empty
1102Review abuse description empty
1103User has reported 5 reviews already

getAnonymous: get library's setting on adding anonymous reviews

This function responds whether library accepts anonymous reviews and if yes - supplies “captcha_code” for the session to verify against spam-bots.

Input

Parameter Type (size) Mandatory Comment
actiongetAnonymous Yes
accountInteger (10)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
responsecaptcha_codeVarchar(4)If allowedA54T
responsesession_idVarchar (32)If allowedExample: 0aiso9au8s9du989a8sud989
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
   <response_code>460</response_code>
   <response_description>Catcha code acquired</response_description>
   <response_time>Tue, 23 Aug 2011 21:41:43</response_time>
   <captcha_code>C993</captcha_code>
   <session_id>be2ed1d0b7620853956a275b26b25586</session_id>
</response>

Response code

Code Code description
460Catcha code acquired
463Library does not accept anonymous reviews

addReviewAnonymous: posting a review by a non-registered anonymous user

This function allows posting a review without user registration, if library allows it. getAnonymous() call must be used for checking that and acquiring “captcha_code” parameter to use with the session.

Input

Parameter Type (size) Mandatory Comment
actionaddReviewAnonymous Yes
accountInteger (10)Yes
nicknameVarchar (50)Yes
captcha_codeVarchar (4)Yes Captcha code acquired with getAnonymous call
reviewText (unlimited)Yes
titleVariable chars (50)Yes
ratingInteger (1), 1-5YesValues: 1-5
suggestInteger (1)YesValue: 1-yes, 0-no
isbnVariable characters (20)Yes10- or 13-character ISBN for books or other item ID
session_idVariable characters (50)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>400</response_code>
 <response_description>Review posted OK</response_description>
 <response_time>Wed, 26 Aug 2009 13:56:59</response_time>
</response>

Response code

Code Code description
400Review posted OK
410Empty review
420Empty title
430Empty suggest field
440Empty rating
450Empty isbn
461Captcha code invalid or empty
462Nickname empty
60Session invalid, expired or empty

addReview: posting a review by registered and logged in user

This function allows a registered, logged-in user to post a review

Input

Parameter Type (size) Mandatory Comment
actionaddReview Yes
accountInteger (10)Yes
reviewText (unlimited)Yes
titleVariable chars (50)Yes
ratingInteger (1), 1-5YesValues: 1-5
suggestInteger (1)YesValue: 1-yes, 0-no
isbnVariable characters (20)Yes10- or 13-character ISBN for books or other item ID
session_idVariable characters (50)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>400</response_code>
 <response_description>Review posted OK</response_description>
 <response_time>Wed, 26 Aug 2009 13:56:59</response_time>
</response>

Response code

Code Code description
400Review posted OK
410Empty review
420Empty title
430Empty suggest field
440Empty rating
450Empty ISBN
451User already has posted review for this item
60Session invalid, expired or empty

updateReview: updating a review by registered and logged in user

This function allows a registered, logged-in user to update a review

Input

Parameter Type (size) Mandatory Comment
actionupdateReview Yes
accountInteger (10)Yes
reviewText (unlimited)Yes
titleVariable chars (50)Yes
ratingInteger (1), 1-5YesValues: 1-5
suggestInteger (1)YesValue: 1-yes, 0-no
review_idInteger (10)Yes
session_idVariable characters (50)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>500</response_code>
 <response_description>Review updated OK</response_description>
 <response_time>Wed, 26 Aug 2009 14:17:55</response_time>
</response>

Response code

Code Code description
500Review updated OK
510Review was not updated
520Empty review
530Empty title
540Empty suggest field
550Empty rating
560Empty review ID
60Session invalid, expired or empty

deleteReview: deleting a review by registered and logged in user

This function allows a registered, logged-in user to delete a review

Input

Parameter Type (size) Mandatory Comment
actiondeleteReview Yes
accountInteger (10)Yes
review_idInteger (10)Yes
session_idVariable characters (50)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>600</response_code>
 <response_description>Review deleted OK</response_description>
 <response_time>Wed, 26 Aug 2009 14:23:10</response_time>
</response>

Response code

Code Code description
600Review deleted OK
610Review not deleted
620Review ID is empty
630Review ID not valid
60Session 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

Parameter Type (size) Mandatory
actionramingReview Yes
accountInteger (10)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes
user_idInteger (10)Mandatory if email parameter is empty)
emailE-mail formatMandatory if user_id parameter is empty
nameUser's nameNo
isbnISBN, UPC, ISSN or other item identifierYes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?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>

Response code

Code Code description
641Reviews reminder not sent due to internal error
642Reviews reminder sent successfully
643Supplied e-mail empty, invalid or user information does not contain valid e-mail
644Item ID not provided
645Library does not allow sending reviews reminders

Review moderation functions

getUnmoderatedReviews: retrieving all unmoderated reviews for the moderator

This function allows retrieving unmoderated reviews for a particular moderator

Input

Parameter Type (size) Mandatory Description
actiongetUnmoderatedReviews Yes
accountInteger (10)Yes
session_idVariable characters (50)Yes
page_sizeInteger (5)NoHow many reviews per page should be output, default 10
page_numberInteger (5)NoWhich output page to show, default 1
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

XML Retrieval example:

https://secure.chilifresh.com/api/reviews/?account=20&action=getUnmoderatedReviews&session_id=ab24d653051b5a549de17ec6975228d3&api_key=1j132ioj12oij3

JSON Retrieval example:

https://secure.chilifresh.com/api/reviews/json/?account=20&action=getUnmoderatedReviews&session_id=ab24d653051b5a549de17ec6975228d3&api_key=1j132ioj12oij3

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block header startsIf response code “110”
headerpage_sizeInteger (5)AlwaysNumber of reviews per page output
headerpage_numberInteger (5)AlwaysCurrent output page number
headerpage_review_countInteger (5)AlwaysNumber of reviews in current page
headertotal_review_countInteger (5)AlwaysTotal number of reviews for the item
Block header ends
Block results startsif item_count larger than 0
Block review startsif item_count larger than 0
reviewisbnVariable characters (20)AlwaysContains ISBN or other ID of an item
reviewreview_idInteger (10)AlwaysChiliFresh ID of the review
reviewauthor_nicknameVariable characters (50)AlwaysNickname of the user posting the nickname
reviewuser_idInteger (10)If registered userChiliFresh user ID if user registered, doesn't appear for anonymous reviews
reviewreview_cityVariable characters (40)AlwaysFull English name of city of library where the review has been posted
reviewreview_stateVariable characters (40)AlwaysFull English name of state of library where the review has been posted
reviewreview_countryVariable characters (2)AlwaysTwo-character code of the country of library where the review has been posted
reviewreview_dateDate & time (D, d M Y H:i:s)AlwaysDate and time of review posted adjusted to library's timezone, e.g., Tue, 26 Aug 2008 20:44:42
reviewreview_titleVariable characters (50)AlwaysTitle of review set by user
reviewreview_textText (unlimited)AlwaysText of review
reviewreview_ratingInteger (1)AlwaysRating of a review set by the user
reviewreview_suggestInteger (1)AlwaysShows if the user would suggest this item to a friend (1 - yes, 0 - no)
reviewreview_usefulInteger (5)AlwaysShows the sum of user useful / not useful responses (may be negative if more “not useful”) about the review
reviewreview_useful_yesInteger (5)AlwaysShows a number of users considering review to be useful
reviewreview_useful_noInteger (5)AlwaysShows a number of users considering review not to be useful
reviewreview_languageVariable characters (10)AlwaysChiliFresh internal code of languages, “eng” for English - others to follow here.
Block review ends
Block results ends
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_time>Fri, 18 Sep 2009 11:05:42</response_time>
 <response_code>130</response_code>
 <response_description>Response OK</response_description>
 <header>
  <page_size>10</page_size>
  <page_number>1</page_number>
  <page_review_count>2</page_review_count>
  <total_review_count>2</total_review_count>
 </header>
 <results>
  <review>
   <review_id>1633</review_id>
   <author_nickname>Cool User X</author_nickname>
   <user_id>64</user_id>
   <review_city>Hooksett</review_city>
   <review_state>New Hampshire</review_state>
   <review_country>US</review_country>
   <review_date>Sat, 10 May 2008 11:41:46</review_date>
   <review_title>Test</review_title>
   <review_text>Test</review_text>
   <review_rating>1</review_rating>
   <review_suggest>1</review_suggest>
   <review_useful>2</review_useful>
   <review_useful_yes>2</review_useful_yes>
   <review_useful_no>0</review_useful_no>   
   <review_language>eng</review_language>
  </review>
  <review>
   <review_id>10724</review_id>
   <author_nickname>Cool User X</author_nickname>
   <user_id>64</user_id>
   <review_city>Hooksett</review_city>
   <review_state>New Hampshire</review_state>
   <review_country>US</review_country>
   <review_date>Thu, 29 Jan 2009 08:46:58</review_date>
   <review_title>Testing</review_title>
   <review_text>This is the first part of the review</review_text>
   <review_rating>3</review_rating>
   <review_suggest>0</review_suggest>
   <review_useful>1</review_useful>
   <review_useful_yes>1</review_useful_yes>
   <review_useful_no>0</review_useful_no>   
   <review_language>eng</review_language>
  </review>
 </results>
</response>

Response code

Code Code description
130Response OK
140Session empty, expired or invalid

getAcceptedReviews: retrieving all accepted reviews for the moderator

This function allows retrieving accepted reviews for a particular moderator

Input

Parameter Type (size) Mandatory Description
actiongetAcceptedReviews Yes
accountInteger (10)Yes
session_idVariable characters (50)Yes
page_sizeInteger (5)NoHow many reviews per page should be output, default 10
page_numberInteger (5)NoWhich output page to show, default 1
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

XML Retrieval example:

https://secure.chilifresh.com/api/reviews/?account=20&action=getAcceptedReviews&session_id=ab24d653051b5a549de17ec6975228d3&api_key=1j132ioj12oij3

JSON Retrieval example:

https://secure.chilifresh.com/api/reviews/json/?account=20&action=getAcceptedReviews&session_id=ab24d653051b5a549de17ec6975228d3&api_key=1j132ioj12oij3

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block header startsIf response code “110”
headerpage_sizeInteger (5)AlwaysNumber of reviews per page output
headerpage_numberInteger (5)AlwaysCurrent output page number
headerpage_review_countInteger (5)AlwaysNumber of reviews in current page
headertotal_review_countInteger (5)AlwaysTotal number of reviews for the item
Block header ends
Block results startsif item_count larger than 0
Block review startsif item_count larger than 0
reviewisbnVariable characters (20)AlwaysContains ISBN or other ID of an item
reviewreview_idInteger (10)AlwaysChiliFresh ID of the review
reviewauthor_nicknameVariable characters (50)AlwaysNickname of the user posting the review
reviewuser_idInteger (10)If registered userChiliFresh user ID if user registered, doesn't appear for anonymous reviews
reviewreview_cityVariable characters (40)AlwaysFull English name of city of library where the review has been posted
reviewreview_stateVariable characters (40)AlwaysFull English name of state of library where the review has been posted
reviewreview_countryVariable characters (2)AlwaysTwo-character code of the country of library where the review has been posted
reviewreview_dateDate & time (D, d M Y H:i:s)AlwaysDate and time of review posted adjusted to library's timezone, e.g., Tue, 26 Aug 2008 20:44:42
reviewreview_titleVariable characters (50)AlwaysTitle of review set by user
reviewreview_textText (unlimited)AlwaysText of review
reviewreview_ratingInteger (1)AlwaysRating of a review set by the user
reviewreview_suggestInteger (1)AlwaysShows if the user would suggest this item to a friend (1 - yes, 0 - no)
reviewreview_usefulInteger (5)AlwaysShows the sum of user useful / not useful responses (may be negative if more “not useful”) about the review
reviewreview_useful_yesInteger (5)AlwaysShows a number of users considering review to be useful
reviewreview_useful_noInteger (5)AlwaysShows a number of users considering review not to be useful
reviewreview_languageVariable characters (10)AlwaysChiliFresh internal code of languages, “eng” for English - others to follow here.
Block review ends
Block results ends
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_time>Fri, 18 Sep 2009 11:05:42</response_time>
 <response_code>130</response_code>
 <response_description>Response OK</response_description>
 <header>
  <page_size>10</page_size>
  <page_number>1</page_number>
  <page_review_count>2</page_review_count>
  <total_review_count>2</total_review_count>
 </header>
 <results>
  <review>
   <review_id>1633</review_id>
   <author_nickname>Cool User X</author_nickname>
   <user_id>64</user_id>
   <review_city>Hooksett</review_city>
   <review_state>New Hampshire</review_state>
   <review_country>US</review_country>
   <review_date>Sat, 10 May 2008 11:41:46</review_date>
   <review_title>Test</review_title>
   <review_text>Test</review_text>
   <review_rating>1</review_rating>
   <review_suggest>1</review_suggest>
   <review_useful>2</review_useful>
   <review_useful_yes>2</review_useful_yes>
   <review_useful_no>0</review_useful_no>   
   <review_language>eng</review_language>
  </review>
  <review>
   <review_id>10724</review_id>
   <author_nickname>Cool User X</author_nickname>
   <user_id>64</user_id>
   <review_city>Hooksett</review_city>
   <review_state>New Hampshire</review_state>
   <review_country>US</review_country>
   <review_date>Thu, 29 Jan 2009 08:46:58</review_date>
   <review_title>Testing</review_title>
   <review_text>This is the first part of the review</review_text>
   <review_rating>3</review_rating>
   <review_suggest>0</review_suggest>
   <review_useful>1</review_useful>
   <review_useful_yes>2</review_useful_yes>
   <review_useful_no>1</review_useful_no>   
   <review_language>eng</review_language>
  </review>
 </results>
</response>

Response code

Code Code description
130Response OK
140Session empty, expired or invalid

getRejectedReviews: retrieving all rejected reviews for the moderator access

This function allows retrieving rejected reviews for a particular moderator

Input

Parameter Type (size) Mandatory Description
actiongetRejectedReviews Yes
accountInteger (10)Yes
session_idVariable characters (50)Yes
page_sizeInteger (5)NoHow many reviews per page should be output, default 10
page_numberInteger (5)NoWhich output page to show, default 1
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

XML Retrieval example:

https://secure.chilifresh.com/api/reviews/?account=20&action=getRejectedReviews&session_id=ab24d653051b5a549de17ec6975228d3&api_key=1j132ioj12oij3

JSON Retrieval example:

https://secure.chilifresh.com/api/reviews/json/?account=20&action=getRejectedReviews&session_id=ab24d653051b5a549de17ec6975228d3&api_key=1j132ioj12oij3

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block header startsIf response code “110”
headerpage_sizeInteger (5)AlwaysNumber of reviews per page output
headerpage_numberInteger (5)AlwaysCurrent output page number
headerpage_review_countInteger (5)AlwaysNumber of reviews in current page
headertotal_review_countInteger (5)AlwaysTotal number of reviews for the item
Block header ends
Block results startsif item_count larger than 0
Block review startsif item_count larger than 0
reviewisbnVariable characters (20)AlwaysContains ISBN or other ID of an item
reviewreview_idInteger (10)AlwaysChiliFresh ID of the review
reviewauthor_nicknameVariable characters (50)AlwaysNickname of the user posting the nickname
reviewuser_idInteger (10)If registered userChiliFresh user ID if user registered, doesn't appear for anonymous reviews
reviewreview_cityVariable characters (40)AlwaysFull English name of city of library where the review has been posted
reviewreview_stateVariable characters (40)AlwaysFull English name of state of library where the review has been posted
reviewreview_countryVariable characters (2)AlwaysTwo-character code of the country of library where the review has been posted
reviewreview_dateDate & time (D, d M Y H:i:s)AlwaysDate and time of review posted adjusted to library's timezone, e.g., Tue, 26 Aug 2008 20:44:42
reviewreview_titleVariable characters (50)AlwaysTitle of review set by user
reviewreview_textText (unlimited)AlwaysText of review
reviewreview_ratingInteger (1)AlwaysRating of a review set by the user
reviewreview_suggestInteger (1)AlwaysShows if the user would suggest this item to a friend (1 - yes, 0 - no)
reviewreview_usefulInteger (5)AlwaysShows the sum of user useful / not useful responses (may be negative if more “not useful”) about the review
reviewreview_useful_yesInteger (5)AlwaysShows a number of users considering review to be useful
reviewreview_useful_noInteger (5)AlwaysShows a number of users considering review not to be useful
reviewreview_languageVariable characters (10)AlwaysChiliFresh internal code of languages, “eng” for English - others to follow here.
Block review ends
Block results ends
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_time>Fri, 18 Sep 2009 11:05:42</response_time>
 <response_code>130</response_code>
 <response_description>Response OK</response_description>
 <header>
  <page_size>10</page_size>
  <page_number>1</page_number>
  <page_review_count>2</page_review_count>
  <total_review_count>2</total_review_count>
 </header>
 <results>
  <review>
   <review_id>1633</review_id>
   <author_nickname>Cool User X</author_nickname>
   <user_id>64</user_id>
   <review_city>Hooksett</review_city>
   <review_state>New Hampshire</review_state>
   <review_country>US</review_country>
   <review_date>Sat, 10 May 2008 11:41:46</review_date>
   <review_title>Test</review_title>
   <review_text>Test</review_text>
   <review_rating>1</review_rating>
   <review_suggest>1</review_suggest>
   <review_useful>2</review_useful>
   <review_useful_yes>3</review_useful_yes>
   <review_useful_no>1</review_useful_no>   
   <review_language>eng</review_language>
  </review>
  <review>
   <review_id>10724</review_id>
   <author_nickname>Cool User X</author_nickname>
   <user_id>64</user_id>
   <review_city>Hooksett</review_city>
   <review_state>New Hampshire</review_state>
   <review_country>US</review_country>
   <review_date>Thu, 29 Jan 2009 08:46:58</review_date>
   <review_title>Testing</review_title>
   <review_text>This is the first part of the review</review_text>
   <review_rating>3</review_rating>
   <review_suggest>0</review_suggest>
   <review_useful>1</review_useful>
   <review_useful_yes>2</review_useful_yes>
   <review_useful_no>1</review_useful_no>   
   <review_language>eng</review_language>
  </review>
 </results>
</response>

Response code

Code Code description
130Response OK
140Session empty, expired or invalid

getSuspendedReviews: retrieving all temporarily suspended reviews for the moderator access

This function allows retrieving suspended reviews for a particular logged-in moderator

Input

Parameter Type (size) Mandatory Description
actiongetSuspendedReviews Yes
accountInteger (10)Yes
session_idVariable characters (50)Yes
page_sizeInteger (5)NoHow many reviews per page should be output, default 10
page_numberInteger (5)NoWhich output page to show, default 1
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

XML Retrieval example:

https://secure.chilifresh.com/api/reviews/?account=20&action=getSuspendedReviews&session_id=ab24d653051b5a549de17ec6975228d3&api_key=1j132ioj12oij3

JSON Retrieval example:

https://secure.chilifresh.com/api/reviews/json/?account=20&action=getSuspendedReviews&session_id=ab24d653051b5a549de17ec6975228d3&api_key=1j132ioj12oij3

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block header startsIf response code “110”
headerpage_sizeInteger (5)AlwaysNumber of reviews per page output
headerpage_numberInteger (5)AlwaysCurrent output page number
headerpage_review_countInteger (5)AlwaysNumber of reviews in current page
headertotal_review_countInteger (5)AlwaysTotal number of reviews for the item
Block header ends
Block results startsif item_count larger than 0
Block review startsif item_count larger than 0
reviewisbnVariable characters (20)AlwaysContains ISBN or other ID of an item
reviewreview_idInteger (10)AlwaysChiliFresh ID of the review
reviewauthor_nicknameVariable characters (50)AlwaysNickname of the user posting the nickname
reviewuser_idInteger (10)If registered userChiliFresh user ID if user registered, doesn't appear for anonymous reviews
reviewreview_cityVariable characters (40)AlwaysFull English name of city of library where the review has been posted
reviewreview_stateVariable characters (40)AlwaysFull English name of state of library where the review has been posted
reviewreview_countryVariable characters (2)AlwaysTwo-character code of the country of library where the review has been posted
reviewreview_dateDate & time (D, d M Y H:i:s)AlwaysDate and time of review posted adjusted to library's timezone, e.g., Tue, 26 Aug 2008 20:44:42
reviewreview_titleVariable characters (50)AlwaysTitle of review set by user
reviewreview_textText (unlimited)AlwaysText of review
reviewreview_ratingInteger (1)AlwaysRating of a review set by the user
reviewreview_suggestInteger (1)AlwaysShows if the user would suggest this item to a friend (1 - yes, 0 - no)
reviewreview_usefulInteger (5)AlwaysShows the sum of user useful / not useful responses (may be negative if more “not useful”) about the review
reviewreview_useful_yesInteger (5)AlwaysShows a number of users considering review to be useful
reviewreview_useful_noInteger (5)AlwaysShows a number of users considering review not to be useful
reviewreview_languageVariable characters (10)AlwaysChiliFresh internal code of languages, “eng” for English - others to follow here.
Block review ends
Block results ends
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_time>Fri, 18 Sep 2009 11:05:42</response_time>
 <response_code>130</response_code>
 <response_description>Response OK</response_description>
 <header>
  <page_size>10</page_size>
  <page_number>1</page_number>
  <page_review_count>2</page_review_count>
  <total_review_count>2</total_review_count>
 </header>
 <results>
  <review>
   <review_id>1633</review_id>
   <author_nickname>Cool User X</author_nickname>
   <user_id>64</user_id>
   <review_city>Hooksett</review_city>
   <review_state>New Hampshire</review_state>
   <review_country>US</review_country>
   <review_date>Sat, 10 May 2008 11:41:46</review_date>
   <review_title>Test</review_title>
   <review_text>Test</review_text>
   <review_rating>1</review_rating>
   <review_suggest>1</review_suggest>
   <review_useful>2</review_useful>
   <review_useful_yes>3</review_useful_yes>
   <review_useful_no>1</review_useful_no>   
   <review_language>eng</review_language>
  </review>
  <review>
   <review_id>10724</review_id>
   <author_nickname>Cool User X</author_nickname>
   <user_id>64</user_id>
   <review_city>Hooksett</review_city>
   <review_state>New Hampshire</review_state>
   <review_country>US</review_country>
   <review_date>Thu, 29 Jan 2009 08:46:58</review_date>
   <review_title>Testing</review_title>
   <review_text>This is the first part of the review</review_text>
   <review_rating>3</review_rating>
   <review_suggest>0</review_suggest>
   <review_useful>1</review_useful>
   <review_useful_yes>2</review_useful_yes>
   <review_useful_no>1</review_useful_no>   
   <review_language>eng</review_language>
  </review>
 </results>
</response>

Response code

Code Code description
131Response OK
141Session empty, expired or invalid

acceptUnmoderatedReview: accepting a review by a moderator

This function allows a moderator to accept a review

Input

Parameter Type (size) Mandatory Comment
actionacceptUnmoderatedReview Yes
accountInteger (10)Yes
review_idInteger (10)Yes
session_idVariable characters (50)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_time>Fri, 18 Sep 2009 11:42:45</response_time>
 <response_code>150</response_code>
 <response_description>Response OK</response_description>
</response>

Response code

Code Code description
150Response OK
160Review moderation not successful
170Review ID empty or not acceptable format
180Session empty, expired or invalid

rejectUnmoderatedReview: reject a review by a moderator

This function allows a moderator to reject a review

Input

Parameter Type (size) Mandatory Comment
actionrejectUnmoderatedReview Yes
accountInteger (10)Yes
review_idInteger (10)Yes
session_idVariable characters (50)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_time>Fri, 18 Sep 2009 11:42:45</response_time>
 <response_code>150</response_code>
 <response_description>Response OK</response_description>
</response>

Response code

Code Code description
150Response OK
160Review moderation not successful
170Review ID empty or not acceptable format
180Session empty, expired or invalid

Ratings user functions

userCreateSession: creating session for unregistered user

This function creates a session to distinguish user (and not allow adding more than 1 item for the same item) within the session for adding a rating without actually having to register and log in with a ChiliFresh user account

Input

Parameter Type (size) Mandatory
actionuserCreateSession Yes
accountInteger (10)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
responsesession_idVariable chars (100)If response_code is “802”User's session ID
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>802</response_code>
 <response_description>User logged in</response_description>
 <response_time>Wed, 26 Aug 2009 13:20:05</response_time>
 <user_id>84</user_id>
 <session_id>896de1f873893451f4d69881bb1b3362</session_id>
</response>

Response code

Code Code description
802User logged in

ratingAdd: add a rating

This function allows adding a rating to any item with ISBN/UPC or other identifier. It requires a ChiliFresh session - no matter, whether the user has logged in with ChiliFresh account or is an anonymous user

Input

Parameter Type (size) Mandatory
actionratingAdd Yes
isbnVariable characters (32) - accepts ISBN, UPC or other identifiersYes
ratingInteger (1) - accepts values between 1 and 5Yes
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callsYes
accountInteger (10)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>701</response_code>
 <response_description>Rating added</response_description>
 <response_time>Wed, 26 Aug 2009 13:20:05</response_time>
</response>

Response code

Code Code description
701Rating added
711User has already rated this item
721Rating must be between 1 and 5
60Session invalid, expired or empty

ratingUpdate: update a rating

This function allows updating a rating to any item with ISBN/UPC or other identifier. It requires an active ChiliFresh session. It allows updating rating of both registered and logged in, and anonymous users - in latter case as long as they update the rating within the same ChiliFresh session

Input

Parameter Type (size) Mandatory
actionratingUpdate Yes
isbnVariable characters (32) - accepts ISBN, UPC or other identifiersYes
ratingInteger (1) - accepts values between 1 and 5Yes
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callsYes
accountInteger (10)Yes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>701</response_code>
 <response_description>Rating updated</response_description>
 <response_time>Wed, 26 Aug 2009 13:20:05</response_time>
</response>

Response code

Code Code description
801Rating updated
811User has not rated this item
821Rating must be between 1 and 5
60Session invalid, expired or empty

ratingDelete: delete an added rating

This function allows deleting a rating of any item with ISBN/UPC or other identifier that the user has added. It requires an active ChiliFresh session. It allows deleting rating of both registered and logged in, and anonymous users - in latter case as long as the user deletes the rating within the same ChiliFresh session as he added the rating

Input

Parameter Type (size) Mandatory
actionratingDelete Yes
isbnVariable characters (32) - accepts ISBN, UPC or other identifiersYes
accountInteger (10)Yes
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callsYes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>901</response_code>
 <response_description>Rating deleted</response_description>
 <response_time>Wed, 26 Aug 2009 13:20:05</response_time>
</response>

Response code

Code Code description
901Rating deleted
911User has not rated this item
60Session invalid, expired or empty

ratedItems: list items rated by the particular user

This function list items rated by particular user - retrieving user ID from the session. For registered users with ChiliFresh account, it lists all items rated in any OPAC sessions once logged in with particular user account. For non-registered users, it lists all items rated in particular OPAC/ChiliFresh session.

Input

Parameter Type (size) Mandatory
actionratedItems Yes
accountInteger (10)Yes
user_idInteger (10)If need to retrieve reviews for particular user
session_idChiliFresh session - retrieved from userRegister, userLogin or userCreateSession callOnly if user_id is not specified
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:
Block Element Type (size)Exists Description
Block response startsAlways
responseresponse_codeInteger (3)AlwaysResponse code from the table below
responseresponse_descriptionText (255)AlwaysBrief description of response code
responserating_countInteger (10)AlwaysNumber of ratings returned
responseresponse_timeDate&time (D, d M Y H:i:s)AlwaysExample: Wed, 26 Aug 2009 10:34:32
Block results startsIf any items rated
resultsisbnVarchar (32)AlwaysISBN, UPC or other identifier of an item that has been rated
resultsratingInteger (1)AlwaysRating (1-5) of the item
Block results endsIf any items rated
Block response ends

XML output example:

<?xml version="1.0"?>
<response>
 <response_code>901</response_code>
 <response_description>Rating deleted</response_description>
 <rating_count>1</rating_count>
 <response_time>Wed, 26 Aug 2009 13:20:05</response_time>
   <results>
     <item>
       <isbn>0780661656</isbn>
       <rating>1</rating>
     </item>
   </results>
</response>

Response code

Code Code description
1001Response OK
60Session invalid, expired or empty

ratingUserCheck: checks whether user has rated this item already

Checks whether user has rated particular items.

Input

Parameter Type (size) Mandatory
actionratingUserCheck Yes
accountInteger (10)Yes
isbnVarchar (20)Yes
session_idSession IDYes
locationVariable characters (40)Yes
api_keyVariable characters (40)Yes

Output

  • Format: XML, JSON
  • Blocks and elements:

XML output example:

<?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>

Response code

Code Code description
100Response OK
120ISBN is empty
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
reviews/api.txt · Last modified: 2016/11/25 14:34 by jposeika