Facebook message send API - php

I am trying to develop PHP Application through which I want to send message to any individual Facebook user.
I am using below API: https://developers.facebook.com/docs/messenger-platform/send-api-reference/text-message
I am following this one while developing my app: http://www.phpgang.com/facebook-messenger-api-for-pages-using-curl-php_3929.html.
But when I am running my application it throws error:
Array ( [error] => Array ( [message] => (#100)
No matching user found [type] => OAuthException [code] => 100
[error_subcode] => 2018001 [fbtrace_id] => Ha3u2Mvk1ZF ) )
Please somebody help, I am stuck in this.

Related

How to get my PayPal account's transaction history via API

I want to get my PayPal accounts transaction history. Just the same data I can export when I'm logged in.
All the transactions there where not generated via REST API itself.
I read some posts where it says that one can't use, for example, "Transaction Search" API (https://developer.paypal.com/docs/api/transaction-search/v1/) in this case.
I tried this out but could not get it to work.
After I got my access_token:
stdClass Object
(
[scope] => https://api.paypal.com/v1/payments/.* openid https://api.paypal.com/v1/vault/credit-card/.* https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/identity/activities https://api.paypal.com/v1/vault/credit-card
[access_token] => xxx
[token_type] => Bearer
[app_id] => xxx
[expires_in] => 32400
[nonce] => 2020-09-05T22:25:09ZHAnra0QUpsxgo4E90gqEKtgtUNgkGNzVs1IVCBJfiu0
)
I tried to call the /v1/reporting/transactions API an got back:
stdClass Object
(
[localizedMessage] => No permission for the requested operation.
[suppressed] => Array
(
)
[name] => PERMISSION_DENIED
[message] => No permission for the requested operation.
[details] => Array
(
[0] => stdClass Object
(
[field] =>
[value] =>
[location] =>
[issue] => No permission for the requested operation.
)
)
[information_link] => https://developer.paypal.com/docs/classic/products/permissions/
[debug_id] => feb53d91bc653
)
The "information_link" in the response ends up at 404.
And yes, I activated "Transaction Search API" in my Developer Account.
Then I found this old API:
https://developer.paypal.com/docs/archive/express-checkout/ht-searchRetrieveTransactionData-curl-etc/#
There, PayPal says that this API is deprecated but will still work ... for customers who are using it.
For me, this also does not work, response:
{
"name": "INTERNAL_SERVICE_ERROR",
"message": "An internal service error has occurred",
"debugId": "a2b554e8cc7b",
"links": [
{
"href": "https://developer.paypal.com/docs/api/overview/#error",
"rel": "information_link"
}
]
}
So how to get existing PayPal transactions of my PayPal account via API? There must be a way, there are many tools who import this data, but which API do they use?
I tried this out, it don't worked, I could not get the data.
And yes, I activated "Transaction Search API" in my Developer Account.
After activating it you need to wait 9 hours, and ensure you get a new access_token that is not the same as your old one. You should then have a new [scope] returned which includes https://uri.paypal.com/services/reporting/search/read
Without that scope returned, you can't use the Transaction Search API.
There must be a way, there are many tools who import this data, but which API do they use?
The Transaction Search API is actually not very useful -- most people use the Reports tab in www.paypal.com and download a CSV file

Laravel one way communication

I want laravel backend to send a message to my Ionic App whenever there is an entry in my database. I don't want to do polling at frontend, found this library rukavina/kurento-client-php
(https://github.com/rukavina/kurento-client-php) but unable to get any success as I was getting this error.
Array (
[code] => 40201
[data] => Array (
[type] => SDP_PARSE_ERROR
)
[message] => Empty offer not valid
)
Can anyone help me who either implemented kurento-client-php library or worked on similar situation.
Finally did it using Laravel-ratchet and php-zmq.

Google APIs Client Library for PHP - countryBlocked exception

I've created a web application which runs with the 'Google APIs Client Library'.
This worked perfectly for me for the last two years.
But since yesterday I am facing a huge problem.
If I want to access the analytics api the system returns:
Google_Service_Exception Object
(
[errors:protected] => Array
(
[0] => Array
(
[domain] => global
[reason] => countryBlocked
[message] => This service is not available from your region
)
)
[retryMap:Google_Service_Exception:private] => Array
(
[500] => -1
[503] => -1
[rateLimitExceeded] => -1
[userRateLimitExceeded] => -1
)
[message:protected] => Error calling GET https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles: (403) This service is not available from your region
)
I've checked the logs and made 50 requests the last 30 days so spamming could not be the reason for the block.
When I run it from a different Server it runs just fine.
Can anyone explain why this is happening and how I can bypass it?

paypal adaptive payments-sdk showing error 540031 in website

I am using PayPal adaptive payments SDK with with payment detail api but it's showing me error like
[error] => Array
(
[0] => ErrorData Object (
[errorId] => 540031
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => You do not have permission to get these payment details
[exceptionId] => [parameter] =>
)
)
I think it gives me some permission error I have checked in my papal account for permission but still not getting the exact response and how to solve it. Please guide me on this.
Thanks in advance.
I got solution...
Issue is with Paypal sandbox detail which i have entered in my configuration file.
I have change that it's working.
Thanks For support.

Unknown SSL protocol error in connection to api-read.facebook.com:443

Sometimes happens that is that I receive the error below, but sometimes it works fine. It happens when aplication is trying to use the graph api or when the graph api re-queries FQL.
For example:
select name, sex, pic_big, locale, email, birthday
from user
where uid = me();
Error:
FacebookApiException Object
(
[result:protected] => Array
(
[error_code] => 35
[error] => Array
(
[message] => Unknown SSL protocol error in connection to api-read.facebook.com:443
[type] => CurlException
)
)
I don't know what is about because it sometime work and sometime not. Has anyone idea what could do this?
Do as I did sometime ago... change to api.facebook.com all your queries in the FB SDK.
Regards.

Categories