Linkedin-API returns insufficient permission and empty result - linkedin-api

I am making some calls to the LinkedIn API v2 after getting my access token.
Only a single call succeeds in returning Network Size ok.
The rest of the calls are empty or permission denied:
https://api.linkedin.com/v2/organizationalEntityFollowerStatistics?q=organizationalEntity&organizationalEntity=urn:li:organization:XXXXX&oauth2_access_token=MYACCESSTOKEN
Follower Statistics:
stdClass Object
(
[message] => Viewer [29398181] has insufficient permission to fetch this organization.
[status] => 403
)
https://api.linkedin.com/v2/shares?q=owners&owners=urn:li:organization:XXXXX&sharesPerOwner=1000&oauth2_access_token=MYACCESSTOKEN
Organization Shares:
stdClass Object
(
[elements] => Array
(
)
[paging] => stdClass Object
(
[total] => 0
[count] => 10
[start] => 0
[links] => Array
(
)
)
)
Please advise. Thank you!

Related

Error, Fault message used AP ID: APP-80W284485P519543T

ERROR
Array
(
[0] => Array
(
[name] => ns3:FaultMessage
[attributes] => Array
(
[xmlns:ns3] => http://svcs.paypal.com/types/common
[xmlns:ns2] => http://svcs.paypal.com/types/ap
)
[0] => Array
(
[name] => responseEnvelope
[0] => Array
(
[name] => timestamp
[value] => 2014-02-20T10:17:27.045-08:00
)
[1] => Array
(
[name] => ack
[value] => Failure
)
[2] => Array
(
[name] => correlationId
[value] => 53cf284d0847f
)
[3] => Array
(
[name] => build
[value] => 9641252
)
)
[1] => Array
(
[name] => error
[0] => Array
(
[name] => errorId
[value] => 560022
)
[1] => Array
(
[name] => domain
[value] => PLATFORM
)
[2] => Array
(
[name] => subdomain
[value] => Application
)
[3] => Array
(
[name] => severity
[value] => Error
)
[4] => Array
(
[name] => category
[value] => Application
)
[5] => Array
(
[name] => message
[value] => The X-PAYPAL-APPLICATION-ID header contains an invalid value
)
[6] => Array
(
[name] => parameter
[value] => X-PAYPAL-APPLICATION-ID
)
)
)
)
Hello,
I use the sandbox AP ID: APP-80W284485P519543T and I tried another one which called Client ID, which i got from the API credentials in the profile under sandbox test accounts, both didn't work and I got this error. What is the right api ID? Where can I find it? or is some other thing wrong? Looking forward for your answer. Thank you.
Regards
Jess
The APP ID : APP-80W284485P519543T is the default APP ID for the Sandbox.
But, you are making calls to live PayPAl.
The Endpoint should be something like : https://svcs.sandbox.paypal.com/AdaptivePayments/Pay
Also, check the if you have passed any space in your APPID.
Client ID is used for making REST API calls.
The sandbox App ID is indeed APP-80W284485P519543T, so you're good if that's the value you're using for testing. I guess you just need to make sure you're trimming any whitespace or any junk off the ends, and make sure your headers are setup correctly in general.
Are you working with PHP? If so, you might want to check out my PayPal class library. It'll make your Adaptive Payments calls very simple for you.

How to get the visitors state information from the tab iframe tab page via signed request?

Is there anyway to get the state information of the user visiting my facebook tab page? Currently via signed request i can get the country information. Is there a way to get state information also??
Answer is NO, check out the documentation here https://developers.facebook.com/docs/authentication/signed_request/
You get data like this
Array (
[algorithm] => HMAC-SHA256
[issued_at] => 1328803958
[page] => Array (
[id] => 114951721840
[liked] => 1
[admin] => 1 )
[user] => Array (
[country] => us
[locale] => en_US
[age] => Array ( [min] => 21 )
)
)

How to get "message" and "photo" from status message in group

Among other API's (Twitter), I am using the Facebook Graph API to create a realtime "collage" of photo's and messages from Facebook, Twitter and a designated mailbox, so that all guests at a wedding can send in photos and messages, that will be projected using a beamer during the wedding.
I have successfully implemented retrieval of type="message" and type="photo" messages, but when it comes to fetching messages of type="status", the messages are missing the "message" property. Also, if a status was posted with a photo, I cannot find any way to retrieve the photo that was attached to the status message.
Is there any way (either via Graph or by using FQL), to get the "missing" information? The status messages in the group itself (viewing the group using Facebook) contain the text and the photo, so I believe the information should be available somewhere.
The details of the message that I get, look as follows:
(I have changed or deleted some of the properties for privacy reasons).
As you can see, there is no [message] property containing the text of the status update, nor is there any reference to the photo that accompanies this status update.
Array (
[id] => xxxxxxxxxxxxxxx_xxxxxxxxxxxxxxx
[from] => Array
(
[name] => <name>
[id] => xxxxxxxxxxxxxxx
)
[to] => Array
(
[data] => Array
(
[0] => Array
(
[version] => 1
[name] => <name>
[id] => xxxxxxxxxxxxxxx
)
)
)
[actions] => Array
(
[0] => Array
(
[name] => Comment
[link] => http://www.facebook.com/xxxxxxxxxxxxxxx/posts/xxxxxxxxxxxxxxx
)
[1] => Array
(
[name] => Like
[link] => http://www.facebook.com/xxxxxxxxxxxxxxx/posts/xxxxxxxxxxxxxxx
)
)
[type] => status
[application] => Array
(
[name] => Facebook for iPhone
[namespace] => fbtouch
[id] => xxxxxxxxxx
)
[created_time] => 2012-05-26T16:00:00+0000
[updated_time] => 2012-05-26T16:00:00+0000
[likes] => Array
(
[data] => Array
(
[0] => Array
(
[name] => <name>
[id] => xxxxxxxxxxxxxx
)
)
[count] => 1
)
[comments] => Array
(
[count] => 0
)
)
I hope there is a way to retrieve the properties I need; it would be a shame if all photos that are posted as "status" message, cannot be used for the wedding presentation.

facebook signed_request user_id missing

This is data of signed_request:
Array
(
[algorithm] => HMAC-SHA256
[issued_at] => 1331219385
[page] => Array
(
[id] => xxxx602xxx551
[liked] => 1
[admin] => 1
)
[user] => Array
(
[country] => at
[locale] => de_DE
[age] => Array
(
[min] => 21
)
)
)
but user_id is missing ...
is this because user dont gave permission to the app?
I thougt an app can access all data which is public, like name or user_id
is there a way to get "user_id" without a basic permission?
You will not be able to get any identity of user prior to connection with application, this is just not possible.
You need to authorize the user to get his user id

Problems getting monthly active users correctly (via Facebook Graph API)

Hey there!
I'm not able to fetch a reliable monthly active users number of my application. I tried it with FQL:
[...]
$end_time = date('Y-m-d', time()-(60*60*24*2)); // Dont' know what is correct. Sometimes it's *2 sometimes it's working with *3
$fql = $facebook->api(array(
"method" => "fql.query",
"query" => "SELECT metric, value FROM insights WHERE object_id='000000000' AND metric='application_active_users'
AND end_time=end_time_date('".$end_time."')
AND period=period('month')"
));
[...]
Looks like it's not possible to get a value up-to-the-minute. I want to get the same value as stated on my application page. But with this code it's different every day.
I also tried this solution:
$fql = $facebook->api('/000000000/insights/application_active_users/month');
but as response I only get out dated values which are a few days old:
Array
(
[data] => Array
(
[0] => Array
(
[id] => 000000000/insights/application_active_users/month
[name] => application_active_users
[period] => month
[values] => Array
(
[0] => Array
(
[value] => 166345
[end_time] => 2010-12-09T08:00:00+0000
)
[1] => Array
(
[value] => 167679
[end_time] => 2010-12-10T08:00:00+0000
)
[2] => Array
(
[value] => 168983
[end_time] => 2010-12-11T08:00:00+0000
)
)
[description] => Monthly Users who have engaged with your application or viewed your application (Unique Users)
)
)
[paging] => Array
(
[previous] => https://graph.facebook.com/000000000/insights/application_active_users/month?since=1291556506&until=1291815706
[next] => https://graph.facebook.com/000000000/insights/application_active_users/month?since=1292074906&until=1292334106
)
)
What am I doing wrong?
Facebook insights data is not available just-in-time. The insights graph will always display historic data only.
If you are interested for current monthly_active_users number look into the applications table with fql.