Planning the SomeCo whitepapers and ratings API

Before diving into the examples, let's plan the new API at a high level. The following table outlines the URLs, the HTTP methods, and the response formats for each:

URL

Method

Description

Response formats

/someco/whitepapers

GET

Returns a list of whitepapers

HTML, JSON

/someco/rating?id={id}

GET

Gets the average rating for a given whitepaper by passing in the whitepaper's nodeId

HTML, JSON

/someco/rating?id={id}&rating={rating}&user={user}

POST

Creates a new rating for the specified whitepaper by passing in a rating value and the user who posted the rating

HTML, JSON

/someco/rating?id={id}

DELETE

Deletes all ratings for a specified whitepaper

HTML

Tip

The API to ...

Get Alfresco One 5.x Developer's Guide - second edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.