Sends a SMS verification code for phone number sign-in.
An API key is required in the request in order to identify the Google Cloud project.
HTTP request
POST https://identitytoolkit.googleapis.com/v1/accounts:sendVerificationCode
The URL uses gRPC Transcoding syntax.
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"phoneNumber": string,
"iosReceipt": string,
"iosSecret": string,
"recaptchaToken": string,
"tenantId": string,
"autoRetrievalInfo": {
object ( |
Fields | |
---|---|
phoneNumber |
The phone number to send the verification code to in E.164 format. |
iosReceipt |
Receipt of successful iOS app token validation. At least one of ( |
iosSecret |
Secret delivered to iOS app as a push notification. Should be passed with an |
recaptchaToken |
Recaptcha token for app verification. At least one of ( |
tenantId |
Tenant ID of the Identity Platform tenant the user is signing in to. |
autoRetrievalInfo |
Android only. Used by Google Play Services to identify the app for auto-retrieval. |
safetyNetToken |
Android only. Used to assert application identity in place of a recaptcha token. At least one of ( |
playIntegrityToken |
Android only. Used to assert application identity in place of a recaptcha token (and safetyNetToken). At least one of ( |
Response body
Response message for accounts.sendVerificationCode.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{ "sessionInfo": string } |
Fields | |
---|---|
sessionInfo |
Encrypted session information. This can be used in signInWithPhoneNumber to authenticate the phone number. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/identitytoolkit
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
AutoRetrievalInfo
The information required to auto-retrieve an SMS.
JSON representation |
---|
{ "appSignatureHash": string } |
Fields | |
---|---|
appSignatureHash |
The Android app's signature hash for Google Play Service's SMS Retriever API. |