title: How to reply to particular tweet using Twitter API?
body: <p>I know this is duplicate question but, Twitter has changed its API.</p>
  
  <p>I can search for a particular keyword, and I can favorite statuses, but I am not able to reply to them. I am using Ruby.</p>
  
  <p>I just want to reply to a particular tweet. I've tried the code below but it is not working.</p>
  
  <pre><code>client.update('@nikujii work', in_reply_to_status_id : 569186681850601472)
  </code></pre>
  
  <p>This is the original code:</p>
  
  <pre><code>require 'twitter'
      #load 'twitter_config.rb'
      #Create seprate config file.
      #Encrprty ur keys using md5.
  
      client = Twitter::REST::Client.new do |config|
        config.consumer_key = "11111111111"
        config.consumer_secret = "333333333333333333"
        config.access_token = "111111111111111"
        config.access_token_secret = "22222222222222"
      end
  
      #add authentication for different users.
      print "please Enter the key word or phares you want to search?"
      keyword_value= gets.chomp;
      keyword_value.gsub!(' ','%20')
      key_words="\"#{keyword_value}\""
      print key_words;
      print "Number of followers you want to follow(Please enter number from 1 to 100)"
      count_number = gets.chomp;
      count=1;
      #validate user inputs, using reg exp.
  
      client.search(key_words, result_type: "recent").take(Integer(count_number)).collect do |tweet|
        puts "Count       Tweet URl                 Username                                    tweet"           
        puts "(#{count} #{tweet.url})    #{tweet.user.screen_name}                          #{tweet.text}";
        sleep(3);
        count=count+1;
  
        client.follow("#{tweet.user.screen_name}");
        #client.favorite.create("#{tweet.user.screen_name}")
        #client.favorites("#{tweet.url}");
        client.fav tweet;  
        client.update('@nikujii work', in_reply_to_status_id : 569186681850601472)
  
      #client.favorites("#{tweet.id}","#{tweet.user.screen_name}",https://api.twitter.com/1.1/favorites/create.json)
      end
  </code></pre>