title: Unable to do Whatsapp Registration using yowsup-cli
body: <p>I am trying to write a sample python script that sends message to the listed whatsapp number. Upon little research, i found this python library "yowsup".</p>
  
  <p>I am trying to register using the cli command written below:</p>
  
  <pre><code>yowsup-cli registration --requestcode sms --phone 9195******** --cc 91 --mcc 404 --mnc 86 -d
  </code></pre>
  
  <p>I am getting a bad token error while trying this command.</p>
  
  <p>Searching for similar problems, here are some of the changes that i performed.</p>
  
  <pre><code>    _USERAGENT_STRING = "WhatsApp/2.17.296 Android/4.4.2 Device/SAMSUNG-GT-N7100"
   and 
  DEFAULT = "Android"
  </code></pre>
  
  <p>in </p>
  
  <pre><code>/usr/lib/python2.7/site-packages/yowsup/env/env.py file.
  </code></pre>
  
  <p>Here is the more detailed o/p/ using the debug option.</p>
  
  <pre><code>[root@localhost whatsapp]# yowsup-cli registration --requestcode sms --phone 91953********* --cc 91 --mcc 404 --mnc 86 -d
  yowsup-cli  v2.0.15
  yowsup      v2.5.2
  
  Copyright (c) 2012-2016 Tarek Galal
  http://www.openwhatsapp.org
  
  This software is provided free of charge. Copying and redistribution is
  encouraged.
  
  If you appreciate this software and you would like to support future
  development please consider donating:
  http://openwhatsapp.org/yowsup/donate
  
  
  DEBUG:yowsup.env.env:Env not set, setting it to android
  DEBUG:yowsup.env.env:Current env changed to android 
  DEBUG:yowsup.common.http.warequest:{'Accept': 'text/json', 'User-Agent': 'WhatsApp/2.17.296 Android/4.4.2 Device/SAMSUNG-GT-N7100'}
  DEBUG:yowsup.common.http.warequest:cc=91&amp;in=9538944697&amp;lc=GB&amp;lg=en&amp;sim_mcc=404&amp;sim_mnc=086&amp;mcc=404&amp;mnc=086&amp;method=sms&amp;mistyped=6&amp;network_radio_type=1&amp;simnum=1&amp;s=&amp;copiedrc=1&amp;hasinrc=1&amp;rcmatch=1&amp;pid=8476&amp;rchash=8ba74b3230363264c788908e6010cb2a7c70a70f3ef7a1e4fea9085424024bab&amp;anhash=%B0%04%C5V%F6%CA%D5%0C%C4%B5%28%90%7C%BBR%D8%F8F%D7%95&amp;extexist=1&amp;extstate=1&amp;token=WhPO3Nlv52KJcgwnOfqBBFVAvw0%3D&amp;id=%C4%0E%8B%22f%7FkX%FFIL%DD%9C%91%EE%89EXco
  DEBUG:yowsup.common.http.warequest:Opening connection to v.whatsapp.net
  DEBUG:yowsup.common.http.warequest:Sending GET request to /v2/code?cc=91&amp;in=9538******&amp;lc=GB&amp;lg=en&amp;sim_mcc=404&amp;sim_mnc=086&amp;mcc=404&amp;mnc=086&amp;method=sms&amp;mistyped=6&amp;network_radio_type=1&amp;simnum=1&amp;s=&amp;copiedrc=1&amp;hasinrc=1&amp;rcmatch=1&amp;pid=8476&amp;rchash=8ba74b3230363264c788908e6010cb2a7c70a70f3ef7a1e4fea9085424024bab&amp;anhash=%B0%04%C5V%F6%CA%D5%0C%C4%B5%28%90%7C%BBR%D8%F8F%D7%95&amp;extexist=1&amp;extstate=1&amp;token=WhPO3Nlv52KJcgwnOfqBBFVAvw0%3D&amp;id=%C4%0E%8B%22f%7FkX%FFIL%DD%9C%91%EE%89EXco
  INFO:yowsup.common.http.warequest:{"login":"919538*******","status":"fail","reason":"bad_token"}
  
  status: fail
  reason: bad_token
  login: 919538*******
  </code></pre>
  
  <p>Can someone suggest on the way forward?</p>