Json Requests - ptal/online-broker GitHub Wiki

Current & Previous ExchangeRates State

Request URL:http://ec2-54-194-70-170.eu-west-1.compute.amazonaws.com:9000/api/currencies Request Method:GET

Request URL:http://ec2-54-194-70-170.eu-west-1.compute.amazonaws.com:9000/api/currencies/minusone Request Method:GET

Response

{"status":"OK","currencies":[{"currencyId":2,"acronym":"AFN","name":"Afghan Afghani","exchangeRate":56.164975,"dbUpdate":1},{"currencyId":2,"acronym":"AFN","name":"Afghan Afghani","exchangeRate":56.164975,"dbUpdate":2},...]}

UserInfo

Request URL:http://ec2-54-194-70-170.eu-west-1.compute.amazonaws.com:9000/api/user/ Request Method:GET

Response:

{"id":1,"name":"225215","accounts":[{"currencyAcronym":"AFN","amount":5.341407167011114,"owner":1,"currencyName":"Afghan Afghani","currencyExchangeRate":56.164975},{"currencyAcronym":"GBP","amount":659.3522523472941,"owner":1,"currencyName":"British Pound Sterling","currencyExchangeRate":0.606656},{"currencyAcronym":"USD","amount":299300.0,"owner":1,"currencyName":"United States Dollar","currencyExchangeRate":1.0}],"totalAmountInDollars":300000.0}

Transfer

Request URL:http://ec2-54-194-70-170.eu-west-1.compute.amazonaws.com:9000/api/transfer Request Method:POST Request Payload: {"userId":"225215","currencyFrom":"AFN","currencyTo":"ALL","amount":500}

Response: {"status":"OK","amount":272.58993312043174}

Currency History

Request URL:http://ec2-54-194-70-170.eu-west-1.compute.amazonaws.com:9000/api/currencies//history Request Method:GET

Response: {"history":[ {moment : 1, date: date_in_milliseconds, exchangeRate : exchangeRateAgainstDollar:Float }, {moment : 2, date: date_in_milliseconds, exchangeRate : exchangeRateAgainstDollar:Float} ]}

⚠️ **GitHub.com Fallback** ⚠️