-
-
Notifications
You must be signed in to change notification settings - Fork 5
The Stanford Daily Custom REST API Documentation
He Yifei 何一非 edited this page Mar 22, 2019
·
14 revisions
Returns a list of authors (author ID, name, and profile image) in each section (e.g., "News", "Opinions").
-
URL:
/authors
-
Method:
GET
- URL Params: None
- Data Params: None
- Example: https://www.stanforddaily.com/wp-json/tsd/v1/authors
Returns an author's information including author ID, name, email, cover image, funny image, profile image, blurb, hometown, time at daily, tap order, dining hall, study spot, find you, section.
-
URL:
/authors/:id
-
Method:
GET
-
URL Params:
id=[integer]
- Data Params: None
- Example: https://www.stanforddaily.com/wp-json/tsd/v1/authors/1001827
Returns a list of locations (ID, name, aliases, description, coordinates, tag slug, number of articles).
-
URL:
/locations
-
Method:
GET
-
URL Params:
-
[none]
: Returns all places -
?q={text}
: Returns a list of locations relevant to the searched words. -
?lat={lat}&long={long}&radius={radius}
: Returns a list of locations within the input radius (in miles) of the input coordinates.
-
- Data Params: None
- Example:
Returns information related to a location.
These information include:
-
type=[none]
: Information of this location. -
type=posts
: All posts related to this location. (page=[integer]
)
-
URL:
/locations/:id/:type
-
Method:
GET
-
URL Params:
Required:
-
id=[integer]
(a location's ID)
Optional:
-
[none]
: Return information about this location. -
type=posts
: Return all posts related to this location (withpage=[integer]
).
-
-
Data Params: None
-
Example:
See https://github.com/TheStanfordDaily/tsd-push-notification/wiki/REST-API.