POST
/
session.json
curl -X POST \
-H "Content-Type: application/json" \
-d '{  
  "application_id":"76730",
  "auth_key":"7quWEh-k6TqghXe",
  "timestamp":"1567349756",
  "nonce":"7334",
  "signature":"e6e603c251a569e70a2f27a8c71b5017e81e05d5"
}' \
https://api.quickblox.com/session.json
{
  "session": {
    "application_id": 76730,
    "created_at": "2019-09-01T14:55:56Z",
    "id": 1151827623,
    "nonce": 7334,
    "token": "c56f382b402fb482086db956064592d3cd012bba",
    "ts": 1567349756,
    "updated_at": "2019-09-01T14:55:56Z",
    "user_id": 0,
    "_id": "1151827623"
  }
}

Recipes

Learn more about QuickBlox session token in the Application vs User session token section.

Application session

To create an application session you need to pass the required parameters only.

User session

To create a user session you need to pass extra parameters together with the required parameters. Take a look at five types of user authentication and their respective extra parameters below:

  • Login and password. user[login] and user[password].
  • Email and password. user[email] and user[password].
  • Social. provider=facebook, keys[token], and keys[secret] .
  • Firebase phone number. provider=firebase_phone, firebase_phone[project_id], and firebase_phone[access_token].
  • Custom identity provider. user[login] and user[password]. Learn more about custom identity provider authentication from our guide.

Body Parameters

application_id
string
required
Application identifier.
auth_key
string
required
Authorization Key.
timestamp
string
required
Unix Timestamp. It should not differ from the time provided by NTP more than 60 minutes. We suggest you synchronize time on your devices with NTP service.
nonce
string
required
Unique Random Value. Requests with the same timestamp and same value for nonce parameter can not be sent twice.
signature
string
required
Cryptographic hash. Follow a signature generation guide to learn how to generate a signature.
user
object
provider
string
Possible values: facebook, firebase_phone
keys
object
firebase_phone
object

Responses

curl -X POST \
-H "Content-Type: application/json" \
-d '{  
  "application_id":"76730",
  "auth_key":"7quWEh-k6TqghXe",
  "timestamp":"1567349756",
  "nonce":"7334",
  "signature":"e6e603c251a569e70a2f27a8c71b5017e81e05d5"
}' \
https://api.quickblox.com/session.json
{
  "session": {
    "application_id": 76730,
    "created_at": "2019-09-01T14:55:56Z",
    "id": 1151827623,
    "nonce": 7334,
    "token": "c56f382b402fb482086db956064592d3cd012bba",
    "ts": 1567349756,
    "updated_at": "2019-09-01T14:55:56Z",
    "user_id": 0,
    "_id": "1151827623"
  }
}