Beispiel #1
0
        public async Task <ApiResponse> GetReferrals(string business_id, string thread_id, string access_token)
        {
            ApiResponse response = new ApiResponse();

            try
            {
                var resultData = _referralService.GetReferrals(business_id, thread_id, new Paging {
                    Limit = 50
                }).Result.Select(r => new ReferralModel(r));
                response.ok   = true;
                response.data = resultData;
            }
            catch (Exception ex)
            {
                _logService.Create(new Log
                {
                    message  = ex.Message,
                    category = "Referral",
                    link     = $"{Request.HttpContext.Request.Scheme}://{Request.HttpContext.Request.Host}{Request.HttpContext.Request.Path}{Request.HttpContext.Request.QueryString}",
                    details  = JsonConvert.SerializeObject(ex.StackTrace),
                    name     = string.Format("Get referrals by business_id: {0}", business_id)
                });
            }
            return(response);
        }
Beispiel #2
0
 /// <summary>
 /// Gets referrals
 /// </summary>
 /// <param name="contactId">Contact Id</param>
 /// <returns></returns>
 public Response <ReferralModel> GetReferrals(long contactId)
 {
     return(referralService.GetReferrals(contactId));
 }