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 |
---|---|---|---|
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
200
Status Code application/json
Content-Type {
"access_key": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZW1haWwiOiJmb29AZXhhbXBsZS5vcmciLCJpYXQiOjE1MTYyMzkwMjJ9.mz9eibpa7Exbo4e5GY4FnAOv6DeGAugrOb2GzkQ3vRawX7wE3uSUBkfc2ZrnSmZOaS66NV61CtIwis2yG3cP_fZnG-LdRF2Gn2lli1So7V80JLA3_KjqIDUHi3_CWNlCza-RZCE412wmG-umh_ndeIPafjHwfg5Cs1h-VsbXyIyxrrzF7TC0mIRnbknDEWsEWK4njRNXg-ORmJEUDH8FH3C-FLzoxI7CESxZgyNlvzRp9OnjO1p6SScoSiFyLIrLwxVdg0znwADDEA_h78Oi7K_cNw8EYpfsjBVt3s-ce9mfQfRr2eeoxMkM3xsOI7AfXjvJMGxM5Q0DByOXmX_F-A"
}
Other possible responses
401
Unauthorized412
Precondition Failed428
Precondition Required500
Internal Server Error503
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 |
---|---|---|---|
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
201
Status Code application/json
Content-Type {
"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
Conflict412
Precondition Failed428
Precondition Required500
Internal Server Error503
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
200
Status Code application/json
Content-Type {
"id": 2,
"balance": 4480,
"maxAllowance": -5000,
"createdAt": "2020-07-06T15:04:27.000Z",
"updatedAt": "2020-07-11T11:34:37.000Z"
}
Other possible responses
401
Unauthorized500
Internal Server Error503
Service Unavailable