@param string $deviceId
@param string $openid
@param string $content

@return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
168590
public function message(string $deviceId, string $openid, string $content)
    {
        $params = [
            'device_type' => $this->app['config']['device_type'],
            'device_id' => $deviceId,
            'open_id' => $openid,
            'content' => base64_encode($content),
        ];

        return $this->httpPostJson('device/transmsg', $params);
    }
1115975
public function getKFSession($openid){
        if (!$this->access_token && !$this->checkAuth()) return false;
        $result = $this->http_get(self::API_URL_PREFIX.self::CUSTOM_SEESSION_GET .'access_token='.$this->access_token.'&openid='.$openid);
        if ($result)
        {
            $json = json_decode($result,true);
            if (!$json || !empty($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
263088
public static Function<RequestEnvelope, String> deviceId() {
        return r -> Optional.ofNullable(r).map(RequestEnvelope::getContext)
                .map(Context::getSystem)
                .map(SystemState::getDevice)
                .map(Device::getDeviceId)
                .orElseThrow(() -> new PersistenceException("Could not retrieve device ID from request envelope to generate persistence ID"));
    }
1300160
public function getDevice($deviceId)
    {
        if (!isset($this->deviceCache[$deviceId])) {
            $device = $this->persistenceStorage->load($deviceId);

            if (!$device) {
                throw new \InvalidArgumentException(
                    'There is no device with ID [' . $deviceId . '] in the loaded WURFL Data'
                );
            }

            $this->deviceCache[$deviceId] = $device;
        }

        return $this->deviceCache[$deviceId];
    }
408030
public function getUserInfo($openId)
    {
        $url    = sprintf(self::USER_INFO_URL, $this->getAccessTokenString(), $openId);
        $client = $this->getHttpClient();
        $client->setUrl($url);
        $client->setHeaderArray(['Content-Type: application/json']);

        if (!$client->exec()) {
            throw new Exception("call get user info fail");
        }

        $result = json_decode($client->getResponse(), true);
        if (isset($result['errcode'])) {
            throw new Exception("error response for get user info");
        }

        return $result;
    }
107092
public function cancelContentId($contentId)
    {
        $params = array();
        $params['action'] = 'cancleContentIdAction';
        $params['appkey'] = $this->appkey;
        $params['contentId'] = $contentId;
        $rep = $this->httpPostJSON($this->host, $params);
        return (string)$rep['result'] === 'ok';
    }
405571
public function getUsers(int $id, string $openId = null)
    {
        return self::$curl->get(self::TAG_USERS.self::$access_token, json_encode(array_filter([
                'tagid' => $id,
                'next_openid' => $openId,
            ]
        )));
    }
54530
public function getUserInfo($openid, $lang = 'zh_CN')
    {
        $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid={$openid}&lang=zh_CN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpGetForJson($url);
    }
859606
public function unbindFrom(string $openAppId)
    {
        $params = [
            'appid' => $this->app['config']['app_id'],
            'open_appid' => $openAppId,
        ];

        return $this->httpPostJson('cgi-bin/open/unbind', $params);
    }
677577
public function open(string $uri, string $content)
    {
        if (isset($this->documents[$uri])) {
            $document = $this->documents[$uri];
            $document->updateContent($content);
        } else {
            $document = $this->create($uri, $content);
            $this->documents[$uri] = $document;
        }
        return $document;
    }
764455
public function getUser(string $openID)
    {
        return self::$curl->post(self::USER_TAG.self::$access_token, json_encode([
                'openid' => $openID,
            ]
        ));
    }
1079034
public function select(array $openids, string $lang = 'zh_CN')
    {
        return $this->httpPostJson('cgi-bin/user/info/batchget', [
            'user_list' => array_map(function ($openid) use ($lang) {
                return [
                    'openid' => $openid,
                    'lang' => $lang,
                ];
            }, $openids),
        ]);
    }
519717
public function indexForSpecificContent($contentId)
    {
        $this->authorize('readList', Block::class);
        $onlyPublic = false;
        $content    = $this->contentRepository->getById($contentId);
        if ($content) {
            $input    = $this->validator->validate('listContent');
            $params   = $this->processor->process($input)->getProcessedFields();
            $blockIds = $this->finder->getBlocksIds($content->path, $params, $onlyPublic);
            $results  = $this->repository->getVisibleBlocks($blockIds, $onlyPublic);
            return $this->respondWithSuccess($results, new BlockTransformer);
        }
        return $this->respondNotFound();
    }
1112291
public function toOpenId($userId, $agentId)
    {
        $params = array(
                'userid' => $userId,
                'agentid' => $agentId,
            );

        return $this->http->jsonPost(self::API_TO_OPENID, $params);
    }
1228120
public static function get(int $deviceId, array $customHeaders = []): BunqResponseDevice
    {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [$deviceId]
            ),
            [],
            $customHeaders
        );

        return BunqResponseDevice::castFromBunqResponse(
            static::fromJson($responseRaw)
        );
    }
827609
public function startUpload($uploadId,$content)
    {
        $qry = new InvokePostMethodQuery($this->getResourcePath(),
            "StartUpload",
            array('uploadId' => $uploadId->toString()),
            $content);
        $returnValue = new ClientResult();
        $this->getContext()->addQuery($qry,$returnValue);
        return $returnValue;
    }
184159
public function getUserInfo(string $openId, string $lang = 'zh_CN')
    {
        return $this->curl->get(self::GET.$this->access_token.'&'.http_build_query([
                    'openid' => $openId,
                    'lang' => $lang,
                ]
            ));
    }