This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
connections:api [2016/05/23 14:52] jposeika [myLibraryContent: display HTML content for My Library widget] |
connections:api [2016/05/25 06:34] (current) jposeika [New features requiring documentation] |
||
---|---|---|---|
Line 3252: | Line 3252: | ||
- | ====== New features requiring documentation ====== | ||
===== Profile editing functions ===== | ===== Profile editing functions ===== | ||
==== profileEditInformation: edit basic profile information ==== | ==== profileEditInformation: edit basic profile information ==== | ||
- | **Input:** | + | |**Parameter** |**Type (size)** |**Mandatory** |**Description **| |
- | * session_id | + | |action|profileEditInformation |Yes| API call| |
- | * birth_date [YYYY-MM-DD] | + | |birth_date|Date (YYYY-MM-DD |No| Birth date| |
- | * show_age [Y/N] | + | |show_age|Y (yes) / N (no) |No| Whether to show age on profile| |
- | * library_card [if required] | + | |library_card|Varchar (50) |No| Library card| |
- | * gender [optional] | + | |gender|M (male) / F (female) |No| Gender of the user| |
- | * location_city | + | |location_city|Varchar (20) |No| City| |
- | * location_state [accepted states - statebycode function] | + | |location_state|2-letter state code for US or 2-letter country code + "_" 2/3-letter state code for others, e.g. AU_SA South Australia, |
- | * location_country [accepted countries] | + | |
- | * quote | + | |
- | Output - success or error | + | Australia |No| State| |
+ | |location_country|2-letter code of the country |No| Country| | ||
+ | |quote|Text (1000) |No| Personal quote| | ||
+ | |session_id|Variable characters (100)|Yes| Session ID from logged in user| | ||
+ | |||
+ | **XML output example:** | ||
+ | <code> | ||
+ | <?xml version="1.0"?> | ||
+ | <response> | ||
+ | <response_code>3090</response_code> | ||
+ | <response_description>Profile changes saved successfully</response_description> | ||
+ | <response_time>Tue, 24 May 2016 15:34:39</response_time> | ||
+ | </response> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === Response code === | ||
+ | |**Code** |**Code description** | | ||
+ | |3090|Profile changes saved successfully| | ||
+ | |3091|Invalid date format, must be YYYY-MM-DD| | ||
+ | |3092|Invalid gender - should be F or M| | ||
+ | |3093|Invalid state code| | ||
+ | |3094|Invalid country code| | ||
+ | |3092|Invalid gender - should be F or M| | ||
+ | |60|Session invalid, expired or empty| | ||
==== profileDeletePicture: delete particular user's picture ==== | ==== profileDeletePicture: delete particular user's picture ==== | ||
- | **Input:** | + | === Input === |
- | * session_id | + | * URL for XML output: https://secure.chilifresh.com/api/connections/ |
+ | * URL for JSON output: https://secure.chilifresh.com/api/connections/json/ | ||
+ | * Method: POST | ||
+ | * To be used when retrieving information for any item | ||
+ | * Parameters: | ||
- | Output: success or error | ||
+ | |**Parameter** |**Type (size)** |**Mandatory** |**Description **| | ||
+ | |action|profileDeletePicture |Yes| API call| | ||
+ | |session_id|Variable characters (100)|Yes| Session ID from logged in user| | ||
+ | |||
+ | |||
+ | **XML output example:** | ||
+ | <code> | ||
+ | <?xml version="1.0"?> | ||
+ | <response> | ||
+ | <response_code>3095</response_code> | ||
+ | <response_description>Profile picture deleted successfully</response_description> | ||
+ | <response_time>Tue, 24 May 2016 15:39:40</response_time> | ||
+ | </response> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === Response code === | ||
+ | |**Code** |**Code description** | | ||
+ | |3095|Profile picture deleted successfully| | ||
+ | |60|Session invalid, expired or empty| | ||
==== profileChangePicture: change particular user's picture ==== | ==== profileChangePicture: change particular user's picture ==== | ||
**Input:** | **Input:** | ||
Line 3293: | Line 3337: | ||
==== profileChangeRead: set or change user's "Current read" item ==== | ==== profileChangeRead: set or change user's "Current read" item ==== | ||
- | **Input:** | + | === Input === |
- | * session_id | + | * URL for XML output: https://secure.chilifresh.com/api/connections/ |
- | * item_id [ISBN or UPC] OR | + | * URL for JSON output: https://secure.chilifresh.com/api/connections/json/ |
- | * cf_item_id | + | * Method: POST |
+ | * To be used when retrieving information for any item | ||
+ | * Parameters: | ||
- | Output: success [item_title, item_author, item_id, cf_item_id] or fail message | + | |
+ | |**Parameter** |**Type (size)** |**Mandatory** |**Description **| | ||
+ | |action|profileChangeRead |Yes| API call| | ||
+ | |isbn|ISBN, UPC or other identifier of item |No| Identifier of the item| | ||
+ | |cf_item_id|ChiliFresh ID of the item |No| ChiliFresh identifier of the item| | ||
+ | |session_id|Variable characters (100)|Yes| Session ID from logged in user| | ||
+ | |||
+ | |||
+ | **XML output example:** | ||
+ | <code> | ||
+ | <?xml version="1.0"?> | ||
+ | <response> | ||
+ | <response_code>3096</response_code> | ||
+ | <response_description>Read changed successfully</response_description> | ||
+ | <response_time>Tue, 24 May 2016 16:09:16</response_time> | ||
+ | <item_id>1148103</item_id> | ||
+ | <isbn>9782070529292</isbn> | ||
+ | <title>Harry Potter a l'ecole des sorciers ; Harry Potter et la chambre des secrets ; Harry Potter et le prisonnier d'Azkaban -- coffret 3 volumes</title> | ||
+ | <author></author> | ||
+ | </response> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === Response code === | ||
+ | |**Code** |**Code description** | | ||
+ | |3096|Read changed successfully| | ||
+ | |60|Session invalid, expired or empty| | ||
==== profileDeleteRead: delete user's "Current read" item ==== | ==== profileDeleteRead: delete user's "Current read" item ==== | ||
- | **Input:** | + | === Input === |
- | * session_id | + | * URL for XML output: https://secure.chilifresh.com/api/connections/ |
+ | * URL for JSON output: https://secure.chilifresh.com/api/connections/json/ | ||
+ | * Method: POST | ||
+ | * To be used when retrieving information for any item | ||
+ | * Parameters: | ||
- | Output: success or fail message | ||
+ | |**Parameter** |**Type (size)** |**Mandatory** |**Description **| | ||
+ | |action|profileDeleteRead |Yes| API call| | ||
+ | |session_id|Variable characters (100)|Yes| Session ID from logged in user| | ||
+ | |||
+ | |||
+ | **XML output example:** | ||
+ | <code> | ||
+ | <?xml version="1.0"?> | ||
+ | <response> | ||
+ | <response_code>3097</response_code> | ||
+ | <response_description>Current read deleted successfully</response_description> | ||
+ | <response_time>Tue, 24 May 2016 16:11:50</response_time> | ||
+ | </response> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === Response code === | ||
+ | |**Code** |**Code description** | | ||
+ | |3097|Current read deleted successfully| | ||
+ | |60|Session invalid, expired or empty| | ||
==== profileDeleteAccount: delete user's ChiliFresh account ==== | ==== profileDeleteAccount: delete user's ChiliFresh account ==== | ||
**Input:** | **Input:** | ||
Line 3365: | Line 3460: | ||
==== statisticsShow: show statistics of Connections and comparison to friends of particular user ==== | ==== statisticsShow: show statistics of Connections and comparison to friends of particular user ==== | ||
- | **Input:** | + | === Input === |
- | * sessionID or userID | + | * URL for XML output: https://secure.chilifresh.com/api/connections/ |
+ | * URL for JSON output: https://secure.chilifresh.com/api/connections/json/ | ||
+ | * Method: POST | ||
+ | * To be used when retrieving information for any item | ||
+ | * Parameters: | ||
- | Output: my_stats block [friends, books_read, reviews_written, recommendations, comments] friends_average_stats block [friends, books_read, reviews_written, recommendations, comments] | + | |
+ | |**Parameter** |**Type (size)** |**Mandatory** |**Description **| | ||
+ | |action|statisticsShow |Yes| API call| | ||
+ | |session_id|Variable characters (100)|Yes| Session ID from logged in user| | ||
+ | |||
+ | |||
+ | **XML output example:** | ||
+ | <code> | ||
+ | <?xml version="1.0"?> | ||
+ | <response> | ||
+ | <response_code>3081</response_code> | ||
+ | <response_description>Statistics listed successfully</response_description> | ||
+ | <response_time>Mon, 23 May 2016 14:54:28</response_time> | ||
+ | <my_stats> | ||
+ | <friends>1</friends> | ||
+ | <books_read>14</books_read> | ||
+ | <reviews_written>4</reviews_written> | ||
+ | <comments>0</comments> | ||
+ | <recommendations>0</recommendations> | ||
+ | </my_stats> | ||
+ | <friends_average_stats> | ||
+ | <friends>0.00</friends> | ||
+ | <books_read>0.00</books_read> | ||
+ | <reviews_written>0.00</reviews_written> | ||
+ | <comments>0.00</comments> | ||
+ | <recommendations>0.00</recommendations> | ||
+ | </friends_average_stats> | ||
+ | </response> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === Response code === | ||
+ | |**Code** |**Code description** | | ||
+ | |3081|Statistics listed successfully| | ||
+ | |60|Session invalid, expired or empty| | ||
===== Cork board functions ===== | ===== Cork board functions ===== | ||
==== boardShowComments: show comments of user's Cork board ==== | ==== boardShowComments: show comments of user's Cork board ==== | ||
- | **Input:** | + | === Input === |
- | * session_id or user_id | + | * URL for XML output: https://secure.chilifresh.com/api/connections/ |
- | * page_size | + | * URL for JSON output: https://secure.chilifresh.com/api/connections/json/ |
+ | * Method: POST | ||
+ | * To be used when retrieving information for any item | ||
+ | * Parameters: | ||
- | Output: comment_count, page_count, page_number, comments block, comment block, user block [user_id, nickname, last_login, city, state, country, quote, user_image_small, user_image_medium, user_image_large], comment_date, comment_text | ||
+ | |**Parameter** |**Type (size)** |**Mandatory** |**Description **| | ||
+ | |action|boardShowComments |Yes| API call| | ||
+ | |user_id|Integer (10) |No| Show comments from other user's profile| | ||
+ | |session_id|Variable characters (100)|Yes| Session ID from logged in user| | ||
+ | |||
+ | |||
+ | **XML output example:** | ||
+ | <code> | ||
+ | <?xml version="1.0"?> | ||
+ | <response> | ||
+ | <response_code>3082</response_code> | ||
+ | <response_description>Comments listed successfully</response_description> | ||
+ | <response_time>Mon, 23 May 2016 15:10:10</response_time> | ||
+ | <page_size>10</page_size> | ||
+ | <item_count>11</item_count> | ||
+ | <page_count>2</page_count> | ||
+ | <comments> | ||
+ | <comment> | ||
+ | <user> | ||
+ | <user_id>227629</user_id> | ||
+ | <nickname>pls-nn-12</nickname> | ||
+ | <last_login>0000-00-00 00:00:00</last_login> | ||
+ | <city>Liverpool</city> | ||
+ | <state>NY</state> | ||
+ | <country>US</country> | ||
+ | <quote></quote> | ||
+ | <user_image_small>https://secure.chilifresh.com/userpic/small/blank.png</user_image_small> | ||
+ | <user_image_medium>https://secure.chilifresh.com/userpic/midthumbs/blank.png</user_image_medium> | ||
+ | <user_image_large>https://secure.chilifresh.com/userpic/large/blank.png</user_image_large> | ||
+ | </user> | ||
+ | <comment_text>Testing comment re-load</comment_text> | ||
+ | <comment_date>2013-01-13 15:36:07</comment_date> | ||
+ | </comment> | ||
+ | <comment> | ||
+ | <user> | ||
+ | <user_id>227629</user_id> | ||
+ | <nickname>pls-nn-12</nickname> | ||
+ | <last_login>0000-00-00 00:00:00</last_login> | ||
+ | <city>Liverpool</city> | ||
+ | <state>NY</state> | ||
+ | <country>US</country> | ||
+ | <quote></quote> | ||
+ | <user_image_small>https://secure.chilifresh.com/userpic/small/blank.png</user_image_small> | ||
+ | <user_image_medium>https://secure.chilifresh.com/userpic/midthumbs/blank.png</user_image_medium> | ||
+ | <user_image_large>https://secure.chilifresh.com/userpic/large/blank.png</user_image_large> | ||
+ | </user> | ||
+ | <comment_text>Adding comment
 | ||
+ | </comment_text> | ||
+ | <comment_date>2013-01-13 15:35:04</comment_date> | ||
+ | </comment> | ||
+ | </comments> | ||
+ | </response> | ||
+ | |||
+ | </code> | ||
+ | |||
+ | |||
+ | === Response code === | ||
+ | |**Code** |**Code description** | | ||
+ | |3082|Comments listed successfully| | ||
+ | |60|Session invalid, expired or empty| | ||
==== boardAddComment: add a comment to other user's Cork board ==== | ==== boardAddComment: add a comment to other user's Cork board ==== | ||
- | **Input:** | + | === Input === |
- | * session_id | + | * URL for XML output: https://secure.chilifresh.com/api/connections/ |
- | * user_id | + | * URL for JSON output: https://secure.chilifresh.com/api/connections/json/ |
- | * comment_text | + | * Method: POST |
+ | * To be used when retrieving information for any item | ||
+ | * Parameters: | ||
- | Output: success or failure message | + | |
+ | |**Parameter** |**Type (size)** |**Mandatory** |**Description **| | ||
+ | |action|boardAddComment |Yes| API call| | ||
+ | |user_id|Integer (10) |Yes| Add comments in user's profile| | ||
+ | |comment|Text (1000) |Yes| Comment text| | ||
+ | |session_id|Variable characters (100)|Yes| Session ID from logged in user| | ||
+ | |||
+ | |||
+ | **XML output example:** | ||
+ | <code> | ||
+ | <?xml version="1.0"?> | ||
+ | <response> | ||
+ | <response_code>3083</response_code> | ||
+ | <response_description>Comment added successfully</response_description> | ||
+ | <response_time>Mon, 23 May 2016 15:16:12</response_time> | ||
+ | </response> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === Response code === | ||
+ | |**Code** |**Code description** | | ||
+ | |3083|Comment added successfully| | ||
+ | |3084|Comment empty| | ||
+ | |3085|Parameter user_id empty| | ||
+ | |60|Session invalid, expired or empty| | ||
====== Connections widgets ====== | ====== Connections widgets ====== | ||
Documentation available [[connections:api:widgets|here]]. | Documentation available [[connections:api:widgets|here]]. | ||