Skip to content

RESTful API A1

annypanny edited this page Nov 29, 2016 · 8 revisions

/author

  • It used to get the list of all the authors on the server.

  • It returned a JSON.

  • JSON file contains:

    • "count"
    • "next"
    • "previous"
    • "results"

    and in each "results" it contains:

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

    and in each "authors" it contains:

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

Method:

GET

Example:

GET /author/

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

{
	"count": 4,
	"next": null,
	"previous": null,
	"results": [
	    {
	        "id": "c974a1fd-fa8c-4d99-97d6-6006e0ee0a5f",
	        "first_name": "",
	        "last_name": "",
	        "github": "jiafengwu0301",
	        "host": "http://socialnets404.herokuapp.com/",
	        "avatar": "",
	        "authors": [
	            {
	                "displayName": "Gustavo Santiago",
	                "id": "a9284a45-5605-4a47-a967-ad39c35c72ec",
	                "host": "http://socialnets404.herokuapp.com/author/a9284a45-5605-4a47-a967-ad39c35c72ec",
	                "url": "http://socialnets404.herokuapp.com/",
	                "github": "shtanaka",
	                "is_local": true
	            },
	            {
	                "displayName": "Jiafeng Wu",
	                "id": "eb572e7b-7856-468b-bfdf-9b6388f9165c",
	                "host": "http://socialnets404.herokuapp.com/",
	                "url": "http://socialnets404.herokuapp.com/author/eb572e7b-7856-468b-bfdf-9b6388f9165c",
	                "github": "jiafengwu0301",
	                "is_local": true
	            }
	        ],
	        "email": "[email protected]",
	        "displayName": "Administrator",
	        "url": "http://socialnets404.herokuapp.com/author/c974a1fd-fa8c-4d99-97d6-6006e0ee0a5f",
	        "local": true
	    },
	    {
	        "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": "[email protected]",
	        "displayName": "Gustavo Santiago",
	        "url": "http://socialnets404.herokuapp.com/",
	        "local": true
	    },
	    {
	        "id": "eb572e7b-7856-468b-bfdf-9b6388f9165c",
	        "first_name": "Jia",
	        "last_name": "feng",
	        "github": "jiafengwu0301",
	        "host": "http://socialnets404.herokuapp.com/",
	        "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": "[email protected]",
	        "displayName": "Jiafeng Wu",
	        "url": "http://socialnets404.herokuapp.com/author/eb572e7b-7856-468b-bfdf-9b6388f9165c",
	        "local": true
	    },
	    {
	        "id": "d2325f9c-09de-492a-83a9-409047905e40",
	        "first_name": "iam",
	        "last_name": "user123",
	        "github": "[email protected]",
	        "host": "http://socialnets404.herokuapp.com/",
	        "avatar": "",
	        "authors": [],
	        "email": "[email protected]",
	        "displayName": "iamuser",
	        "url": "http://socialnets404.herokuapp.com/author/d2325f9c-09de-492a-83a9-409047905e40",
	        "local": true
	    }
	]
}

Clone this wiki locally