Paypal Balance Accounts API - INSUFFICIENT_PRIVILEGES - paypal

i'm trying to access paypals accounts using the rest api
i'm making a request to /v2/wallet/balance-accounts/ ( Documentation : https://developer.paypal.com/docs/api/balance-accounts/)
but keep getting the following message:
Array
(
[name] => INSUFFICIENT_PRIVILEGES
[message] => Insufficient privileges for requested resource.
[information_link] =>
[details] => Array
(
[0] => Array
(
[issue] => Insufficient privileges for requested resource.
[code] => INSUFFICIENT_PRIVILEGES
)
)
)
does anyone know from where i can change/add the privileges? i can't find the settings for it
thank you

It says here you must have a business account, and also here (you must be a partner) based on their suggestion here you have an alternative:
https://developer.paypal.com/docs/classic/api/merchant/GetBalance_API_Operation_NVP/
Which is unfortunately not REST
Hope this helps

Related

Error: ERR.SP.BUSINESS_ERROR while sending CreatePassengerNameRecordRS request at Sabre

While sending request CreatePassengerNameRecordRS to create PNR on sabre, receiving an error "ERR.SP.BUSINESS_ERROR" which describe "Could not find the PNR locator in the End Transaction response".
What is the root cause for this error?
(
[0] => stdClass Object
(
[code] => ERR.SP.BUSINESS_ERROR
[content] => PNR has not been created successfully, see remaining messages for details
)
[1] => stdClass Object
(
[code] => ERR.SP.BUSINESS_ERROR
[content] => Could not find the PNR locator in the End Transaction response
)
)```
The reason behind this is that something in the creation of the PNR didn't go through, maybe some mandatory fields in the PNR were missing and the service is not able to save the record locator by ending the transaction, thus it returns this warning.

Google Analytics Error code 403 Insufficient Permission Perl

before posting I make sure to check other similar threads.
but none has the same problem as mine.
the closest two would be:
Google Analytics PHP API "(403) Insufficient Permission"
and Google Analytics API - inconsistent error "insufficientPermissions' (403)
but there is no specific answer/solution to that thread.
and found this Python Google Analytics Management API throws error 403 Forbidden but I dont really know/understand if this is related to my issue..perhaps someone can enlighten me?
I have 2 clients, A & B. Both claimed has granted me the access to Read & Analyse
I succeed extracting data from A, but failed on B.
I believe, I have both GA Profile ID correct and no coding error (since A succeed).
To confirm that I dont use wrong GA profile ID, GA Profile ID would be 9876543 from the example below
/a12345w654321p9876543/
The error code is 403, insufficient permission for this profile.
GA error: 403 Forbidden {"error":{"errors":[{"domain":"global","reason":"insufficientPermissions","message":"User does not have sufficient permissions for this profile."}],"code":403,"message":"User does not have sufficient permissions for this profile."}} at ./ga_pp_yest.pl line 90.
Then, I tried to give access to the same account on my own website (for testing purpose).
I go to Property level and give permission Read & Analyse. (even tried changing to Account Level with Edit permission)
I still get the same error.
some of my code:
my $analytics = Net::Google::Analytics->new;
# Authenticate
my $oauth = Net::Google::Analytics::OAuth2->new(
client_id => $client_id,
client_secret => $client_secret,
);
my $token = $oauth->refresh_access_token($refresh_token);
$analytics->token($token);
$req = $analytics->new_request(
start_date => "$startDate",
end_date => "$startDate",
ids => "ga:$profile_id",
dimensions => "ga:pagePath,ga:date,ga:hour,ga:channelGrouping,ga:deviceCategory,ga:region,ga:city",
metrics => "ga:entrances",
max_results => "1000",
);
$res = $analytics->retrieve($req);
die( "GA error: " . $res->error_message ) if !$res->is_success;
I checked the token, it gave me 1 hour of access. using this link https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=accessToken
any help is greatly appreciated.
thank you very much

Paypal Adeptive Response Message

can anyone please explain me this error message?
i am using paypal adeptive payments but all is properly setup but this error is coming in light box pop up so please explain it for me?
Array
(
[Errors] => Array
(
[0] => Array
(
[Receiver] =>
[Category] => Application
[Domain] => PLATFORM
[ErrorID] => 520003
[ExceptionID] =>
[Message] => Authentication failed. API credentials are incorrect.
[Parameter] =>
[Severity] => Error
[Subdomain] => Application
)
)
)
thank you
This error message is the result of incorrect credentials being passed. You would want to make sure the credentials you are passing are correct. Note, if you are copying them from the PayPal website directly, I would recommend copy and pasting them into a text editor then copy and paste from there to your code to avoid leading or trailing spaces from occurring when pasting the information.
If your credentials are correct I would recommend reviewing your code to ensure that these credentials are not being changed or modified when being passed over to PayPal.
One thing thing you can try is if your using the sandbox for the purpose of this testing, I would recommend attempting to run it in Live mode as there can be issues occasionally with certain functions running on the sandbox environment.

Facebook API: publish_stream permission works only once

I am working on one application based on Web to post on the wall, comment, like and delete post through the API of Facebook. I ask for these permissions in the register step:
***'scope' => 'publish_actions,read_stream,publish_stream'***
and after registration I can do everything: Post on the wall, comment a post, like and delete. But once I logout from my application and then log in again, take the proper token from my database and try to do the same things, I find that I can post on the wall and delete post but when I try to like or comment I found this error:
*Fatal error: Uncaught OAuthException: (#200) Requires publish_stream permission or Requires extended permission:
publish_actions thrown in...*.
But in fact when I asked about the permission of the user to facebook I have this answer:
*Array ( [data] => Array ( [0] => Array ( [installed] => 1 [read_stream] => 1 [status_update] => 1 [photo_upload] => 1 [video_upload] => 1 [create_note] => 1 [share_item] => 1 [publish_stream] => 1 [publish_actions] => 1 ) ) )*
What I am doing wrong? Thanks!
When the user logs into facebook again, you should refresh their token in your database and use the updated version with any API calls you make.

Errors with: https://graph.facebook.com/app_id/insights/share_views/day?access_token=

I am trying to get the number of users who have seen pages shared from my site using: https://graph.facebook.com/app_id/insights/share_views/day?access_token=
I am filling in my app_id and access_token and I am getting an error response of:
Array ( [error] => Array ( [type] => OAuthException [message] => (#604) Invalid metric name: share_views ) )
Has anyone run into this error and determined the cause?
I believe you need to actually specify time period you are trying to access. For an example of an application that is working and can access Insight data, check here https://github.com/facebook/insights-api-sample.
Notice that they specify a since and until post parameter in this file:
https://github.com/facebook/insights-api-sample/blob/master/php/results.php