Skip to content

Register

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

Server Registration

Endpoint

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.

Request Requirements

A JSON object requires the following:

| Key | Required/Optional | Description | | :---: | :----: | | | username | required | The server username | | password | required | The server password | | 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": "team6-project-socialdistrib.herokuapp.com",
    "displayName": "TommyShelby",
    "url": "https://team6-project-socialdistrib.herokuapp.com/author/ee786bd4483b41a2b6a01b45b94b578b",
    "github": "https://github.com/TommyShelby"
}

Response Code

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

Clone this wiki locally