Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails &引用;拒绝访问过帐股份”的链接;使用linkedin api发布公共消息时出错_Ruby On Rails_Ruby_Linkedin - Fatal编程技术网

Ruby on rails &引用;拒绝访问过帐股份”的链接;使用linkedin api发布公共消息时出错

Ruby on rails &引用;拒绝访问过帐股份”的链接;使用linkedin api发布公共消息时出错,ruby-on-rails,ruby,linkedin,Ruby On Rails,Ruby,Linkedin,我正在尝试使用发送消息到API端点:http://api.linkedin.com/v1/people/~/shares,但每次我遇到这个错误:LinkedIn::Errors::AccessDeniedError((403):对发布共享的访问被拒绝)。怎么了 代码: 我需要指定范围参数吗?如果是,我如何在代码中实现这一点 谢谢覆盖默认的使用者选项,并将作用域附加到请求\u令牌\u路径 consumer_options = { :request_token_path => "/u

我正在尝试使用发送消息到API端点:
http://api.linkedin.com/v1/people/~/shares
,但每次我遇到这个错误:
LinkedIn::Errors::AccessDeniedError((403):对发布共享的访问被拒绝)
。怎么了

代码:

我需要指定范围参数吗?如果是,我如何在代码中实现这一点


谢谢

覆盖默认的使用者选项,并将作用域附加到
请求\u令牌\u路径

 consumer_options = {
    :request_token_path => "/uas/oauth/requestToken?scope=r_basicprofile+w_share",
    :access_token_path  => "/uas/oauth/accessToken",
    :authorize_path     => "/uas/oauth/authorize",
    :api_host           => "https://api.linkedin.com",
    :auth_host          => "https://www.linkedin.com"
  }
 LinkedIn::Client.new(ckey, csecret, consumer_options)

你能发布你用来连接的代码吗?如果LinkedIn正在返回正确的状态代码,这听起来像是你用来访问API的帐户没有权限做你想做的事情。杜德你发布了你的应用程序的秘密。范围值应该包含更多权限:如所说:例如:范围=r_fullprofile%20r_电子邮件地址%20w_共享
 consumer_options = {
    :request_token_path => "/uas/oauth/requestToken?scope=r_basicprofile+w_share",
    :access_token_path  => "/uas/oauth/accessToken",
    :authorize_path     => "/uas/oauth/authorize",
    :api_host           => "https://api.linkedin.com",
    :auth_host          => "https://www.linkedin.com"
  }
 LinkedIn::Client.new(ckey, csecret, consumer_options)