Пример #1
0
        public Keyword AttachCampaign(int accountId, string channel, string keyword, int campaignId)
        {
            IRestRequest  request  = TDClient.BuildRequest(Method.POST, KEYWORD_CAMPAIGN, new { accountId, channel, keyword }, campaignId);
            IRestResponse response = TDClient.InnerExecute(request);

            return(TDClient.ProcessOperationResponse <Keyword>(request, response, "attach campaign"));
        }
Пример #2
0
        public Keyword Create(int accountId, string channel, string keyword)
        {
            var rval = TDClient.Add(LIST, new { accountId, channel }, new Keyword
            {
                Name = keyword
            });

            return(rval);
        }
Пример #3
0
        public List <Contact> Search(int accountId, string needle)
        {
            var request  = TDClient.BuildRequest(RestSharp.Method.POST, SEARCH, new { accountId }, needle);
            var response = TDClient.InnerExecute(request);

            if (response == null)
            {
                return(null);
            }

            if (response.StatusCode == HttpStatusCode.NoContent)
            {
                return(new List <Contact>());
            }

            return(response.Deserialize <List <Contact> >());
        }