cannot access api using LinkedIn v2/me - linkedin-api

I've successfully implemented LinkedIn OAuth functionality, but I need to retrieve some information from LinkedIn API.
When i access the API (v2/me), i get the below error:
message": "Not enough permissions to access: GET /me","status": 403

Common reasons you may get that error:
You didn't ask for the r_literprofile scope during the OAuth exchange.
You didn't pass the OAuth token (or passed it incorrectly).
Maybe you are asking for fields you're not authorized to access.
Hard to tell without more code from you.

Related

LinkedIn Ads Rest API - I can connect to /v1/people/~ but not the /v2/adAnalyticsV2?

I can connect to the /v1/people/~ API URL perfectly with my Access Token but trying the same Token on the /v2/adAnalyticsV2? gives me a 403 error (without further explanation). I read through all the LinkedIn documentation about their Rest API and I just don't get it.
Please help.
Based on the error code, it looks like you do not have the proper permission to access this endpoint.
Has your application been given access to use LinkedIn's Marketing Analytics API? If not, you can apply for access here: https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner
If you already have access, you should check if your application is requesting the required permission when requesting authorization codes. You would do this either by selecting it in the Default Application Permissions section when setting up your application, or by explicitly requesting it through the scope parameter in the authorization step
I got a note from the engineering team that I can't locate now mentioning something about disabling analytics from v2 of the API for some reason. Worth reaching out to your contact at LI, for sure, but most likely it was removed recently.

Facebook token for searching groups

I have created an application on developers.facebook.com from my profile. Get APP ID, APP SECRET and generate TOKEN. Now, when I send the request like
https://graph.facebook.com/search?q=media&type=page&access_token=MY_TOKEN
is ok, but when I try to send the request for GROUP, like
https://graph.facebook.com/search?q=media&type=group&access_token=MY_TOKEN
I get the error
The remote server returned an error: (403) Forbidden.
Seems I have permissions problem. I set the permissions friends_groups, user_friends, user_groups to the account, but.. still the same error...
Can you please tall me what am I doing wrong? Maybe I need a different token?
As I understand you're using an App AccessToken for an endpoint (object type) which needs a user AccessToken. See the docs at https://developers.facebook.com/docs/graph-api/using-graph-api/#search
It's stating
"All Graph API search queries require an access token included in the request. The type of access token you need depends on the type of search you're executing.
Searches across Page and Place objects requires an app access token.
All other endpoints require a user access token."

Access Token for facebook insights graph api

I have looked through many questions and answers but I cannot find out why I can't get insights working it always returns a paginated response which says that the request requires an access token. I used the graph explorer to go to an app and requested all extended permissions including read_insights then got the access token. I extended the app's access token so it never expired. I used that token to make an insights request for a page with no luck. So I tried to obtain the page's access token but that didn't work either can anyone help me?
dude, if you're trying to access insights for a page whom you're not admin then you won't get much data (only public data for it).
Please mention your problem more clearly also.

developers.facebook.com issued access token VS OAuth generated

Interesting problem I'm having right now.
Signing in an App gives a access token looking something like this:
AAACwFsGcSr4BAOGUTwfuZAWuUcwZC0rJ7noZCKMqhBI7ivDCsIGqduGIZCus5PRaS6KuREqxLmhfvZAZAkz5WCpFfANtUpYHgZD
This access token can't access users PUBLIC information, while one issued by Facebook on developers.facebook.com - CAN.
You can easily test this by logging to your facebook and going to this link: http://developers.facebook.com/docs/reference/api/
You'll see that Facebook automatically generates access token on DEMO urls like this one:
https://graph.facebook.com/me/music
?access_token=2227470867|2.AQCvlA_ZaJ2MfRR0.3600.1318266000.0-100001572415177|2FeweU6ZvOQS9OCF5ZBV58_PtPg
If you would change /ME/ to any user which has his MUSIC posted as public, you WILL be able to access that data with Graph API.
Now try to get an access token to your APP and call the same Graph API method with generated access token, the returned data is empty JSON object.
Whats’ the difference between these access tokens? How to obtain access token, that I could get public information using Graph API?
I was thinking that logging in your APP is the highest possible access token and the only higher token is token with specified permissions...
Any guidelines would be great :)
http://developers.facebook.com/docs/reference/api/permissions/
I believe the difference is that you can specify additional permissions in a scope parameter,
so if you wanted to read a user's feed you would have to specify read_stream. I was trying to accomplish this with an access token from a server-side authentication flow in ruby, but the access token only allowed to me to navigate accross a certain portion of graph.facebook.com/user_id/feed? requests. If you get any insights or comes across a solution shoot it my way too, if you can.

Facebook REST Api with OAuth tokens

As described in the Facebook Auth guide, I'm able to make (most) old REST API calls with OAuth tokens
i.e.
http://api.facebook.com/restserver.php?
method=friends.get&
app_id=...&
v=1.0&
call_id=...&
sig=...
becomes
https://api.facebook.com/restserver.php?
method=friends.get&
token=...
This does NOT work with the method "admin.setAppProperties". I get an "Application does not have permission for this action" error. The OAuth token I have though, has granted every available permission including offline access to my app, however. Any clue whats going on? Facebook docs and forums are characteristically mum.
In case you haven't managed to fix it yet, I've found the problem with their documentation:
the parameter name for the access token is wrong: it is "access_token" and not "token"
https://api.facebook.com/restserver.php?
method=friends.get&
access_token=...