Extend - Develop social apps with Chatter and the Chatter API

Embed Size (px)

Text of Extend - Develop social apps with Chatter and the Chatter API

  • 1.Making Your Application Socialwith the Chatter API @quintonwall

2. Agenda Why Social Enable Your App? Use Cases REST API Resources Tips Summer 12 Preview Q&A 3. Make any app social with the Chatter APIREST API 4. IT: Why Social Enable Your Custom Apps?Collab betweenPartners, customers, supp dept. & teamsMake existing apps social 5. ISV: Why Social Enable Your Apps?Connect toEasily add socialenterprise-wide functionality (feeds,news feed (eg:likes, comments etc)Chatter) Distribute app virally via feed 6. Chatter API Use Cases 7. Next Generation Intranets for the Social EnterpriseBurberry World Company-wide andteam basedcollaboration Dynamic, real-timeinformation Integration of multipledata sources Sharepoint webpartreferenceimplementation 8. Use Case Custom Mobile, Desktop, TabletApps Build custom mobile applications, e.g. Product information apps Q&A Note taking and case discussion for medical providers https://github.com/quintonwall/rhatter https://github.com/cseymourSF/Chatter- API-iOS-Sample 9. Use Case - Internet of Things Share service data from Cars, Generators, Computers using custom object records / feeds Foster conversation centered on products and services. Scenarios:- Service- Technical presales- Technical support- Project Management 10. Build Highly Branded Customer Communities Enable partners or customers to collaborate with your employees or each other Share business process data Customize the UX to meet your exact brand requirements Extend to mobile and tablet apps 11. Drive Collaboration Around Business Process andData Chatter feed inside external applications Supplement data, process, and analytics with rich conversations Analytics, Finance, Supply Chain Management, HR 12. REST API Resources 13. Apigee is your friend. 14. Chatter API ResourcesSpecify version (v24 is the lasted) All requests require OAuth token 15. /chatter/users/me 16. Feed Item ResourcesChatter/feeds/news/{userId}/feed-items! 17. Comments ResourcesChatter/feed-items/{feedItemId}/comments! 18. Adding a feedItemChatter/feeds/user-profile/{userId}feed-items! 19. Working with Chatter Profile Photos 20. Chatter API Tips 21. Chatter API or SObject REST API? Chatter API: Semantically rich resources Localized presentation-ready data in JSON or XML form Comprehensive feed data in a single request Matches the web UI SObject REST API: Data directly from the database Arbitrary SOQL queries The same Oauth tokens can be used for both 22. Tips - General Group feeds are just record feeds /chatter/feeds/record/ Security model of UI is observed News feed can only be retrieved for the logged-in user Following an object is described by a subscription.DELETE the subscription to stop following Use Accept-Encoding: gzip, deflate HTTP header Always encrypt your Oauth access and refresh tokens 23. Rate Limiting Rate limiting: each user + remote access app combination gets 200 requestsper hour Requests to endpoints outside /chatter and /connect arenot counted in this rate limit Image requests not rate limited Sobject API requests count against org-wide rate limit Use separate remote access apps for production anddevelopment to avoid being rate limited Also use different users if your automated tests run often 24. Tips Javascript served from non-salesforce domain Use a controller pass-thru to work around Single OriginPolicy for ajax requests Two approaches to rendering: pass JSON responses through server as-is and render usingclient side template library such as Mustache, Handlebars, orEco Deserialize and render to HTML on the server and send toclient Requests from HTML (img tags, HTML forms) mustalso use controller pass-thru to put Oauth token intoHTTP header 25. Tips Javascript served from salesforce domain Can make ajax requests directly to Chatter API andrender to HTML on client. When Connect in Apex goes GA, you can also make requeststo a controller to get custom rendered HTML. Use an ajax proxy if youre on a custom domain. (seethe salesforce ajax toolkit) to work around SOP. 26. Tips Apex Apex Now Call the Chatter API using Apex callouts Use session Id from UserInfo Apex Future ConnectAPI class will provide Chatter API resources directly 27. Connect in Apex 28. Connect in Apex (Pilot in Summer) Exposing the same Chatter API resources and data inApex Use cases include: Customized social experiences in Visualforce Custom Chatter feed rendering in Visualforce Posting feed items with @-mentions in Apex Modifying user and group photos in Apex 29. Connect in Apex Demo 30. Take Aways Chatter can drive better user engagement with externalapplications Easy to build integrations with existing applications Wealth of interesting use cases emerge from news feedintegration. 31. How do I begin? https://developer.force.com/chatter-api 32. Thank You.