鄉民關心你 - API

本內容已被標註為過時或未維護。如果三十日內沒有更新,將會被移除。原有內容仍可在 https://github.com/g0v-data/hackpad-backup-g0v 找到。

Version: 0.1

Background

The backend is custom pgrest and the api is compatable with https://support.mongolab.com/entries/20433053-rest-api-for-mongodb

this api is possibled changed by implemented within json-ld (https://www.youtube.com/watch?v=tRTD2W4W8G4)

Auth

git:master: unsupported

git:develop: support

GET /auth/facebook # authenticated by facebook account. (default enabled)

GET /me                   # get authenticatied user profile          

GET /logout              # logout, clear session

GET /logged             # return true if user is authenticatied otherwise return false

User

git:master: unsupported

git:develop: support

PUT /collections/users/{id}               # update a user

GET /collections/users                     # get all user

GET /collections/users/{id}               # get a user

User Preferences

GET /collection/user_prefs/{user id} #get a user preference

PUT /collection/user_prefs/{user id} #get a user preference

Bookmarked Items

POST /collections/bookmarks/                             # create a bookmarked item

GET /collections/bookmarks/                               # get all bookmarked items

GET /collections/bookmarks/{id}                          # get a bookmarked item

PUT /collections/bookmarks/{id}                          # update a bookmarked item

DELETE /collections/bookmarks/{id}                   # delete a bookmarked item (won’t delete resolved items, e.x article)

Articles (belongs to resolved items) 

POST /articles                  # create a article

GET /articles/{article id}    # get a article

WebPages  (belongs to resolved items) 

POST /webpages                 # create a webpages

GET /webpages/{item_id}    # get a webpages

Tags

POST /collections/tags                         # create a tag

GET   /collections/tags/{tag name}       # get a tag by name

GET   /collections/tags/{id}                   # get a tag by id

Issues

Issue (爭議) 

GET /collections/issues

GET /collections/issues/{id}

Positions

GET /collections/positions