REST API: Do More in the Feed with Action Links
-
Upload
salesforce-developers -
Category
Technology
-
view
295 -
download
0
description
Transcript of 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
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.
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
Action Links Use Cases
• Third Party applications want to define their own actions in Chatter
• Allow Users to do work/more in the Feed
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
Action Links: Do More in the Feed
Work in the Feed: Kate can approve her purchase orders right in the Feed
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
Functional Details
• 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?
• 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
• 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?
• 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?
API Details
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
Downloading a File from Dropbox
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
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
Integration with Apex REST Web Service
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); } }
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
Integration with 3rd Party API platformTwilio
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
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
Q&A