I am not able to get media details of instagram users through instagram API - api

Instagram is not giving Access to details other than basic.
I was using this API-
https://api.instagram.com/v1/users/{user-id}/media/recent/?access_token=ACCESS-TOKEN&count={number}
But not able to fetch details of users since 20th Mar 2018.
Error Getting:-
error_type: "OAuthException",
code: 400,
error_message: "Invalid scope field(s): public_content,basic"
Earlier it was working fine and I was getting details smoothly
You can review permissions here- https://www.instagram.com/developer/authorization/
Here I am getting(applications no longer accepted)
Please guide anyone or give alternate?

Someone said that "Instagram reset the tokens for all users as a security precaution" from here, so you have to generate a new access token.
If you create token by yourself, explicit or implicit way, that token is always "basic" one, and I don't know why(I've tried so many times...)
If you seek websites that help you generate access token, mostly they generate "basic" permission as well.

Related

how to fetch events data from LinkedIn APIs?

I am trying to fetch events data through LinkedIn API, but its throwing this error even I passed access token in my header. One more thing I am using postman to create API calls.
I am using this url to call API:-
https://api.linkedin.com/v2/events
{
"serviceErrorCode": 0,
"message": "Resource events does not exist",
"status": 404
}
I am rather new to working with these complex APIs, please help me
I read some more about it and it's written there that one need some special permissions to use event data ."r_events_leadgen_automation" permission is required. But how to get this permission, there is nothing on the docs about this.
You need to create an app and then request access to the Marketing Developer Platform under the Permissions tab. However, getting this access is not easy. You need to fill out and submit a detailed form asking questions about your business and what you intend to do with the access. And you may need to ask for more access after all. I have never gone that far.
You can find more information here.

msGraph API from msAccess VBA - Planner plans credentials issue

I am very new to MS Graph and Office 365 and have made good progress. I am an O365 Global Admin for my organisation (a school) and have app development experience. There is a lot of scope for using MS-Access databases in our context for "globally" managing the O365 content. eg contacts, distribution lists and planner tasks. We want to manage these from an on-premises ms-access database or two and with an admin person authenticating the ms-graph activity, ideally.
So, to test, I created a new db and have managed to get it to consume the following endpoint using VBA but with no user authentication for now.
https://graph.microsoft.com/v1.0/groups
However, when I try
https://graph.microsoft.com/v1.0/planner/plans/with my plan id here
I get 401 - Unauthorized: Access is denied due to invalid credentials.
So, clearly my Application registration is wrong or my authentication or both! I have spent hours searching for examples and help and because of the evolving nature of the ecosystem I am finding it pretty hard to work out what I should do now (as opposed to a year or two ago).
The authorisation that generates the access_token that works to allow me access to the groups is:
POST
https://login.microsoftonline.com/{my tenant id here}/oauth2/token
grant_type=client_credentials
client_id={my client id}
client_secret={my url encoded secret} resource=https://graph.microsoft.com
but using that same access_token for the planner tasks throws the 401 error.
My app permissions look like this:
I presume this is because of the difference between the Application and Delegated types but have not fully grasped it all yet. And, I suspect I am using the wrong authentication flow anyway. :-(
So, my questions are:
1. Do my permissions look right?
2. Is my authentication flow correct? Should I be using these instead? ie have I been working from old information?
https://login.microsoftonline.com/{my tenant id here}/oauth2/v2.0/authorize
https://login.microsoftonline.com/{my tenant id here}/oauth2/v2.0/token
As you can tell I have become somewhat confused. If anyone can point me in the right overall direction given what I am attempting that would be so helpful.
Thanks so much,
Murray
1. Do my permissions look right?
Yeah undoubtedly, your azure portal permission seems alright. You need dedicated permission for that also need to grant admin consent which you have done perfectly shown on screen shot.
2. Is my authentication flow correct?
As you are using Client Credentials Grant Flow request format seems alright. But I doubt this flow is suitable for the API you are trying to call. because this API requires dedicated permission.
3. Should I be using these instead?
Since this API need dedicated permission you could use authorization code grant flow.
Follow below steps to get your token using Authorization Code grant flow
Get Authorization Code:
https://login.microsoftonline.com/YourTenant.onmicrosoft.com/oauth2/v2.0/authorize?client_id={ClientId}&response_type=code&redirect_uri={redirectURI}&response_mode=query&scope=https://graph.microsoft.com/.default
Request Token oauth2/V2.0/token with your code:
Request URL: https://login.microsoftonline.com/common/oauth2/V2.0/token Or https://login.microsoftonline.com/YourTenant.onmicrosoft.com/oauth2/V2.0/token
Method: POST
Request Body Format
client_id:Your_Clinet_Id
scope:https://graph.microsoft.com/.default
redirect_uri:Your_Portal_Redirect_URI
grant_type:authorization_code
client_secret:Your_Client_Secret
code: Paste Code Here
Decode Token:
You could decode your token on https://jwt.io/ and make sure you have required permission on your azure portal.
4. Have I been working from old information?
No, Information has no issue so far I have gone through.
Note: For for details implementation of Authorization Code grant flow you could take a look official docs

How to get r_basicprofile access for linke in APIs

Am trying to call
https://api.linkedin.com/v2/people/q=firstName&firstName={name} but getting the following error
{
"serviceErrorCode": 100,
"message": "Not enough permissions to access: GET /people/q=firstName&firstName=ahmed",
"status": 403
}
How to enable my account to get access on r_basicprofile access
According to the migration docs, access to the basic profile fields is being restricted to developers that are members of the partner program. So you'll have to apply to a partner program to access those fields. However, LinkedIn has no clear documentation on which partner program developers should use for the simple use case of maintaining access to r_basicprofile. I've talked with a couple of their customer service reps and they eventually directed me to ask about it here but it seems no one has a clear answer for this...

LinkedIn API - get information about my ALL Connections

I have used Facebook API but I am new to Linkedin api.
I need some help on how to get information (name, birthday, etc) about my ALL Connections, and I need help with both the token and the info-related API calls.
As for the token -- in Facebook there is the Facebook Console to generate tokens at runtime and test our API calls... Does LinkedIn have something similar?
Update: I'm able to get list of connections using:
http://api.linkedin.com/v1/people/~/connections?modified=new
... but how can I also get birthdates (if shared publicly)? I've attempted:
http://api.linkedin.com/v1/people/~/connections:(headline,first-name,last-name,date-of-birth)
...however, that shows me the first and last name but NOT the date of birth.
You can use the rest console here: http://developer.linkedin.com/rest-console
There is a template method you can use called "Get My Connections".
I hope this helps.
Update: LinkedIn has restricted their open API access, and this no longer works.
https://apigee.com/console/linkedin
Select OAuth2, click connect, then allow LinkedIn to privede apigee to your LI profile. Then in the left collumn, select Get My Connections. apigee prepares most of params, except format (xml/json), which you can add yourself.
Looks like now no such API available(Looks like depricated by Linkedin). Please let me know if i am wrong and suggest other ways to achieve user's connections.
I am getting this in response
{
"errorCode": 0,
"message": "Access to connections denied",
"requestId": "6Sxxxxxxx",
"status": 403,
"timestamp": 14xxxxxxxxx
}
Please see : https://developer.linkedin.com/support/developer-program-transition
I think what you are looking for, is the Linkedin Connections API. You can look at the documentation provided here -> http://developer.linkedin.com/documents/connections-api
There are also various other APIs for accessing profile, groups, companies, and jobs.
It returns an XML document so, you should be able to generate tokens and test your API calls without any problem.
These APIs are no longer available
2019 still works but with a different approach.
Do this:
You may follow the steps from here:
https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/consumer/context
1 - Create an APP with r_1st_connections permission
2 - Authorization (STEP 2 from link)
GET https://www.linkedin.com/oauth/v2/authorization
scope should be r_1st_connections (your app must have this permission)
3 - Log in with your username and password
4 - Linkedin will return you code
something like: ?code=QWERTY
5 - Get your Access Token (STEP 3 from link)
POST https://www.linkedin.com/oauth/v2/accessToken
6 - Get your connections
GET https://api.linkedin.com/v2/connections?q=viewer&start=0&count=50
Link: https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/connections-api?context=linkedin/compliance/context

Facebook Login without JSSDK, how to get token if already authorized previously

So I am updating an older desktop app (written in VB, .net 4.0) with facebook integration and followed the guide found here, and have been able to successfully get a token (by parsing the uri of the embedded webview if it contains "token="). Now my problem is if I try to login with a facebook account that has already approved the app in a prior session, the webview just gets redirected to https://www.facebook.com/connect/login_success.html without any token information.
Do I HAVE to log all of the tokens I generate manually (ie on successful token generation, I can call their profile info, use their FB ID as key and save the token)? Even if I do, since the email and password is input directly into the facebook login window, how do I check if the user already has a token?
Thanks in advance
The access token can change any time, you need to get it everytime. After getting the token, I immediately get the user information https://graph.facebook.com/me?access_token=??? and use that ID to find their database information.
I couldn't quickly find facebook information but on google's oauth information it says "The access token is also associated with a limited scope that define the kind of data the your client application has access to (for example "Manage your tasks"). An important goal for OAuth 2.0 is to provide secure and convenient access to the protected data, while minimizing the potential impact if an access token is stolen."
https://code.google.com/p/google-api-php-client/wiki/OAuth2
Ok so I finally figured it out myself. My mistake was apparently requesting the access_token directly (ie https://www.facebook.com/dialog/oauth?response_type=token...) to try and save time.
I fixed it by making a request for a 'code' instead (ie https://www.facebook.com/dialog/oauth?response_type=code), which I then use to make a second request to retrieve an access token as documented here: https://developers.facebook.com/docs/facebook-login/login-flow-for-web-no-jssdk/, "Exchanging code for an access token" section a bit lower on the page.
Hope this helps someone in the future, this was very frustrating on my part.
Regards,
Prince