33
Making Your Application Social with the Chatter API @quintonwall

Extend - Develop social apps with Chatter and the Chatter API

Embed Size (px)

Citation preview

Page 1: Extend - Develop social apps with Chatter and the Chatter API

Making Your Application Social with the Chatter API

@quintonwall

/add_address

@add_address

in/add_address

Page 2: Extend - Develop social apps with Chatter and the Chatter API

Agenda

§  Why Social Enable Your App? §  Use Cases

§  REST API Resources

§  Tips

§  Summer ‘12 Preview

§  Q&A

Page 3: Extend - Develop social apps with Chatter and the Chatter API

Make any app social with the Chatter API

REST API

Page 4: Extend - Develop social apps with Chatter and the Chatter API

IT: Why Social Enable Your Custom Apps?

Collab between dept. & teams

Make existing apps social

Partners, customers, suppliers

Page 5: Extend - Develop social apps with Chatter and the Chatter API

ISV: Why Social Enable Your Apps?

Connect to enterprise-wide news feed (eg:

Chatter)

Distribute app virally via feed

Easily add social functionality (feeds, likes, comments etc)

Page 6: Extend - Develop social apps with Chatter and the Chatter API
Page 7: Extend - Develop social apps with Chatter and the Chatter API

Chatter API Use Cases

/add_address

@add_address

in/add_address

Page 8: Extend - Develop social apps with Chatter and the Chatter API

Next Generation Intranets for the Social Enterprise

§  Company-wide and team based collaboration

§  Dynamic, real-time information

§  Integration of multiple data sources

§  Sharepoint webpart reference implementation

Burberry World

Page 9: Extend - Develop social apps with Chatter and the Chatter API

Use Case – Custom Mobile, Desktop, Tablet Apps

§  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

Page 10: Extend - Develop social apps with Chatter and the Chatter API

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

Page 11: Extend - Develop social apps with Chatter and the Chatter API

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

Page 12: Extend - Develop social apps with Chatter and the Chatter API

Drive Collaboration Around Business Process and Data

•  Chatter feed inside external applications

•  Supplement data, process, and analytics with rich conversations

•  Analytics, Finance, Supply Chain Management, HR

Page 13: Extend - Develop social apps with Chatter and the Chatter API

REST API Resources

/add_address

@add_address

in/add_address

Page 14: Extend - Develop social apps with Chatter and the Chatter API

Apigee is your friend.

Page 15: Extend - Develop social apps with Chatter and the Chatter API

Chatter API Resources

Specify version (v24 is the lasted)

All requests require OAuth token

Page 16: Extend - Develop social apps with Chatter and the Chatter API

/chatter/users/me

Page 17: Extend - Develop social apps with Chatter and the Chatter API

Feed Item Resources

Chatter/feeds/news/{userId}/feed-items!

Page 18: Extend - Develop social apps with Chatter and the Chatter API

Comments Resources

Chatter/feed-items/{feedItemId}/comments!

Page 19: Extend - Develop social apps with Chatter and the Chatter API

Adding a feedItem Chatter/feeds/user-profile/{userId}feed-items!

Page 20: Extend - Develop social apps with Chatter and the Chatter API

Working with Chatter Profile Photos

Page 21: Extend - Develop social apps with Chatter and the Chatter API

Chatter API Tips

/add_address

@add_address

in/add_address

Page 22: Extend - Develop social apps with Chatter and the Chatter API

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

Page 23: Extend - Develop social apps with Chatter and the Chatter API

Tips - General

§  Group feeds are just record feeds –  /chatter/feeds/record/<group id>

§  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

Page 24: Extend - Develop social apps with Chatter and the Chatter API

Rate Limiting

§  Rate limiting: –  each user + remote access app combination gets 200 requests

per hour

§  Requests to endpoints outside /chatter and /connect are not 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 and development to avoid being rate limited –  Also use different users if your automated tests run often

Page 25: Extend - Develop social apps with Chatter and the Chatter API

Tips – Javascript served from non-salesforce domain

§  Use a controller pass-thru to work around Single Origin Policy for ajax requests

§  Two approaches to rendering: –  pass JSON responses through server as-is and render using

client side template library such as Mustache, Handlebars, or Eco

–  Deserialize and render to HTML on the server and send to client

§  Requests from HTML (img tags, HTML forms) must also use controller pass-thru to put Oauth token into HTTP header

Page 26: Extend - Develop social apps with Chatter and the Chatter API

Tips – Javascript served from salesforce domain

§  Can make ajax requests directly to Chatter API and render to HTML on client. –  When Connect in Apex goes GA, you can also make requests

to a controller to get custom rendered HTML.

§  Use an ajax proxy if you’re on a custom domain. (see the salesforce ajax toolkit) to work around SOP.

Page 27: Extend - Develop social apps with Chatter and the Chatter API

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

Page 28: Extend - Develop social apps with Chatter and the Chatter API

Connect in Apex

/add_address

@add_address

in/add_address

Page 29: Extend - Develop social apps with Chatter and the Chatter API

Connect in Apex (Pilot in Summer)

§  Exposing the same Chatter API resources and data in Apex

§  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

Page 30: Extend - Develop social apps with Chatter and the Chatter API

Connect in Apex Demo

Page 31: Extend - Develop social apps with Chatter and the Chatter API

Take Aways

§  Chatter can drive better user engagement with external applications

§  Easy to build integrations with existing applications

§  Wealth of interesting use cases emerge from news feed integration.

Page 32: Extend - Develop social apps with Chatter and the Chatter API

How do I begin?

https://developer.force.com/chatter-api

Page 33: Extend - Develop social apps with Chatter and the Chatter API

Thank You.