Skip to content
mattiaslevin edited this page Mar 13, 2013 · 33 revisions

This section contains an overview of the the available REST end-points.

If you platform already have a SDK we recommend you use that instead of integrating directly towards the rest interface.

Introduction

The Pocket-Reivews API is a RESTful API. It tries to adhere REST guidelines as is practically possible.

Formats

The API returns data as json by default (in the future other formats might be supported).

json    someserver.com/api/movie/like/1209           

JSONP

TBD. Not yet implemented.

Versions

The API has multiple versions that are used to prevent changes to the API from breaking your apps. Development of new features will always be on the most current version of the API, while development on previous versions of the API will be limited to severe bug fixes only.

To specify which version of the API you wish to access, you must indicate that version after the /api and before the domain.

v1   someserver.com/api/movie/like/1209    
v2   someserver.com/api/v2/movie/like/1209        
v3   someserver.com/api/v3/movie/like/1209    

Methods

Methods are used to tell Pocket-Reviews what you want to do with a specific object. You can create, delete and update most objects via the REST API.

POST     Allows you to create or update a new object
POST     Update an existing object
DELETE   Delete an existing object
GET      Get an existing object

Authentication

Currently not authentication is enabled, but will in the future.

End-points

The following end-points are available.

For a detailed description of the requests and returned json please check the detailed REST documentation TBD

Ratings and reviews

Set a rating and optional review comment for a product.

api/{version}/{domain}/rating               POST       Rate a product, redirect to rating
api/{version}/{domain}/product/rating       POST       Rate a product, redirect to product                                                        
api/{version}/{domain}/rating/{id}          DELETE     Delete a rating  
api/{version}/{domain}/rating/{id}          GET        Get rating details  
api/{version}/{domain}/rating?username=     GET        Get ratings for a user
api/{version}/{domain}/rating?productId=    GET        Get all ratings for product
api/{version}/{domain}/rating/histogram?productId=    GET     Get a histogram of all ratings for a product

Likes

Add a like to a product.

api/{version}/{domain}/like                 POST       Like a product, redirect to like
api/{version}/{domain}/product/like         POST       Like a product, redirect to product            
api/{version}/{domain}/like/{id}            DELETE     Delete a like   
api/{version}/{domain}/like/{id}            GET        Get like details   
api/{version}/{domain}/like?username=       GET        Get my likes                                
api/{version}/{domain}/like?productId=      GET        Get all likes for product 

When liking a product and username is provided, a semi-random list of users that liked the product is generated and persisted.

Thumbs up/down

Add a thumbs up or down to a product.

api/{version}/{domain}/thumbs/up            POST       Thumbs up for a product, redirect to the thumbs
api/{version}/{domain}/product/thumbs/up    POST       Thumbs up for a product, redirect to the product
api/{version}/{domain}/thumbs/down          POST       Thumbs down for a product, redirect to thumbs 
api/{version}/{domain}/product/thumbs/down  POST       Thumbs up for a product, redirect to the product           
api/{version}/{domain}/thumbs/{id}          DELETE     Delete a thumbs   
api/{version}/{domain}/thumbs/{id}          GET        Get thumbs details   
api/{version}/{domain}/thumbs?username=     GET        Get my thumbs                                
api/{version}/{domain}/thumbs?productId=    GET        Get all thumbs for product 

Comments

Comment a product.

api/{version}/{domain}/comment              POST       Comment a product, redirect to comment
api/{version}/{domain}/product/comment      POST       Comment a product, redirect to product                                              
api/{version}/{domain}/comment/{id}         GET        Get comment details  
api/{version}/{domain}/comment/{id}         DELETE     Delete a comment     
api/{version}/{domain}/comment?username=    GET        Get my comments  
api/{version}/{domain}/comment?productId=   GET        Get all comments for product

Favorites

Add a products to my favorites.

api/{version}/{domain}/favorites/{username}?productId=   POST     Add as favorite               
api/{version}/{domain}/favorites/{username}              GET      Get all favorites                     
api/{version}/{domain}/favorites/{username}?productId=   DELETE   Delete a product from favorites

Product

Get products with related information, e.g. average rating, number of likes, comments etc.

api/{version}/{domain}/product                  GET       Get all products                           
api/{version}/{domain}/product/{product}        GET       Get one product     
api/{version}/{domain}/product?ids=             GET       Get several products                        
api/{version}/{domain}/product/nearby           GET       Get products nearby
api/{version}/{domain}/product/rated/most       GET       Get most rated products   
api/{version}/{domain}/product/rated/top        GET       Get top rated products
api/{version}/{domain}/product/rated?username=  GET       Get all products I have rated   
api/{version}/{domain}/product/liked/most       GET       Get most liked products     
api/{version}/{domain}/product/liked?username=  GET       Get all products I have liked 
api/{version}/{domain}/product/thumbs/up/most   GET       Get most thumbs up products    
api/{version}/{domain}/product/thumbs/down/most GET       Get most thumbs up products      
api/{version}/{domain}/product/thumbs?username= GET       Get all products I have thumbed up or down 
api/{version}/{domain}/product/commented/most   GET       Get most commented products      
api/{version}/{domain}/product/commented?username= GET   Get all products I have commented 
api/{version}/{domain}/product/favorites?username= GET   Get all favorites products     

A semi-random list of users the liked the product is provided. You can also specify if you like to know if the current user already liked the returned product or not (using and optional query parameter).

Backoffice

TDB. Currently not enabled.

Clone this wiki locally