LinkedIn REST API - Accessing a list of companies the user can post to - rest

How can I get a list of company pages that the currently authenticated user has permission to post to?
I have a user that has already been authenticated and authorized in my application but for the life of me, I can't figure out how to get the company pages he can post to, so that he can share updates to his pages from within my application.
I am not interested in which companies the user worked for, just the company pages he can post to.
I can see in the docs how to post to a company page after I get its ID but my problem is getting the ID.
Can anyone point me in the right direction, please?

As is usual in these things, after hours of searching and ending up posting a question on SO, I found the answer - and in another SO question: How to fetch admin profile details of a company page using Company API - Linkedin
A list of all the companies the user is admin for can be obtained here: https://api.linkedin.com/v1/companies?is-company-admin=true
This is actually mentioned in the API docs but I didn't pay much attention to that page because I assumed it was all dealing with getting information about pages for which you already had the ID. Assumption - still the mother of all f$%& ups.

Related

Graph API get names from interactions with FB business page posts

We're interested in getting names and IDs from likes/interactions with business page posts on FB. It seems to me that we're only able to get this data for users who have already granted our app permission both through the feed and item endpoints.
Wondering if anyone can either confirm this is the case or point me in the general direction of the correct approach for this. The post I was testing was indeed public.
In case anyone wanders across this, it appears that my assumptions were correct from what my continued research shows.
The route we ended up taking was to hook into the marketing API and get lead data from CTA forms on ads. Not what we were hoping for.

Like all new posts on a particular page on Facebook

I am managing an organisation's page on Facebook and want to like all posts made by the page from my personal account.(Let us say the posts from now on and not from the time the page was created) I have no idea how to proceed as I haven't explored facebook's developers tool. Can someone help a bit?
Well, its a very broad question. I dont know what language are you using and are you aware of graph api or not. So first of all go through the basics-
Using the Graph API
Access token - all API calls must be signed with an access token
Login - very important part i nfacebook integration, yet I think its not relevant to this question
Graph API Explorer- a tool provided by facebook to test the API calls. (first register on the developers site if you have not yet)
Now coming to the solution to the question-
First of all you'll be needing the post IDs of the page. To query for all the posts-
\GET https://graph.facebook.com/<Page-ID>/posts?fields=id
Example to fetch all the public posts by "Aam Aadmi Party".
Then, for each of that post id, you have to make a POST call to /likes, this will return true on success and the post will be liked.
\POST https://graph.facebook.com/<Post-ID>/likes
Example to like a post from the "Aam Aadmi Party" page.
Hope it helps. Good luck!

Facebook api: List facebook users who work or worked for company / page

Does anyone know of a way to list facebook users that say on their profile that they work at a given company? or used to work at the company.
Not sure if its even possible as i cant find anything in the api docs about this for the page object.
you can get only those info about the user those are public in there profile.
for more info visit here
http://developers.facebook.com/docs/reference/login/

Policy query - iframe app posting to multiple (5) friends wall

After some advice.
I have a client wishing to have an app which lets them download a voucher to redeem in store but only after they post details of this offer onto 5 friends' walls.
My understanding of current Facebook policy suggests that:
1) Promotions can't require users to take any action on Facebook other than to like the page (likegate);
2) Messages posted to multiple friends at once should be unique and personally initiated - i.e. an app shouldn't bulk post to multiple users. Instead users should share things on their own wall....
Am I correct in this understanding?
If so, can anyone point me at the relevant facebook policies - can't seem to find them on the site.
Yes, those are exactly what I read on the policies page. However to be absolutely sure, you should have your corporate attorney read them and consult with you.
See
http://developers.facebook.com/policy/
and
http://www.facebook.com/promotions_guidelines.php

Facebook - public posts not appearing in Graph?

I am currently trying to get the posts for a specific user from Facebook's Graph API. I have done this numerous times before using a php script I have developed; but the problem this time seems to be on Facebook's end, not mine.
I am trying to get the posts from (replacing TOKEN with an access token):
https://graph.facebook.com/100001558773450/feed?access_token=TOKEN
The graph won't show any posts by the owner of that page but will show everyone else's posts, and as far as I can see the posts are marked as public, and there are no privacy settings set on the account that would stop it from adding the posts to the graph.
Any ideas?
Thanks,
Nick
Check that you have requested the manage_pages permission to give you full access to the page (if you need access as the "page owner").
Using the access_token you've got, according to this documentation there are three different things that you can select feed, statuses and posts.
I'd give those three a go from https://graph.facebook.com and if what you get back is what you require.
https://graph.facebook.com/100001558773450/feed?access_token=...
https://graph.facebook.com/100001558773450/statuses?access_token=...
https://graph.facebook.com/100001558773450/posts?access_token=...
You need to check the "profile" privacy settings (what to share with apps). But most importantly, this is against Facebook ToS!
You can't use a user profile to represent your business, you need to use Facebook pages instead!
More can found here:
Why should I convert my profile (timeline) to a Page?
Since profiles
(timelines) are for meant individual people, they aren't suited to
meet your business needs. Pages offer more robust features for
organizations, businesses, brands, and public figures, which you can
learn more about here.
Further, maintaining a profile (timeline) for anything other than an
individual person is a violation of Facebook's Statement of Rights and
Responsibilities. If you don’t convert your profile (timeline) to a
Page, you risk permanently losing access to the profile (timeline) and
all of your content.