Rest api phone number authentication error

HTTP/1.1 400 Bad Request
Vary: X-Origin
Vary: Referer
Content-Type: application/json; charset=UTF-8
Date: Thu, 13 Sep 2018 16:35:33 GMT
Server: ESF
Cache-Control: private
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Alt-Svc: quic=":443"; ma=2592000; v="44,43,39,35"
Accept-Ranges: none
Vary: Origin,Accept-Encoding
Connection: close

{
  "error": {
    "code": 400,
    "message": "MISSING_SESSION_INFO",
    "errors": [
      {
        "message": "MISSING_SESSION_INFO",
        "domain": "global",
        "reason": "invalid"
      }
    ]

Hi
Please tell us what’s wrong and what you need help with.
A screenshot of the relevant blocks and the error message on the app will go miles in helping us :slightly_smiling_face:

1 Like
POST /identitytoolkit/v3/relyingparty/verifyPhoneNumber?key={WEB_API_KEY}
Content-Type: application/json; charset=utf-8
Host: www.googleapis.com
Connection: close
User-Agent: Paw/3.1.7 (Macintosh; OS X/10.13.6) GCDHTTPRequest
Content-Length: 73

{"phoneNumber":"+18035551111","applicationVerifier":{"type":"recaptcha"}}

i used a web components with rest api

https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPhoneNumber?key={WEB_API_KEY}

Perhaps @Diego has a better understanding of this. Can you take a look, please?

this should be the post content :

{ "sessionInfo": "6-seBr9nJHXxPoA-NjqGfDyoIKMGmiJec7wUfT7vSZ0DOGSy", "code": "123456" }

use this while verifying the number.

the post request you are sending is used for sending the code to users mobile.

this should be the post content :

{ "sessionInfo": "6-seBr9nJHXxPoA-NjqGfDyoIKMGmiJec7wUfT7vSZ0DOGSy", "code": "123456" }

use this while verifying the number.
The sessionInfo value is available the after the SMS is sent. It is the same value as verificationId

the post request you were using is for sending the code to users mobile.