Skip to main content
POST
/
login.json
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{  
  "login":"Andrew",
  "password":"mypassword"
}' \
https://api.quickblox.com/login.json
{
  "user": {
    "id": 96705448,
    "full_name": "Andrew Lee",
    "email": "andrew@gmail.com",
    "login": "Andrew",
    "phone": "+9923474236",
    "website": "https://myapp.com",
    "created_at": "2019-08-26T20:53:42Z",
    "updated_at": "2019-08-26T21:38:38Z",
    "last_request_at": "2019-08-26T21:38:44Z",
    "external_user_id": null,
    "facebook_id": "89987878",
    "blob_id": null,
    "custom_data": null,
    "age_over16": true,
    "allow_statistics_analysis": false,
    "allow_sales_activities": false,
    "parents_contacts": "",
    "user_tags": "admin,co-workers,design"
  }
}

Recipes

1

1. Set the login

Set your login here.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{  
  "login":"Andrew",
}' \
https://api.quickblox.com/login.json
2

2. Set the password

Set your password here.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{  
  "login":"Andrew",
  "password":"mypassword"
}' \
https://api.quickblox.com/login.json
3

3. As a result, the API returns a logged in user.

{
  "user": {
    "id": 96705448,
    "full_name": "Andrew Lee",
    "email": "andrew@gmail.com",
    "login": "Andrew",
    "phone": "+9923474236",
    "website": "https://myapp.com",
    "created_at": "2019-08-26T20:53:42Z",
    "updated_at": "2019-08-26T21:38:38Z",
    "last_request_at": "2019-08-26T21:38:44Z",
    "external_user_id": null,
    "facebook_id": "89987878",
    "blob_id": null,
    "custom_data": null,
    "age_over16": true,
    "allow_statistics_analysis": false,
    "allow_sales_activities": false,
    "parents_contacts": "",
    "user_tags": "admin,co-workers,design"
  }
}
1

1. Set a social network provider

Set a firebase_phone as a social network provider.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 4b8d6b42d030ac4fc4251f9d0070ca5faa012bba" \
-d '{  
  "provider":"firebase_phone",
}' \
https://api.quickblox.com/login.json
2

2. Use a `firebase_phone` parameter to set Firebase data

curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 4b8d6b42d030ac4fc4251f9d0070ca5faa012bba" \
-d '{  
  "provider":"firebase_phone",
  "firebase_phone":{  
  }
}' \
https://api.quickblox.com/login.json
3

3. Set Firebase project ID

Use a project_id parameter to set Firebase project ID.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 4b8d6b42d030ac4fc4251f9d0070ca5faa012bba" \
-d '{  
  "provider":"firebase_phone",
  "firebase_phone":{
    "project_id":"my_app_project_id",  
  }
}' \
https://api.quickblox.com/login.json
4

4. Set Firebase access token

Use an access_token parameter to set Firebase access token.An access token is a token received from the social network after a user authenticates with it.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 4b8d6b42d030ac4fc4251f9d0070ca5faa012bba" \
-d '{  
  "provider":"firebase_phone",
  "firebase_phone":{
    "project_id":"my_app_project_id",
    "access_token":"t35400dfzxcxvsdfn"  
  }
}' \
https://api.quickblox.com/login.json
5

5. As a result, the API returns the logged in user.

{
  "user": {
    "id": 96705448,
    "full_name": "Andrew Lee",
    "email": "andrew@gmail.com",
    "login": "Andrew",
    "phone": "+9923474236",
    "website": "https://myapp.com",
    "created_at": "2019-08-26T20:53:42Z",
    "updated_at": "2019-08-26T21:38:38Z",
    "last_request_at": "2019-08-26T21:38:44Z",
    "external_user_id": null,
    "facebook_id": "89987878",
    "blob_id": null,
    "custom_data": null,
    "age_over16": true,
    "allow_statistics_analysis": false,
    "allow_sales_activities": false,
    "parents_contacts": "",
    "user_tags": "admin,co-workers,design"
  }
}
1

1. Set a social network provider

Use a provider param to set a social network provider.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 4b8d6b42d030ac4fc4251f9d0070ca5faa012bba" \
-d '{  
  "provider":"facebook",
}' \
https://api.quickblox.com/login.json
2

2. Use a `keys` parameter to set an access token

curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 4b8d6b42d030ac4fc4251f9d0070ca5faa012bba" \
-d '{  
  "provider":"facebook",
  "keys":{  
  }
}' \
https://api.quickblox.com/login.json
3

3. Set an access token

An access token is a token received from the social network after a user authenticates with it.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 4b8d6b42d030ac4fc4251f9d0070ca5faa012bba" \
-d '{  
  "provider":"facebook",
  "keys":{  
    "token":"AM46dxjhisdffgry26282352fdusdfusdfgsd"
  }
}' \
https://api.quickblox.com/login.json
4

4. As a result, the API returns a logged in user.

{
  "user": {
    "id": 96705448,
    "full_name": "Andrew Lee",
    "email": "andrew@gmail.com",
    "login": "Andrew",
    "phone": "+9923474236",
    "website": "https://myapp.com",
    "created_at": "2019-08-26T20:53:42Z",
    "updated_at": "2019-08-26T21:38:38Z",
    "last_request_at": "2019-08-26T21:38:44Z",
    "external_user_id": null,
    "facebook_id": "89987878",
    "blob_id": null,
    "custom_data": null,
    "age_over16": true,
    "allow_statistics_analysis": false,
    "allow_sales_activities": false,
    "parents_contacts": "",
    "user_tags": "admin,co-workers,design"
  }
}
After an application session has been created, lets your users to log in to their account with login/email and password. There are the following login options available:
  • Log in with login/email and password.
  • Log in via Facebook.
  • Log in via Firebase phone number (SMS).

Body Parameters

login
string
User login.
email
string
User email.
password
string
User password.
provider
string
Possible providers: facebook, firebase_phone.
keys
object
firebase_phone
object

Headers

QB-Token
string
required
A user or application session token. See Authentication page to learn more about session tokens.

Responses

A successful response
user
object
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{  
  "login":"Andrew",
  "password":"mypassword"
}' \
https://api.quickblox.com/login.json
{
  "user": {
    "id": 96705448,
    "full_name": "Andrew Lee",
    "email": "andrew@gmail.com",
    "login": "Andrew",
    "phone": "+9923474236",
    "website": "https://myapp.com",
    "created_at": "2019-08-26T20:53:42Z",
    "updated_at": "2019-08-26T21:38:38Z",
    "last_request_at": "2019-08-26T21:38:44Z",
    "external_user_id": null,
    "facebook_id": "89987878",
    "blob_id": null,
    "custom_data": null,
    "age_over16": true,
    "allow_statistics_analysis": false,
    "allow_sales_activities": false,
    "parents_contacts": "",
    "user_tags": "admin,co-workers,design"
  }
}
I