QuickBlox user sign up issue REST API

瘦欲@ 提交于 2019-12-10 10:43:45

问题


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?


回答1:


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/
        )
    )


来源:https://stackoverflow.com/questions/31203223/quickblox-user-sign-up-issue-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!