Skip to content
thenbsp edited this page Mar 23, 2016 · 1 revision

获取用户信息

对于已关注公众号的用户,可以通过用户 openid 调用该接口获取用户信息:

use Thenbsp\Wechat\User\User;

$user = new User($accessToken);

try {
    $response = $user->get('oWY-5jjLjo7pYUK86JPpwvcnF2Js');
} catch (\Exception $e) {
    exit($e->getMessage());
}

var_dump($response->toArray());

批量获取用户信息

$response = $user->getBetch(array('oWY-5jjLjo7pYUK86JPpwvcnF2Js'));

var_dump($response->toArray());

获取用户列表

$response = $user->lists();

var_dump($response->toArray());