Hour 12. Direct Messages
What You’ll Learn in This Hour:
• Send direct messages through the API
• Test for the existence of friendships between users
• How to delete direct messages using destroy method
Sending a Direct Message
Although we have briefly discussed direct messages in Hour 10, in this hour we add support for sending direct messages, as well as a few other methods. We will also look at another set of API calls, called friends, in order to know if we can send a direct message in the first place.
Adding UI Elements for Direct Messages
However, the first thing we will do is revisit reading our direct messages. Because we already have this in our API set, we just need to populate the button on our UI.
Edit index.php
After this line: ...
Get Sams Teach Yourself the Twitter API in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.