Skip to content

Author API

timvm1108 edited this page Mar 29, 2021 · 21 revisions

Endpoints

POST: api/<str:id>/ : author_object
Will perform an update on a specific author ID supplied in the path

GET: /authors
Description: Will return a list of all authors registered with the local server
Body: No Body Required
Sample Response:

[
    {
        "type": "author",
        "id": "http://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
        "host": "team6-project-socialdistrib.herokuapp.com",
        "displayName": "Jeff",
        "url": "http://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
        "github": "https://github.com/Jeff/"
    },
    {
        "type": "author",
        "id": "http://team6-project-socialdistrib.herokuapp.com/author/6978b496f79d59fa9aa9648bf88dbaaf",
        "host": "team6-project-socialdistrib.herokuapp.com",
        "displayName": "Jim",
        "url": "http://team6-project-socialdistrib.herokuapp.com/author/6978b496f79d59fa9aa9648bf88dbaaf",
        "github": "https:/tim.com/"
    }
]

Response

{
    "displayName": "Jon Snow",
    "github": "https://github.com/jonsnow" 
}

Response Code

  • On update and if a user is authorized 200 OK is returned
  • If unauthorized 403 FORBIDDEN is returned

Clone this wiki locally