then if the registration succeeded we will get a token to use it later.
Don't panic it's all easy
This is how you do it in python using requests module.
import requests
apikey='.....................'# the web api key
def NewUser(email,password):
details={
'email':email,
'password':password,
'returnSecureToken': True
}
# send post request
r=requests.post('https://identitytoolkit.googleapis.com/v1/accounts:signUp?key={}'.format(apikey),data=details)
#check for errors in result
if 'error' in r.json().keys():
return {'status':'error','message':r.json()['error']['message']}
#if the registration succeeded
if 'idToken' in r.json().keys() :
return {'status':'success','idToken':r.json()['idToken']}
Now this is simple all you have to do is call the function like this :
NewUser('[email protected]','password')# use the email and the password
Output:
You will get something like this if everything is okay :