Ejemplo n.º 1
0
        //Postback for Precision Samples
        public IHttpActionResult PostbackPrecisionSample([FromUri] string ug,
                                                         string sub_id,
                                                         decimal gross, decimal reward,
                                                         string status, DateTime date, int surveyid)
        {
            //http://devmapi.cashbackresearch.com/api/surveys/postback/2?ug=F1CA2526-4995-47A1-89BE-474A223505D9&sub_id=eeeeeeeeeeee&reward=1.2&status=S&date=1-1-2017&title=&surveyid=12345&gross=2.4

            try
            {
                var p = new PostbackManager();
                p.PostbackPrecisionSample(ug, sub_id, reward, status, date, surveyid, gross);

                return(Ok());
            }
            catch (Exception e)
            {
                var msg = e;
                return(InternalServerError());
            }
        }
Ejemplo n.º 2
0
        //Redirect for Precision Samples
        public IHttpActionResult RedirectPrecisionSample([FromUri] string ug,
                                                         string sub_id,
                                                         decimal gross, decimal reward,
                                                         string status, DateTime date, int surveyid)
        {
            try
            {
                //test url
                //http://devmapi.cashbackresearch.com/api/surveys/postback/2?ug=F1CA2526-4995-47A1-89BE-474A223505D9
                var m = new RouterManager();

                var p = new PostbackManager();
                p.PostbackPrecisionSample(ug, sub_id, reward, status, date, surveyid, gross);

                var uniqueId = m.GetRouterUserFromPrecisionSampleId(ug);
                var url      = $"{ConfigurationManager.AppSettings["BaseWebUrl"]}mysurveys?ug={uniqueId}";
                return(Redirect(url));
            }
            catch (Exception e)
            {
                var msg = e;
                return(InternalServerError());
            }
        }