Account - WHG-Students/Bankingsystem GitHub Wiki

Login

Obtain an access_token from the API, by logging in with a password and email address.

Request Method

POST

Request Endpoint

https://students.trade/api/v1/login

Request body

In the request body, provide the following JSON keys with values.

Key Type Description Required
email string The user's registered email βœ”
password string The user's registered password βœ”

Example

Request
curl -H "Content-Type: application/json" \
  -X POST \
  -d '{"email":"[email protected]","password":"my_secure_password"}' \
  https://students.trade/api/v1/login
Response
Status Code 200
Content-Type application/json
{
  "access_key": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZW1haWwiOiJmb29AZXhhbXBsZS5vcmciLCJpYXQiOjE1MTYyMzkwMjJ9.mz9eibpa7Exbo4e5GY4FnAOv6DeGAugrOb2GzkQ3vRawX7wE3uSUBkfc2ZrnSmZOaS66NV61CtIwis2yG3cP_fZnG-LdRF2Gn2lli1So7V80JLA3_KjqIDUHi3_CWNlCza-RZCE412wmG-umh_ndeIPafjHwfg5Cs1h-VsbXyIyxrrzF7TC0mIRnbknDEWsEWK4njRNXg-ORmJEUDH8FH3C-FLzoxI7CESxZgyNlvzRp9OnjO1p6SScoSiFyLIrLwxVdg0znwADDEA_h78Oi7K_cNw8EYpfsjBVt3s-ce9mfQfRr2eeoxMkM3xsOI7AfXjvJMGxM5Q0DByOXmX_F-A"
}
Other possible responses
  • 401 Unauthorized
  • 412 Precondition Failed
  • 428 Precondition Required
  • 500 Internal Server Error
  • 503 Service Unavailable

Register

Create a new banking account, and receive an access_token.

Request Method

POST

Request Endpoint

https://students.trade/api/v1/register

Request body

In the request body, provide the following JSON keys with values.

Key Type Description Required
email string The user's registered email βœ”
password string The user's registered password βœ”
first_name string The user's first name βœ”
last_name string The user's last name βœ”
age string The user's age βœ”
address string The user's address string βœ”

Example

Request
curl -H "Content-Type: application/json" \
  -X POST \
  -d '{"email":"[email protected]","password":"my_secure_password", "first_name": "John", "last_name": "Smith", "age": "Wed Jun 13 1970 20:00:00 GMT+0200 (Central European Summer Time)", "address": "Deutschland, Bayern, MΓΌnchen, Am Wintergarten 3, 80000"}' \
  https://students.trade/api/v1/register
Response
Status Code 201
Content-Type application/json
{
  "access_key": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZW1haWwiOiJmb29AZXhhbXBsZS5vcmciLCJpYXQiOjE1MTYyMzkwMjJ9.mz9eibpa7Exbo4e5GY4FnAOv6DeGAugrOb2GzkQ3vRawX7wE3uSUBkfc2ZrnSmZOaS66NV61CtIwis2yG3cP_fZnG-LdRF2Gn2lli1So7V80JLA3_KjqIDUHi3_CWNlCza-RZCE412wmG-umh_ndeIPafjHwfg5Cs1h-VsbXyIyxrrzF7TC0mIRnbknDEWsEWK4njRNXg-ORmJEUDH8FH3C-FLzoxI7CESxZgyNlvzRp9OnjO1p6SScoSiFyLIrLwxVdg0znwADDEA_h78Oi7K_cNw8EYpfsjBVt3s-ce9mfQfRr2eeoxMkM3xsOI7AfXjvJMGxM5Q0DByOXmX_F-A",
  "id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZW1haWwiOiJmb29AZXhhbXBsZS5vcmciLCJpYXQiOjE1MTYyMzkwMjJ9.mz9eibpa7Exbo4e5GY4FnAOv6DeGAugrOb2GzkQ3vRawX7wE3uSUBkfc2ZrnSmZOaS66NV61CtIwis2yG3cP_fZnG-LdRF2Gn2lli1So7V80JLA3_KjqIDUHi3_CWNlCza-RZCE412wmG-umh_ndeIPafjHwfg5Cs1h-VsbXyIyxrrzF7TC0mIRnbknDEWsEWK4njRNXg-ORmJEUDH8FH3C-FLzoxI7CESxZgyNlvzRp9OnjO1p6SScoSiFyLIrLwxVdg0znwADDEA_h78Oi7K_cNw8EYpfsjBVt3s-ce9mfQfRr2eeoxMkM3xsOI7AfXjvJMGxM5Q0DByOXmX_F-A"
}
Other possible responses
  • 409 Conflict
  • 412 Precondition Failed
  • 428 Precondition Required
  • 500 Internal Server Error
  • 503 Service Unavailable

Credit Account

Retrieve the Credit Account Information from your account.

Request Method

GET

Request Endpoint

https://students.trade/api/v1/creditAccount

Headers

Name Value
Authorization Bearer [<access_token>][Login]

Example

Request
curl -H "Content-Type: application/json" \
  -X POST \
  https://students.trade/api/v1/creditAccount
Response
Status Code 200
Content-Type application/json
{
  "id": 2,
  "balance": 4480,
  "maxAllowance": -5000,
  "createdAt": "2020-07-06T15:04:27.000Z",
  "updatedAt": "2020-07-11T11:34:37.000Z"
}
Other possible responses
  • 401 Unauthorized
  • 500 Internal Server Error
  • 503 Service Unavailable