Why do I get the PHONE_NUMBER_UNOCCUPIED error when calling auth.signIn in telegram?
<p>I've gotten to the point of sending the <code>auth.sendCode</code> method, with the following response:</p>

<pre><code>('sentCode: ', {u'req_msg_id': 6324698204597889024L, u'result': {u'type': {u'len
gth': 5}, u'phone_registered': False, u'flags': 6, u'timeout': 120, u'next_type'
: {}, u'phone_code_hash': '52eb4ab096ea211b52'}})
</code></pre>

<p>This is using the telegram test servers. I have successfully used the same phone number in the telegram iPhone app and desktop application so I know the phone number is valid in production. (should it be valid on the test servers as well?)</p>

<p>When I follow <code>auth.sendCode</code> with <code>auth.signIn</code> I receive the following error response:</p>

<pre><code>('authorization: ', {u'error_message': 'PHONE_NUMBER_UNOCCUPIED', u'error_code':
 400})
</code></pre>

<p>Is there a step between these two methods that registers the phone number?</p>

<p>from <a href="https://core.telegram.org/api/auth" rel="nofollow">https://core.telegram.org/api/auth</a></p>

<blockquote>
  <p>The auth.sendCode method will also return the phone_registered field,
  which indicates whether or not the user with this phone number is
  registered in the system. If phone_registered == boolTrue,
  authorization requires that auth.signIn be invoked. Otherwise, basic
  information must be requested from the user and the new user
  registration method (auth.signUp) must be invoked.</p>
  
  <p>When phone_registered === boolFalse, the auth.signIn method can be
  used to pre-validate the code entered from the text message. The code
  was entered correctly if the method returns Error 400
  PHONE_NUMBER_UNOCCUPIED.</p>
</blockquote>

python api telegram