LinkedIn company feed/updates in v2 API - oauth-2.0

I would like to show a company's feed/updates/post on a website. I am the owner/admin of the LinkedIn page. Most of the related questions are old and uses V1. This similar questions also seems unanswered (LinkedIn Company Feed in API v2?). LinkedIn support are of no help and they instruct me to ask questions on Stackoverflow.
I created an App on LinkedIn and they assigned default permissions (r_emailaddress, r_liteprofile, w_member_social). But these permissions are of no use to me since I just want to show the company feeds on the website. Neither I want any user to login to LinkedIn nor I want to read the users/visitors email addresses or profile. Already went through a lot of their documentation but there is no clear mentioning of how to do this.
I read that company updates can be retrieved using the /ugcPosts API. GET https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(url-encoded organization Urn). But in order to do that I need r_organization_social permission. How to get this permission?
Also in this scenario, since I just want to retrieve company posts, I can use 2 legged oauth: https://learn.microsoft.com/en-us/linkedin/shared/authentication/client-credentials-flow?context=linkedin/context instead of 3 legged oauth. But when I try to generate access token I get error "access_denied: This application is not allowed to create application tokens"
https://www.linkedin.com/oauth/v2/accessToken?grant_type=client_credentials&client_id=xxxxx&client_secret=xxxxx&redirect_uri=http://xxxxx.local/&state=fasdfasdfs
Does anyone know how to achieve this?
Thanks!

You need to apply for the LinkedIn Marketing Partner Program. You can do so by adding this product to the app you have created.
Once you have access, you can read the company feed using the following API endpoint:
https://api.linkedin.com/v2/shares?q=owners&owners=urn:li:organization:12345&sharesPerOwner=100&count=25
Hope this helps.

Related

LinkedIn API 2 and VanityName from r_basicprofile

LinkedIn recently updated their API and now I unable to get public user profile url(by VanityName) during OAuth2 authentication phase. Looks like r_basicprofile is not available anymore.
Is there any chance to get this url and if so, could you please describe how?
According to the following LinkedIn documentation Find Profile by VanityName API
The use of this API is restricted to those developers approved by
LinkedIn and subject to applicable data restrictions in their
agreements.
But there is no any information how to apply to this API. How to apply to this API and get the appropriate permissions for r_basicprofile?
I think you need to become a partner although I'am struggling with the same thing
https://fullfabric.zendesk.com/hc/en-us/articles/115007056847-Setting-up-a-LinkedIn-application-and-Applying-to-become-a-LinkedIn-Partner

How can My App Tweet the Contents a User Submits?

Note: I am posting this because I don't even know what to Google search. I know we're all about thorough research before asking these questions. Any help would be appreciated.
Scenario: User writes a text post from my app and when they submit it, the content is added to a Parse.com class (I know how to do this) and simultaneously it is tweeted from a designated twitter account (that does not belong to the user) let's say #MyCoolAppThatTweets.
In other words, I don't want the user via my app to be permanently logged into #MyCoolAppThatTweets twitter account, but have one-time access to send a tweet from it.
Another way to phrase this question would be: How can my app log into a specific twitter account whose credentials I can "bake" into the app without compromising the security of that twitter account.
I am already aware that normally, users of an iOS app wouldn't automatically want their content being tweeted. For the project I'm making, this is not going to be a concern (it's a secret).
If you need more information or if I need to post this elsewhere, please let me know!
From your question I am not sure if you are familiar with "Twitter part" of Parse.com and Twitter REST API. If not please start by reading this https://www.parse.com/docs/ios/guide#users-twitter-users (or take a look on official Twitter way by using their plugin called Fabric: https://dev.twitter.com/)
Since you mentioned PFUser I will describe you how to achieve it by using Parse.com API.
First your user must be logged in to Twitter account.
I suppose that your user is already logged in into your app as a PFUser so best way to log him into some Twitter account is by linking Twitter account with existing PFUser - https://www.parse.com/docs/ios/guide#users-linking.
After that you can post tweets through user's Twitter account (if permission was granted). I recommend doing that using Parse.com Twitter API calls https://www.parse.com/docs/ios/guide#users-login-amp-signup. To create API requests you need official Twitter REST API which can be obtained here https://dev.twitter.com/docs/api.

Twitter API: post on behalf of whom?

I want to use Twitter API so my program can post some tweets. To use it I have to register application in dev-center and get some parameters like "Consumer key", "Consumer secret" etc. Then I can use either REST API, or some libraries like twitter4j - OK, that's simple.
But the question is: who will be the "author" of such tweets? Or, in other words, where can I find them after posting? Will they be posted by application or by some user? I can't really figure out how particular user binds to registered API-application... Or how can I specify ("log-in") user to post tweet on behalf of?
The "author" is always going to be the authenticating user. From the Twitter API documentation for statuses/update:
Updates the authenticating user's current status, also known as tweeting.
To answer your other question about authenticating with another user's username/password, it is possible but you need to get permission from Twitter. You also still need to use OAuth. Check out the Twitter API OAuth documentation.
You need to have a twitter account to register your application. So your account will be the author of your posts.

Retrieve facebook data in backend service

I'm currently working on an app (iOS 6) where the user will be signing in using their facebook account.
In regards to this I have a few questions:
a) Since the app asks the user for permission to access cetain data (like: basic profile info, friend list, access to post to wall etc), I assume that the app based on it's app id will be somehow authenticated to access this information as long as the user doesn't restrict access through their facebook account.
b) will it be possible for example via a service application to authenticate with the same app id as the mobile app, and hence be able to collect data from the facebook users who authenticated with the app?
The purpose of my question is, that I would like do some analysis on the users using the iphone app, but I don't want the app to first download the information from facebook, and then pass it on to my service for analysis.
If the above is possible, could anyone please guide me in the direction of what it is that I need to do? Perhaps links to tutorials that describes this setup, og simply tell me the right facebook terminology that I'm looking for to achive this.
Thanks in advance!
It's a bit late and you may have already picked a service. I have been using Parse.com
(tutorial site). They're very good. They have SDKs and sample code for many platforms a RESTful service for others.
They have recently been acquired by FaceBook, and already have strong links to Facebook's SDK.

Using Google + API and LinkedIn API within a desktop application (without prompting user for username-password)

I'm going to create a page which will download user's activity and save it in an .xml file because my iphone app needs to process it. The problem is that I cannot prompt the user for login-password... so I was wondering if there is a sort of permanent key that I can use to access into linkedin and gplus?
Thank you.
Google+
I can field the Google+ part of your question :)
You can access your users' public activity using the REST API's activity list method. To identify who they are you'll need to send them through an OAuth flow during which they will authorize you to know who they are on Google+.
The best way to get started doing server side OAuth flows in Google+ is to grab one of the starter projects and go through the included readme. That will give you a working project to copy code out of, or develop upon.
I'd include a code sample to show you how it works, but I don't know what would best apply to your back end :)
Linkedin
I'm far from an expert on their APIs, but it looks like the flow would be similar using OAuth.

Resources