POST User Management - AmayaHena/AreaDocumentation GitHub Wiki

Resume of POST User Management

On this page you'll find documentation about the following requests:

Login

Description: Log in to an account.

HTTP Request to login an account:

http://localhost:8080/UM/login

Body:

Type: JSON
Definition: Information about login

Body example:

{
    "magicnumber": "$RVmagicnumber",
    "name": "$RVname",
    "pwd": "$RVpwd"
}

Body details:

RVmagicnumber:
Definition: magic number
Default value: "84"
Type: integer

RVname:
Definition: username of the user to log in
Type: string

RVpwd:
Definition: password of the user to log in
Type: string

HTTP response if successful:

Code: 200
Format: JSON
Value: Login Response

Definition of Login Response

Register

Description: Register to an account.

HTTP Request to login an account:

http://localhost:8080/UM/register

Body:

Type: JSON
Definition: Information about login

Body example:

{
    "magicnumber": "$RVmagicnumber",
    "name": "$RVname",
    "pwd": "$RVpwd",
    "google_token": "$RVgoogle_token"
}

Body details:

RVmagicnumber:
Definition: magic number
Default value: "84"
Type: integer

RVname:
Definition: username of the user to register
Type: string

RVpwd:
Definition: password of the user to register
Type: string

RVgoogle_token:
Definition: token given in response of google oauth2
Optional: mandatory field if the register is made with google otherwise it mustn't be set
Type: string

WARNING ABOUT google_token: The following scopes access are required.

When the google oauth2 is processing your MUST ask for these scopes.

Otherwise, the requests will be ignored.

https://www.googleapis.com/auth/youtube.force-ssl
https://www.googleapis.com/auth/gmail.readonly

HTTP response if successful:

Code: 200
Format: JSON
Value: Register Response

Definition of Register Response How to get google_token.

Add google credentials

Description: Add google credentials to an existing account that hasn't been created with google.

HTTP Request to login an account:

http://localhost:8080/UM/AddGoogleRegister

Body:

Type: JSON
Definition: Information about login

Body example:

{
    "token": "$RVtoken",
    "google_token": "$RVgoogle_token"
}

Body details:

RVtoken:
Definition: JWT given on login or register
Type: String

RVgoogle_token:
Definition: token given in response of google oauth2
Optional: mandatory field if the register is made with google otherwise it mustn't be set
Type: string

WARNING ABOUT google_token: The following scopes access are required.

When the google oauth2 is processing your MUST ask for these scopes.

Otherwise, the requests will be ignored.

https://www.googleapis.com/auth/youtube.force-ssl
https://www.googleapis.com/auth/gmail.readonly

HTTP response if successful:

Code: 200
Format: JSON
Value: Register Response

Body example if successful:

{
  "created": True
}

How to get google_token.