Search code examples
phprestcurlquickblox

QuickBlox user sign up issue REST API


I am following the procedure mentioned in http://quickblox.com/developers/Users so first I get the token by posting curl with this params:

Array
(
    [application_id] => 24719
    [auth_key] => PY8EEvrxtPg3sGs
    [timestamp] => 1435915101
    [nonce] => 1435915100
    [signature] => f45bdb40e8cfcf7235502b38586479f83925c6ad
)

to https://api.quickblox.com/session.json and getting response :

stdClass Object
(
    [session] => stdClass Object
        (
            [_id] => 55965365535c12a58c031d01
            [application_id] => 24719
            [created_at] => 2015-07-03T09:18:29Z
            [device_id] => 0
            [nonce] => 1435915100
            [token] => b913e37d88a0cab296eec6f44643e282d107dd58
            [ts] => 1435915101
            [updated_at] => 2015-07-03T09:18:29Z
            [user_id] => 0
            [id] => 1004
        )

)

However, when I try to create a new user account with below params:

Array
(
    [login] => prasun1010
    [full_name] => prasun1010
    [custom_data] => I am a boy
    [password] => ssd_p@p_23_1_
    [token] => b913e37d88a0cab296eec6f44643e282d107dd58
    [Version] => 0.1.0
    [website] => http://localhost/xxx/trunk/php/
)

to : http://api.quickblox.com/users.json

it is responsing :

stdClass Object
(
    [code] => 
    [message] => No data was provided
)

Can someone please let me know what wrong I am doing ? Or what should I do to get it done?


Solution

  • As mentioned in documentation, your sign up params should be wrapped into 'user' entity. So your new user params should look like:

       Array
        (
            [user] => Array 
            (
                [login] => prasun1010
                [full_name] => prasun1010
                [custom_data] => I am a boy
                [password] => ssd_p@p_23_1_
                [token] => b913e37d88a0cab296eec6f44643e282d107dd58
                [Version] => 0.1.0
                [website] => http://localhost/xxx/trunk/php/
            )
        )