Skip to content
Jens Melgaard edited this page Apr 14, 2014 · 1 revision

REST Interface Design

In an attempt to build a slim background, the server should consist of mainly 2 endpoints:

  • http(s)://domain.my/api/content
  • http(s)://domain.my/api/search

Content Service:

The content service is an attempt to make an abstraction over all content, there is still a small question/issue around how to deal with e.g. Images and other types of "attachments" as they should be able to be delivered as raw data streams with their correct MIME type.

Besides that, the way the content service differs an Article (blog post) from e.g. A comment, image or attachment is from a "contentType". So http(s)://domain.my/api/content/article will yield content of the type articles. (?: Should we maybe consider to allow /article and /articles to be treated as one, pluralization?)

Beyond that traditional filtering can take place, so examples would be:

  • http(s)://domain.my/api/content/article/1 -> Article with ID: 1
  • http(s)://domain.my/api/content/article?skip=10&take=10 -> Essentially demonstrating fetching pages of 10, here we fetch the second page as we skip 10 records.

Examples that is just considerations:

  • http(s)://domain.my/api/content/article/fester -> Essentially a search, so this "rerouted" to the search engine
  • http(s)://domain.my/api/content/article/tag:.NET,C#,WebAPI -> Again essentially a search, but this time we target a specific field in article types. (: is obviously a reserved char in urls, so we either escape it or use a different one)
Clone this wiki locally