Skip to content

Instantly share code, notes, and snippets.

@venkateshshukla
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save venkateshshukla/5563f05093418a99bd3d to your computer and use it in GitHub Desktop.
Save venkateshshukla/5563f05093418a99bd3d to your computer and use it in GitHub Desktop.
API Documentation of th-editorial-server

Request to api/list

A POST request to api/list with a timestamp attribute of latest article would be replied with a JSON consisting of the following

Key Explanation
1. r_timestamp the timestamp of the recieved request
2. u_timestamp the updated timestamp, i.e, the timestamp of the latest article being sent
3. num the total number of entries being sent
4. entries a list of articles

Each article have the following keys

Key Explanation
1. author the author of the article
2. key an identifier to be used in further request to api/news
3. kind the kind of article being sent. opinion/letter/op-ed etc.
4. timestamp the timestamp of the article being sent
5. title the title of the article

Request to api/news

A POST request to api/news with a key attribute of required article (obtained from a request to api/list) would be replied with a JSON consisting of the following

Key Explanation
1. key The key of the article sent in the request
2. kind The kind of the article
3. snippet The html snippet of the article

In case of errors, an empty JSON is received. If there is a client side error, the received JSON consists of error attribute explaining the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment