检索公司信息-API V2

问题描述

大家好,LinkedIn工程师,

我在检索公司信息时遇到问题。 我想更新一个wordpress插件显示公司的帖子。 似乎我不是唯一的人,而且我找不到解决该问题的好信息。

我可以使用以下方法获取令牌:

$params = array(
                'response_type' => 'code','client_id'     => $this->client_id,'state'         => $state,'redirect_uri'  => $this->redirect_url,'scope'         => 'r_liteprofile'
            );

            // if re-authorizing
            if( $this->auth_options ) {

                $authorize_string      = 'Regenerate Access Token';
                $authorization_message = '<p>' . $this->get_auth_expiration_string( $this->auth_options['expires_in'] ) . '</p>';

            // if authorizing for the first time
            } else {

                $authorize_string      = 'Authorize Me';
                $authorization_message = '<p>' . __('You must authorize first to create a shortcode.','company-updates-for-linkedin') . '</p>';

            }

            // Output all the things
            echo '<a href="https://www.linkedin.com/uas/oauth2/authorization?' . http_build_query( $params ) . '" id="authorize-linkedin" class="button-secondary">' . $authorize_string . '</a>';
            echo $authorization_message;

我尝试更改范围,但是不起作用。

如果我仅使用“ r_liteprofile”,则无法获得公司的职位,例如: https://api.linkedin.com/v2/organizations/43182309?oauth2_access_token=xxxx

初始代码如下:

private function linkedin_api_call( $path,$key,$params = array() ) {

            // build the url
            $default_params = array(
                'format'              => 'json','oauth2_access_token' => $this->auth_options['access_token']
            );
            $url = 'https://api.linkedin.com/v1/companies/' . $path . '?' . http_build_query( array_merge( $default_params,$params ) );

            echo $url;
            // get the json
            $json = $this->get_remote_json( $url,__( 'Failed to make request for access token.','company-updates-for-linkedin' ) );

请提供许可(以及获取方式)的建议,并说明如何检索公司的帖子(确定的用户当前是公司LinkedIn页面管理员)。

最好, 法比恩

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)