Skip to content

Getting 403, access to network denied error #35

@sumanranjanpanda

Description

@sumanranjanpanda

Hi,

I am getting 403, access to network denied error everytime when I try to share or fetch network updates.

I have followed the README, and used linkedin gem to call linkedin APIs.

When I used below configuration

provider  :linkedin,
            LINKEDIN_SETTINGS[:linkedin_api_key],
            LINKEDIN_SETTINGS[:linkedin_api_secret],
            :scope => 'r_fullprofile r_emailaddress r_network', :fields => ["id", "email-address", "first-name", "last-name", "headline", "industry", "picture-url", "public-profile-url", "location", "connections"]

I got the below error.

OAuth::Problem - Scope NOT_AUTHORIZED : r_fullprofile, Scope NOT_AUTHORIZED : r_network:

Then I have tried with the scope 'r_basicprofile r_emailaddress w_share'

provider  :linkedin,
            LINKEDIN_SETTINGS[:linkedin_api_key],
            LINKEDIN_SETTINGS[:linkedin_api_secret],
            :scope => 'r_basicprofile r_emailaddress w_share', :fields => ["id", "email-address", "first-name", "last-name", "headline", "industry", "picture-url", "public-profile-url", "location", "connections"],

It worked, but When I am trying to share or to get network updates. I am gettng 403 Access to network denied error. Even I have tried with https using ngrok.

client.add_share(share)
client.network_updates
  def get_posts(credentials, options = {})
    client = prepare_client(credentials["token"], credentials["secret"])
    posts = client.network_updates(options)
    return posts
  end

  private
  def prepare_client(oauth_token, oauth_token_secret)
    client ||= LinkedIn::Client.new(api_key, api_secret)
    client.authorize_from_access(oauth_token, oauth_token_secret)
    return client
  end

share =    {
      "comment": comment,
      "content": {
        "title": title,
        "description": description # ,
        # "submitted-url": "https://developer.linkedin.com",  
        # "submitted-image-url": "https://example.com/logo.png"
      },
      "visibility": {
        "code": "anyone"
      }  
    }
  client.add_share(share)

I have also tried to use the example as in your document. And that too didn't work for me.

You can now make API calls as per normal e.g.:

client.profile
client.add_share({:comment => "blah"})

In my linkedin app, I have checked all the application permissions
https://www.linkedin.com/developer/apps
Default Application Permissions:

  • r_basicprofile
  • r_emailaddress
  • rw_company_admin
  • w_share

Could you please help me on this issue?

Thanks,
Suman

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions