我试图从对话框中仅获取未读消息列表(不计数)。 QuickBlox的文档中没有这样的请求。这是我的功能,但它什么都不返回:
function getUnreadMessages($login, $password, $dialogId, $userId) {
$session = quickCreateSession($login, $password);
$token = $session->token;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.quickblox.com/chat/Message.json?chat_dialog_id=' . $dialogId . '&read_ids[nin]=' . $userId );
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'QuickBlox-REST-API-Version: 0.1.0',
'QB-Token: ' . $token
));
$response = curl_exec($curl);
if ($response) {
return @iconv("ISO-8859-9//TRANSLIT", "UTF-8", $response);
} else {
return false;
}
@curl_close($curl);
}