Esempio n. 1
0
 /**
  * 查询设备、应用、用户与百度Channel的绑定关系
  * @param type $paramArr
  */
 public static function queryBindList($paramArr)
 {
     $options = array('apiKey' => '', 'secretKey' => '', 'userId' => '', 'channelId' => '', 'deviceType' => '', 'star' => 0, 'limit' => 10);
     if (is_array($paramArr)) {
         $options = array_merge($options, $paramArr);
     }
     extract($options);
     //用户标识 必填
     if (!$userId) {
         return false;
     }
     $channel = new Channel($apiKey, $secretKey);
     //$optional 可选参数,支持的可选参数包括:
     $optional = array();
     if ($channelId) {
         $optional[Channel::CHANNEL_ID] = $channelId;
     }
     if ($deviceType) {
         $optional[Channel::DEVICE_TYPE] = $deviceType;
     }
     if ($star) {
         $optional[Channel::START] = $star;
     }
     if ($limit) {
         $optional[Channel::LIMIT] = $limit;
     }
     $ret = $channel->queryBindList($userId, $optional);
     return $ret;
 }
Esempio n. 2
0
function test_queryBindList($userId)
{
    global $apiKey;
    global $secretKey;
    $channel = new Channel($apiKey, $secretKey);
    $optional[Channel::CHANNEL_ID] = "3915728604212165383";
    $ret = $channel->queryBindList($userId, $optional);
    if (false === $ret) {
        error_output('WRONG, ' . __FUNCTION__ . ' ERROR!!!!!');
        error_output('ERROR NUMBER: ' . $channel->errno());
        error_output('ERROR MESSAGE: ' . $channel->errmsg());
        error_output('REQUEST ID: ' . $channel->getRequestId());
    } else {
        right_output('SUCC, ' . __FUNCTION__ . ' OK!!!!!');
        right_output('result: ' . print_r($ret, true));
    }
}
Esempio n. 3
0
function test_queryBindList($userId)
{
    $apiKey = "Wkabgkvm6HCc092TZLXqt4KN";
    $secretKey = "nSpq1vSFiGNaH1ZLzMTf7EkTjf7IbFZl";
    $channel = new Channel($apiKey, $secretKey);
    // $optional [ Channel::CHANNEL_ID ] = "5462118640880465741";
    $ret = $channel->queryBindList($userId);
    if (false === $ret) {
        error_output('WRONG, ' . __FUNCTION__ . ' ERROR!!!!!');
        error_output('ERROR NUMBER: ' . $channel->errno());
        error_output('ERROR MESSAGE: ' . $channel->errmsg());
        error_output('REQUEST ID: ' . $channel->getRequestId());
    } else {
        right_output('SUCC, ' . __FUNCTION__ . ' OK!!!!!');
        // right_output ( 'result: ' . print_r ( $ret, true ) ) ;
        var_dump($ret['response_params']);
    }
}