Skip to content

Register

Fraser Redford edited this page Mar 29, 2021 · 8 revisions

Server Registration

POST: api/auth/register

This will process a request to register a new user on the server when given a username, password, display name and github. If the user has recently registered they will be required to wait until their account has been activated by a server administrator.

Request Requirements

A JSON object requiring the following:

Key Required/Optional Description
username required A username for login
password required A password for login
displayName required The name they want displayed
github optional The user's github to be linked to

Sample Request

{
    "username": "TommyShelby",
    "password": "peakyblinders",
    "displayName": "TommyShelby",
    "github": "http://github.com/tommyshelby"
}

Sample Response

{
    "type": "author",
    "id": "https://team6-project-socialdistrib.herokuapp.com/author/ee786bd4483b41a2b6a01b45b94b578b",
    "host": "https://team6-project-socialdistrib.herokuapp.com/",
    "displayName": "TommyShelby",
    "url": "https://team6-project-socialdistrib.herokuapp.com/author/ee786bd4483b41a2b6a01b45b94b578b",
    "github": "https://github.com/TommyShelby"
}

Response Codes

  • 201 Created upon creation of an authenticated user and author
  • 400 Bad Request if data is missing from the request

Clone this wiki locally