How can We used Twitter Direct mesage API in magento - magento-1.7

I want the functionality to send Direct message from my website using twitter API
But I am getting an error,
{"request":"/1.1/blocks/create.json","error":"Read-only application cannot POST."}{"ids":
[2563195406,262571857,2525414911,293987080,1338863436,15052860,1470277314,122058685,1139173794
,1381267824,225402247,274433814],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"pr
evious_cursor_str":"0"}

You don't have write permission to send direct message so register your number in your twitter account and then change your app permission.

Related

User to User Messaging with Facebook API

I am trying to write an application that allows the user to authenticate via Facebook and then allows the user to send messages to their contacts through my platform, but the documentation doesn't seem to indicate any way of doing so. I see where the documentation for Web allows a pop-up share dialog, but I want a pure UI if possible that, after authenticating with Facebook, doesn't use Facebook's UI anymore.
Ideally, I'd like to be able to send the messages from the server instead of through the JavaScript API.
Is this possible?
The Send Dialog is the only way to send messages from User to User. You cannot send messages with the API, each message has to be written and committed by the user.
Btw, you do not need authorization to use the Send Dialog, just the JavaScript SDK.

Facebook Messenger API pages_messaging permission

I am creating an application where I need a user to be able to grant us access to their facebook page so that all incoming messages can flow through our application (as well as outgoing).
I have this all working correctly, but facebook will not approve my app due to the facebook permission pages_messaging and them "not receiving a response from my bot" (I have been denied three straight times). What am I doing wrong here? We are not using bots, do I even need the pages_messaging permission (I am using their webhook to get incoming page messages, and graph api to send outgoing)?
When submitting app, pages_messaging permission says:
Please provide the page that can be used to test this bot. Make sure the bot is properly connected and functional, otherwise your submission may be rejected.
Here is facebook's feedback from my submission (denied multiple times):
Thank you for your submission. We tested the messenger experience on your associated page and received no response from your messenger bot. Please resubmit with the new, improved version of your bot.
You got to create a bot to use the messaging API: https://developers.facebook.com/docs/messenger-platform/implementation
To just read/send messages:
https://developers.facebook.com/docs/graph-api/reference/v2.6/conversation/messages
You can use the /pageID/conversations endpoint to retrieve all conversations your page has had with FB profiles.
Next you can read/post to the /conversationID/messages endpoint to read/respond to a person.
And you can even subscribe to the conversations field for pages with webhooks.
You will need a page admin's page access token that has the read_page_mailboxes permission scope to set up the subscription, and to read/reply to messages.

Facebook - Send Message To Friend(s) with / or without API in PHP / cURL?

Apparently with the Facebook API, you can only read a users inbox, not send messages. Without doing a Javascript send dialog.
I am creating a simple script with twilio where I can call in, and save a message. Then have that message be emailed to a friend, or myself.
That's done, and easy, but people don't check their emails that often as they check a Facebook message.
Question:
Is it possible with the Facebook API, or using cURl or some other method in PHP to automatically login into my facebook account, and send a message to a friend?
My personal facebook, not anyone, but have my email and password passed into it and have the script do this automatically?
Is this possible, or against Facebooks TOS to have php remotely access and use my FB account?
If someone were looking for a similar solution today, they can request access to integrate Twilio with the Facebook Messenger API here.
If you send an SMS with Twilio, for example:
https://www.twilio.com/docs/api/rest/sending-messages
https://www.twilio.com/docs/api/rest/sending-messages
from twilio.rest import TwilioRestClient
# put your own credentials here
ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
AUTH_TOKEN = "[AuthToken]"
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(
to="+15558675309",
from_="+15017250604",
body="Hey Jenny! Good luck on the bar exam!",
media_url="http://farm2.static.flickr.com/1075/1404618563_3ed9a44a3a.jpg",
)
You would then be able to integrate with Facebook Messenger with little change to your Twilio code.
You can try Nimrod : https://www.nimrod-messenger.io/
Your friends will have to register and give you their API keys if you want to send messages to them.

How do you post a link to user's inbox in Facebook?

I am a iPhone application developer. I don't know how to send an "link" to a selected user's inbox in Facebook from my Facebook account.
You can't send messages using a Facebook API from the backend, but you can do through JS SDK or redirecting user to facebook url as per this link
FYI: Send Message
I don't exactly know if I understood your question, but: If you want to provide a link that a user follows in order to go to her/his Facebook inbox, you can use the URL scheme fb://mailbox (provided that she/he has the Facebook app installed)
As #Venu wrote, the api does not allow apps to send messages on the behalf of the user, only with the Send Dialog which you should be able to open using the iOS sdk Dialog.
Another approach you can use is the Chat API with which you can send messages on the behalf of the user, it requires the xmpp_login permission and you to implement an xmpp client.

how to send facebook Notification or message via its api?

please let me know how can i Send facebook Notification or message via its API through a facebook app?
You can use the Old REST API to send notifications to users who have authenticated your application. First you must request the "email" extended permission from the user, then you can use the notifications.sendEmail method to send them the notification.
I used this dialog to send message one my one. But had no luck to send message to facebook account successfully.
https://www.facebook.com/dialog/send?app_id=MY_APP_ID&name=Check This Website&to=MY_APPLICATIONS_USER_ID&link=MY_WEBSITE_LINK&redirect_uri=MY_APPLICATION_URL