title: Kentico: How to work with content rating through API?
body: <p>I have gone through the code and webparts but couldn't figure out how rating works.
  All I know is the rating control provided.</p>
  <p>I want to show rating history through an API.
  I also need to allow users to rate using API.</p>
  <p>I can get rating value of a document with the query:</p>
  <pre><code>select DocumentRatings, DocumentRatingValue from CMS_Document WHERE [DocumentNodeID] = 123
  </code></pre>
  <p>But how to see rating history?</p>
  <p>How rating is calculated internally?</p>
  <p>Which are the other tables involved?</p>