public IHttpActionResult GetDepositAddresses([FromBody] GetDepositAddressesParams depositAddressesParams) { if (log.IsDebugEnabled) { log.Debug(string.Format("Get Deposit Addresses call")); } try { //get api key from header var headers = Request.Headers; string apikey = ""; IEnumerable <string> headerParams; if (headers.TryGetValues("Auth", out headerParams)) { string[] auth = headerParams.ToList()[0].Split(','); apikey = auth[0]; } if (log.IsDebugEnabled) { log.Debug(string.Format("Get Deposit Addresses Call: ApiKey = {0}", apikey)); } if (!string.IsNullOrEmpty(apikey)) { int accountId = _apiKeyInfoAccess.GetUserIdFromApiKey(apikey); return(Ok(_depositApplicationService.GetAddressesForAccount(accountId, depositAddressesParams.Currency))); } return(BadRequest("API key not found.")); } catch (Exception exception) { if (log.IsErrorEnabled) { log.Error(string.Format("Generate Deposit Address Call Error: {0}", exception)); } return(InternalServerError()); } }