[Firebase] How to get "emailVerified" from response?

Using API:
“kind”: “identitytoolkit#GetAccountInfoResponse”,
“users”: [
“localId”: “ZY1rJK0…”,
“email”: "[email protected]",
“emailVerified”: false,
“displayName”: “John Doe”,
“providerUserInfo”: [
“providerId”: “password”,
“displayName”: “John Doe”,
“photoUrl”: “http://localhost:8080/img1234567890/photo.png”,
“federatedId”: "[email protected]",
“email”: "[email protected]",
“rawId”: "[email protected]",
“screenName”: "[email protected]"

How to get a variable “emailVerified” to check if is true or false?

explain a bit more what you have done,? this is a Json answer, …


I have this:

So, I need to get this part:
“emailVerified”: false,
into a variable, lets say “emailVeritication”, and check if is true or false!

In this case, the variable should be:

The question is, how to get the response text, and filter the emailVerified parameter?

I did this way, but it doesn’t work, why?

you can try contain block
i checked the response content and it contains only one true or false .
you can use text contain block from text section and you can check for is response content contain true or not if it contains true then email verified or not then email not verified.

sorry for english :slight_smile:

Can you give a simple example with blocks please?

yes i can wait for a moment.

1 Like


Thank you app_techgeeknerd!

I got the idea … not bad :thinking:

But, I prefer to get the tag “emailVerified” and somehow get its value in a simple way! Question is… how to do it?!

That wont work if you get a JSON response of more then one user.

In addition there is another boolean response int he API . needConfirmation boolean

So be careful when using these shortcuts to parse JSON.

1 Like

both will work same.

for that you can use json tools extension.

send me all the different response which you can get from a user.
i will make a logic which work with any response which you will get from a user.

Do you think that, using json tools extension is simple?
I thought I could use some blocks, or maybie build a procedure to get a certain value from a tag!

Example: call procedure GetTagValue (string) (tag)
where (string) can be the Response of Web1

i cant help in this that much because i dont make app related to json so currently i dont have any idea how to use json tools but as i suggested if you only want to check email is verified or not then my solution will be also good and that is easy also to make.

I think you need to start at the basics. Here is how to parse JSON using the nested list structure they are built with.

JSON and list of lists: example1 and example2

As i see the response, now the data structure is a list of users and each user has a tag called emailVerified so if you want to get the emailVerified you need to use 2 look up in pairs key block. I will show you the blocks in a bit

Example of a response:

“kind”: “identitytoolkit#VerifyAssertionResponse”,
“federatedId”: “https://accounts.google.com/1234567890”,
“providerId”: “google.com”,
“localId”: “5xwsPCWYo…”,
“emailVerified”: true,
“email”: "[email protected]",
“oauthIdToken”: “[GOOGLE_ID_TOKEN]”,
“firstName”: “John”,
“lastName”: “Doe”,
“fullName”: “John Doe”,
“displayName”: “John Doe”,
“idToken”: “[ID_TOKEN]”,
“photoUrl”: “https://lh5.googleusercontent.com/.../photo.jpg”,
“refreshToken”: “[REFRESH_TOKEN]”,
“expiresIn”: “3600”,
“rawUserInfo”: “{“updated_time”:“2017-02-22T01:10:57+0000”,“gender”:“male”, …}”

It was good to have a function (procedure) with a “string” and a “tag” inputs, and then call that the funtion. I did this, but ins’t working:

Can someone help please? Ty

This can Help you. Try these Blocks :

The Index can be changed To get if the email is verified for other users as well

I tried this:

Runtime Error
The operation lookup in pairs cannot accept the arguments: , [users], [{ “kind”: “identitytoolkit#GetAccountInfoResponse”, “users”: [ { “localId”: “PNhYSwixwZT1xlC2gC2uiX7nf9r2”, “email”: "[email protected]", “passwordHash”: “UkxEQUNUxUQ=”, “emailVerified”: false, “passwordUpdatedAt”: 1555144506952, “providerUserInfo”: [ { “providerId”: “password”, “federatedId”: "[email protected]", “email”: "[email protected]", “rawId”: "[email protected]" } ], “validSince”: “1555144506”, “lastLoginAt”: “1555344516952”, “createdAt”: “1525344506952” } ] } ], [not found]