Read company feed through linkedIn API - sharepoint

I am trying to read my LinkedIn company feed through LinkedIn API.
I have created app in LinkedIn and got
clientID,
client secret code and
Access Token.
I tried different URL but getting same error:
https://api.linkedin.com/v2/organizations/{organizationID}
https://api.linkedin.com/v2/company/companyID
I am getting error message
Not enough permission to access: get /organization/organizationID
I am admin of my company.
I have following permission for my apps:
r_emailaddress
r_liteprofile
w_member_social
I am trying to show my linkedIn company page feed on my SharePoint page. I have to implement this solution in SharePoint 2013 and SharePoint O365.
I request anyone if could help or let me know if I am doing some thing wrong or how to proceed with next step.

This has been answered here:
How can I change a LinkedIn app's permissions?
Short answer: You must apply to the Marketing Partner Program.
LinkedIn has made a lot of changed to their API over the past few months. Check out the latest permission changes relevant to this post:
https://learn.microsoft.com/en-us/linkedin/shared/references/migrations/marketing-permissions-migration
EDIT: Confirmed. I didn't receive a notification that I was approved through the process above, however, it's 30 days later after applying and I just noticed there was a new product available under "Products" once you are logged in and on your App in the developer portal. You have to add the "Marketing Developer Platform" product from there, and once again fill out an application:
After completing the new application, they say they will provide you with confirmation within 90 days.

Related

Normal members of the group without any admin rights cannot see the facebook post done through an in-development facebook app. How can i make them?

I have followed a tutorial through which i have managed to post on a facebook group using their sdk and graph API on python, on the graph api version 11.
I created a user on facebook, gave it the admin rights of that particular group.
Created an app on facebook, in development mode.
Requested permissions through that app for posting to the relevant group as that user.
Generated extended access token for the same.
Issue: Admins of the group can see the posts, but the normal members of the group cannot.
is it an issue with the app? Does it need to be out of development for the posts created by it to be made visible to others?
Python Code snippet:
import json
from facebook import GraphAPI
access_token= 'access token here'
graph = GraphAPI(access_token)
message = 'This is a test post...hear me'
link = '' #link needs to go here
groups = ['group id here'] #group id
for group in groups:
graph.put_object(group,'feed', message=message,link=link)
print(graph.get_connections(group, 'feed'))
This is mentioned in facebook's documentation.
Whenever an app is created on facebook's developer console, in developer mode, any posts made by the app are not seen by the general public even if you are posting on public groups. Depending on the permissions and what you are trying to accomplish exactly, you might need to go through app review and through business review.
If you don't need to go through the reviews for the permission you have chosen, make sure that the app is in "Live" mode and you will be good to go.
handy feature if they were a bit upfront about it.

How to get friend's feed using Instagram Graph API or Instagram Basic Display API?

After one day instagram will disable Legacy API. There will be two official ways to access Instagram data - Instagram Graph API with graph.facebook.com base and the Instagram Basic Display API with api.instagram.com and graph.instagram.com url bases.
How to get friend's profile feed with new ways ?
Seems like old way was GET https://api.instagram.com/v1/users/{user-id}/media/recent
I tried GET https://graph.instagram.com/{user-id}/media?fields=id,caption&access_token={access_koken} endpoint but I got following error:
{"error":{"message":"Unsupported get request. Object with ID
'{user-id}' does not exist, cannot be loaded due to missing
permissions, or does not support this
operation","type":"IGApiException","code":100,"error_subcode":33,"fbtrace_id":"AfL9LNy4QaaNREWCjgNBEFW"}}
I presume you did replace {user-id} with an actual user id ? Generally speaking you can use the word "me" in it's place.
https://graph.instagram.com/me/media?fields=id,caption&access_token=<your access token>
If your application was an old Instagram "client" app then I think that it will no longer work after the deadline. We have had to create a new Instagram app via a Facebook application (https://developers.facebook.com/apps/).
From there you can add "Products" and "Instagram" is one of those products. You have to go through an app review having requested "instagram_user_profile" and "instagram_user_media" in order to start using the app in live mode, but you can add testers whilst you are developing it. This is found via the "Basic Display" link (under the Instagram product) where you will also find you app id and secret.

google api to get particular users google page review

I want to fetch the particular user's google page review and rating when he login to my app, I read the documentation of Google Bussiness API
https://developers.google.com/my-business/content/prereqs and https://developers.google.com/my-business/content/review-data
I have submitted my project for whitelisted, my main concern is that can i get the particular user's google page review and rating when he login to my app and how can I do this
first of all you need to white list your google my business api for whatever project you are working on in your project as its private api. Google my business api will work on the locations associated with your account so make sure you verified the LOCATIONS from any account you know. Follow steps mentioned in below documentation URL to set it up: https://developers.google.com/my-business/content/prereqs After the setup and etc you will automatically understand the account id and location id.
i am providing the api that will help you to get the fetch the review
1.get account details: https://mybusiness.googleapis.com/v4/accounts?access_token={access_token}
2.you will get the accoutID from step 1 ,and then get location Id https://mybusiness.googleapis.com/v4/accounts/{accountID}/locations?access_token={access_token}
3.you will get the accoutID,location_id from step 1 and step2 then finally you will get the review https://mybusiness.googleapis.com/v4/accounts/{accountID}/locations/{location_id}/reviews?access_token={access_token}

Does Instagram Graph API has sandbox mode?

The docs say (step 4):
In the App Review for Instagram section, click Add to Submission for each permission your App will need from its Users. instagram_basic is required. instagram_manage_comments, instagram_manage_insights, and instagram_content_publish are optional.
Scroll to the bottom of the page, and in the Current Submission sub-section, for each submission, click its View Notes link.
In the View Notes dialogue for each permission submission, provide a description for how you will use the data returned by any endpoints that require the permission, and a screencast showing how your app will use the data.
Once you've completed your notes for all of your permission submissions, click the Submit For Review button at the bottom of the page. Note that this is separate from your App Review, which you will do after testing.
After you've added both Facebook Login and Instagram API products to your app configuration, add Facebook Login to your app and record a screencast showing how you will use data returned by the Instagram API. This is similar to the Facebook Login screencast but with Instagram data, so the same guidelines apply.
Step 5:
Once you've been notified that your Instagram API product submission has been approved, you can use the Graph API Explorer to test your app.
With Facebook Login I can create an app that works in sandbox mode. Which lets me create a screencast. To be able to use Instagram Graph API (on a site) I need (from what I can gather):
Facebook Page linked to Instagram Business Account
an app icon
a privacy policy page
a site with working Facebook Login
description of how each permission is going to be used
screencast of... what exactly? of a site that is basically ready, but instead of fetching data from Instagram, it has them hardcoded in the code?
Or there is a sandbox mode after all?
UPD I've highlighted the important parts in the quotes above. Then:
5. Test Your App
Once you've been notified that your Instagram API product submission has been approved, you can use the Graph API Explorer to test your app.
Go to the Graph API Explorer...
The first call you will make is to the Graph API's /user/accounts edge...
Locate the Page that you connected to the Instagram Business Account and click its ID...
Next, [make /page?fields=instagram_business_account request].
This is where I get empty response in Graph API Explorer (only id field is returned), or:
200:- OAuthException:(#200) Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform. https://developers.facebook.com/status/issues/205942813488872/
GET /...?fields=instagram_business_account HTTP/1.1
on my site. Which requests to Instagram Graph API can I make before passing reviews (Instagram App Review, and Facebook App Review)?
It looks like the documentation that Facebook provides is somewhat misleading. You can actually use Instagram Graph API via Graph API Explorer (or by sending GET requests from your code) in a very limited way accessing only your instagram business account BEFORE you get initial approval described in Step 4.
Steps:
Open Graph API Explorer.
First, you need to add extra permissions in the "Access Token" section. There is a "Add a Permission" drop down on the bottom of that section. Open that drop down and select: instagram_basic, manage_pages, business_management permissions. Depending on what you are trying to do, you may need other permissions as well (e.g. instagram_manage_comments, ads_management, manage_pages).
Once you selected the extra permissions, click on the "Get Access Token" button.
Now, you have access token with correct permissions and you should be able to execute instagram_business_account request. This will return the instagram id of your business account, which you can then use for other requests.
After going through these steps, I'm able to get media for my business account via Instagram Graph API, although I'm still trying to figure out why tags request returns empty list.
Go to your app dashboard from your developer account:
https://developers.facebook.com/apps/APP_ID/dashboad
Go to: Roles -> Test Users.
Edit one of the test users to change its password to what you want in order to know him.
Once done, logout from your personal account and connect with the "test user" account in https://facebook.com
Go to your app and click the facebook login with the scope "instagram_basic".
With the access_token that you get you are able to ask Graph API about the user's instagram business account.
Et voilà.
PS: You will not be able to use the Open Graph API tool from your test user. My advice is to test your app from Incognito mode so it will not interpose with your personal account.
UPDATE
Currently, access the instagram data from this way is disabled but this is the right way to access the data.
FB error message says:
(#200) Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform. https://developers.facebook.com/status/issues/205942813488872/
You can get full functionality of Graph API if you login with the developer account, use that to create a video screencast of app functionality and submit
You will have to create a test application out of your real application, these applications are in sand box mode by default (developer mode) https://developers.facebook.com/docs/apps/test-apps/ You will be able to access any fb permission / feature with it, and develop a product with it. Once you are ready to review, in your submission of your real application link your test app in the process

Error from Instagram: The access_token provided does not match an approved application

This was working fine for many months and now it's just a blank space. I get the following error: Error from Instagram: The access_token provided does not match an approved application. How can I get a new access_token for an existing client??
You need to check you application hasn't been put into sandbox by Instagram. They made big changes to their API on the 1st of June and if you had it submitted your app for review it will be put in sandbox mode and only sandbox users will be able to use it.
Even if you are not in sandbox mode you may need to get your users to reaurhorize your app due to new scopes being used to control access to everything other than basic user information.
Check Instagram Developer Docs for more information on the changes
You need to check your Access token's Scope and asking for login permission
where some new Scope had been added ex:public_content Added. Also don't forget to check for requirements Scope for API you are using and if it's need and Authentications "Valid access Token". where also had some changes.
basic - to read a user’s profile info and media
public_content to read any public profile info and media on a user’s behalf
follower_list to read the list of followers and followed-by users
comments - to post and delete comments on a user’s behalf
relationships - to follow and unfollow accounts on a user’s behalf
likes - to like and unlike media on a user’s behalf
And take look about **Sandbox API behavior of your application not life yet :**
API Behavior
The behavior of the API when you are in sandbox mode is the same as when your app is live, but comes with the following restrictions:
Data is restricted to sandbox users and the 20 most recent media from each sandbox user
Reduced API rate limits
The first point is important and it means that the API behaves as if the only users on Instagram were your sandbox users, and the only media ever posted were the last 20 for each of these users.
For example, if you query the /users/{user-id}/ endpoint and the {user-id} is a sandbox user, then you will get the normal API response; but if the {user-id} is not a sandbox user, you will get a APINotFound error.
As another example, let's consider an endpoint that returns a list of media: /tags/{tag-name}/media/recent. The response returned by this endpoint will contain only media with the given tag, as expected. But instead of returning media from any public Instagram user, it will return only media that belongs to your sandbox users, restricted to the last 20 for each user.
Good luck
The following video clearly explains what steps to follow to get this working with the new auth
https://www.youtube.com/watch?v=0k4RhTS94Hw
Kind Regards
Sandeep Sahoo

Resources