Skip to content

RESTful API A2

annypanny edited this page Nov 29, 2016 · 8 revisions

/author/[author_id]

  • It used to get the author info with author_id on the server.

  • If already login, then local cookie has data about info, and use cookie to get the info.

  • If it's not login, then need author to enter username and password to authenticate.

  • It returned a JSON.

  • JSON file contains:

    • "id"
    • "first_name"
    • "last_name"
    • "avatar"
    • "host"
    • "github"
    • "authors"
    • "email"
    • "displayName"
    • "url"
    • "local"

    and in each "author", it has:

    • "displayName"
    • "id"
    • "host"
    • "url"
    • "github"
    • "is_local"

Method:

GET

Example:

GET /author/a9284a45-5605-4a47-a967-ad39c35c72ec

HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
	"id": "a9284a45-5605-4a47-a967-ad39c35c72ec",
	"first_name": "Gustavo",
	"last_name": "Santiago",
	"github": "shtanaka",
	"host": "http://socialnets404.herokuapp.com/author/a9284a45-5605-4a47-a967-ad39c35c72ec",
	"avatar": "",
	"authors": [
	    {
	        "displayName": "Administrator",
	        "id": "c974a1fd-fa8c-4d99-97d6-6006e0ee0a5f",
	        "host": "http://socialnets404.herokuapp.com/",
	        "url": "http://socialnets404.herokuapp.com/author/c974a1fd-fa8c-4d99-97d6-6006e0ee0a5f",
	        "github": "jiafengwu0301",
	        "is_local": true
	    }
	],
	"email": "egustavo4@gmail.com",
	"displayName": "Gustavo Santiago",
	"url": "http://socialnets404.herokuapp.com/",
	"local": true
}
Clone this wiki locally