I want to implement chat using Quickblox
for my website. I need to create user dynamically. I am using following code it returns me signature but for next step to create new user I need token and I am not getting it.
$session_xml_data='<?xml version="1.0" encoding="utf-8"?>
<response>
<application_id>'.$application_id.'</application_id>
<auth_key>'.$auth_key.'</auth_key>
<timestamp>'.time().'</timestamp>
<nonce>'.rand(111111,999999).'</nonce>
<signature>'.$signature.'</signature>
</response>';
$session_xml_data = simplexml_load_string($session_xml_data);
$url ='https://api.quickblox.com/session.json';
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml','QuickBlox-REST-API-Version: 0.1.0'));
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_POSTFIELDS, "$session_xml_data" );
$result = curl_exec($ch);
echo '<br /> Token Here';print_r($result);
curl_close($ch);
echo '******** '.$token=$result;