forked from abramhindle/CMPUT404-project-socialdistribution
-
Notifications
You must be signed in to change notification settings - Fork 1
Author API
Fraser Redford edited this page Mar 30, 2021
·
21 revisions
This will retrieve the author information for a given author.
No body Required
{
"type": "author",
"id": "https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"host": "https://team6-project-socialdistrib.herokuapp.com/",
"displayName": "Jeff",
"url": "https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"github": "https://github.com/Jeff"
}
-
200 OKupon a successful retrieval of a profile -
403 FORBIDDENif an user is not authenticated -
400 BAD REQUESTif bad information is passed in the request
This will update the author object specified by the id in the request URL.
The host, ID, and URL of the author cannot be changed, however they can be sent in the request for a standard author object. A JSON object requiring the following:
| Field Name: | Value: |
|---|---|
| type (Optional) | "author" |
| id (Optional) | Should be a HATEOAS URL containing the UUID of the author at the end, will not be updated |
| host (Optional) | The hostname of the authors server |
| displayName (Required) | Should be a unique string for the users name |
| url (Optional) | Should be the URL of the user on the server |
| github (Required) | Should be the GitHub URL of the user |
{
"type": "author",
"id": "https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"host": "https://team6-project-socialdistrib.herokuapp.com/",
"displayName": "Jeff2",
"url": "https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"github": "https://github.com/Jeff2"
}
{
"type": "author",
"id": "https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"host": "https://team6-project-socialdistrib.herokuapp.com/",
"displayName": "Jeff2",
"url": "https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"github": "https://github.com/Jeff2"
}
This will return a list of all authors registered with the local server.
No body requirements
No body request required
[
{
"type": "author",
"id": "https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"host": "https://team6-project-socialdistrib.herokuapp.com/",
"displayName": "Jeff",
"url": "https://team6-project-socialdistrib.herokuapp.com/author/21d2d52bf3c34b84a45951d53b472a08",
"github": "https://github.com/Jeff/"
},
{
"type": "author",
"id": "https://team6-project-socialdistrib.herokuapp.com/author/6978b496f79d59fa9aa9648bf88dbaaf",
"host": "https://team6-project-socialdistrib.herokuapp.com/",
"displayName": "Jim",
"url": "https://team6-project-socialdistrib.herokuapp.com/author/6978b496f79d59fa9aa9648bf88dbaaf",
"github": "https:/tim.com/"
}
]
-
200 OKupon a successful update of the author profile -
403 FORBIDDENif an user is attempting to change a profile they are not allowed to -
400 BAD REQUESTif bad information is passed in the request