25
Do More in the Feed with Action Links Mohamad Arabo LMTS, Software Engineer Chris Seymour LMTS, Software Engineer

REST API: Do More in the Feed with Action Links

Embed Size (px)

DESCRIPTION

Have you been hacking some JavaScript to enable your users to do more, directly in the Chatter feed? Hack no more! in Winter '15 you can define, invoke, and debug Action Links in Force.com. If you are familiar with our REST APIs and Chatter, join the engineers who delivered this feature for a walkthrough of tools, code samples, and resources. You'll come away ready to create your own action links.Have you been hacking some JavaScript to enable your users to do more, directly in the Chatter feed? Hack no more! in Winter '15 you can define, invoke, and debug Action Links in Force.com. If you are familiar with our REST APIs and Chatter, join the engineers who delivered this feature for a walkthrough of tools, code samples, and resources. You'll come away ready to create your own action links.

Citation preview

Page 1: REST API: Do More in the Feed with Action Links

Do More in the Feed with Action Links Mohamad Arabo

LMTS, Software Engineer

Chris Seymour

LMTS, Software Engineer

Page 2: REST API: Do More in the Feed with Action Links

Safe Harbor

Safe harbor statement under the Private Securities Litigation Reform Act of 1995:

This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.

 

The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.

 

Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Page 3: REST API: Do More in the Feed with Action Links

Agenda

• Overview of Action Links• Code Examples

o Action Link: Download a file from Dropboxo Action Link: Call into Apex REST Serviceo Action Link: API call to Twilio

• Q&A

Page 4: REST API: Do More in the Feed with Action Links

Action Links Use Cases

• Third Party applications want to define their own actions in Chatter

• Allow Users to do work/more in the Feed

Page 5: REST API: Do More in the Feed with Action Links

Action Links And The Feed• An action link is a URL on a post that links to an API, a Web

page, or a file

• Add links on a Chatter post to any Salesforce or 3rd Party API with only two steps:

• Define the Action Links• Post to Chatter or Communities with the Action Link ID

• Security Framework:• Exclusively HTTPS call-backs• API details are stored with encryption, and obfuscated for clients

Page 6: REST API: Do More in the Feed with Action Links

Action Links: Do More in the Feed

Work in the Feed: Kate can approve her purchase orders right in the Feed

Page 7: REST API: Do More in the Feed with Action Links

Action Links: User Targeting

User-specific: Ken can see both “Order” and “Download” Action Links

Jessica cannot see “Order” as it is private to Ken

Page 8: REST API: Do More in the Feed with Action Links

Functional Details

Page 9: REST API: Do More in the Feed with Action Links

• Organization Administrators will allow Connected Apps to post Action Link Groups and Feed items to the org

• Connected Apps:o Integrate an application with Salesforce using APIso Use standard SAML and OAuth protocols to authenticateo Provided Single Sign-On, and provide tokens for use with

Salesforce APIs.

Who Can Create Action Links?

Page 10: REST API: Do More in the Feed with Action Links

• API : Approve Expenses, Approve PO

• Async API: Upload Files, Crop Image, Sync Contacts, etc.

• UI : View Map, open Visual Force Page, Canvas Page, etc.

• Download: Download file from Dropbox, Box, etc.

Action Links Types

Page 11: REST API: Do More in the Feed with Action Links

• Feed-item Body• Feed-item Detail Menu (Overflow)

• Placement on a Feed-item is controlled by Category metadata:• Primary → Feed-item Body• Overflow → Feed-item Detail Menu

Where Do Action Links appear?

Page 12: REST API: Do More in the Feed with Action Links

• Action Links are statefulo Newo Pendingo Successfulo Failed

• inclusion in the Feed output representation indicates availability• Visibility:

o Specific Usero Public

Everyone Everyone except user

• Number of Executions:o Repeatableo Once Per Usero Onceo Can be mutually exclusive when in a groupo Can expire

Who Can Execute Action Links?

Page 13: REST API: Do More in the Feed with Action Links

API Details

Page 14: REST API: Do More in the Feed with Action Links

How to Create And Associate Action Links

A Connected App will

POST /connect/action-link-group-definitions to create ActionLinkGroups

POST /chatter/feed-element to create feed elements with associated ActionLinkGroups

Page 15: REST API: Do More in the Feed with Action Links

Downloading a File from Dropbox

Page 16: REST API: Do More in the Feed with Action Links

Action Link Group To Download A FilePOST /connect/action-link-group-definitions { "executionsAllowed":"Unlimited", "expirationDate":"2014-11-20T19:32:10+0000", "category":"Primary", "actionLinks":[ { "actionType":"Download", "actionUrl":"https://www.dropbox.com/s/738numccoeaba1z/4.JPG?dl=0", "groupDefault":"true", "requiresConfirmation":"true" "labelKey":"Download" ]}

Confirmation: Ask users to confirm their intentions

Repeatability: Action Links can be Repeatable, OncePerUser, or Once.

Types: Download, Link to a web page (UI), API, or Async API.

Category: Primary or Overflow

ActionUrl: the Url the request will hit

Page 17: REST API: Do More in the Feed with Action Links

Post FeedItem With Action Link Group

POST /chatter/feed-element{ "body": { "messageSegments": [ { "type": "Text", "text": "Feed item with ActionLink" } ] }, "subjectId": "me", "feedElementType": "feedItem","capabilities": { "associatedActions": { "actionLinkGroupIds": ["0AgRR0000004CIL0A2" ] } }}

New in Summer ‘14

New in Summer ‘14

Page 18: REST API: Do More in the Feed with Action Links

Integration with Apex REST Web Service

Page 19: REST API: Do More in the Feed with Action Links

Action Link Group And Apex REST Service

@RestResource(urlMapping='/Demo/*') global class ApexRestWebService {

@HttpPost global static void doPost(String accountName) { Account newAccount = new Account(); newAccount.Name = accountName; insert(newAccount); } }

Page 20: REST API: Do More in the Feed with Action Links

Create Action Link GroupsPOST /connect/action-link-group-definitions { "executionsAllowed":"OncePerUser", "expirationDate":"2014-11-20T19:32:10+0000", "category":"Primary", "actionLinks":[ { "actionType":"Api", "actionUrl":"/services/apexrest/Demo", "groupDefault":"true", "labelKey":"Create", "method":"Post", "requestBody":"{\"accountName\" : \"DF14Account\"}", "headers":[ {"name":"Content-Type", "value":"application/json"}]}, ]}

requestHeaders

Page 21: REST API: Do More in the Feed with Action Links

Integration with 3rd Party API platformTwilio

Page 22: REST API: Do More in the Feed with Action Links

Action Link API call to Make a Phone Call

•Twilio API

o API calls to make and receive phone calls

o API calls to send and receive text messages

Page 23: REST API: Do More in the Feed with Action Links

Create Action Link GroupsPOST /connect/action-link-group-definitions { "executionsAllowed":"OncePerUser", "expirationDate":"2014-11-20T19:32:10+0000", "category":"Primary", "actionLinks":[ { "actionType":"Api", "userId":"005D0000001RW4K” "actionUrl":"https://api.twilio.com/2010-04-01/Accounts/ACeff423454ceb53e4c6e1508f06d7b5b5/Calls.json", "groupDefault":"true", "labelKey":"Call", "method":"Post", "requiresConfirmation":"true", "requestBody":"Body=Url=http://www.myapp.com/myhandler.php&Method=GET&FallbackMethod=GET&StatusCallbackMethod=GET&Record=false&To=%2B19095698500&From=%2B16269863405", "headers":[ {"name":"Content-Type", "value":"application/x-www-form-urlencoded"}, {"name":"Authorization", "value":"Basic xxxxxxxx"} ]}, ]}

requestBody

Page 24: REST API: Do More in the Feed with Action Links

Q&A

Page 25: REST API: Do More in the Feed with Action Links