idnits 2.17.1 draft-snell-activitystreams-actions-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (December 16, 2013) is 3777 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC2119' is defined on line 735, but no explicit reference was found in the text == Outdated reference: A later version (-09) exists of draft-snell-activitystreams-05 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Activity Streams (http://activitystrea.ms) J. Snell 3 Internet-Draft IBM 4 Intended status: Standards Track M. Marum 5 Expires: June 19, 2014 SugarCRM 6 December 16, 2013 8 JSON Activity Streams 2.0 - Action Handlers 9 draft-snell-activitystreams-actions-02 11 Abstract 13 This specification defines Action Handlers for use with the Activity 14 Streams 2.0 format. 16 Author's Note 18 Note that this document is a work-in-progress draft specification 19 that does not yet represent a "standard". It is the intention of 20 this specification to propose a few new ideas and openly solicit 21 feedback on their definition and use. While this document might 22 eventually evolve into an RFC the ideas described herein have not yet 23 been broadly implemented and have definitions that will evolve 24 through successive iterations of this draft. 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on June 19, 2014. 43 Copyright Notice 45 Copyright (c) 2013 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 2 61 2. Action Handlers . . . . . . . . . . . . . . . . . . . . . . . 2 62 3. HTTP Action Handler . . . . . . . . . . . . . . . . . . . . . 5 63 4. Embed Action Handler . . . . . . . . . . . . . . . . . . . . 10 64 5. Intent Action Handler . . . . . . . . . . . . . . . . . . . . 13 65 6. Using "service" and "application" objects as action handlers 13 66 7. HTML Form Objects . . . . . . . . . . . . . . . . . . . . . . 14 67 8. URL Template Objects . . . . . . . . . . . . . . . . . . . . 15 68 9. Parameters Object . . . . . . . . . . . . . . . . . . . . . . 16 69 10. Styles Object . . . . . . . . . . . . . . . . . . . . . . . . 17 70 11. Security Considerations . . . . . . . . . . . . . . . . . . . 18 71 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 72 13. Normative References . . . . . . . . . . . . . . . . . . . . 18 73 Appendix A. Using Action Handlers From Other Vocabularies . . . 18 74 A.1. Schema.org Actions Proposal . . . . . . . . . . . . . . . 19 75 A.2. Google's "Actions in the Inbox" . . . . . . . . . . . . . 19 76 A.3. Mixing Vocabularies . . . . . . . . . . . . . . . . . . . 20 77 A.4. Example Drawing From Multiple Vocabularies . . . . . . . 21 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 80 1. Overview 82 The Activity Streams 2.0 [I-D.snell-activitystreams] specification 83 introduces the notion of "actions" that can be associated with 84 objects. Using the "actions" property described in Sections 3.6 and 85 3.6.1 of the Activity Streams 2.0 document, the producer of an object 86 can declare a specific set of verbs appropriate for the object and 87 map each of those to one or more objects ("action handlers") or 88 resources capable of "carrying out" the verb. This document expands 89 on that mechanism by defining and describing a core set of action 90 handler object types. 92 2. Action Handlers 94 An action handler is an Activity Streams 2.0 object whose objectType 95 and member properties instruct a consuming application how to carry 96 out the verb the action handler has been associated with. For 97 instance, given the following example: 99 { 100 "objectType": "note", 101 ..., 102 "actions": { 103 "share": { 104 "objectType": "HttpActionHandler", 105 "url": "http://example.org/share" 106 }, 107 "like": { 108 "objectType": "EmbedActionHandler", 109 "mediaType": "text/plain", 110 "content": "Hello World" 111 } 112 } 113 } 115 The "note" object has two declared actions, "share" and "like". Each 116 of those is associated with one action handler object. The "share" 117 action has a action handler of type "HttpActionHandler", while the 118 "like" action has an "EmbedActionHandler". 120 As illustrated in the example, action handlers are represented as 121 Activity Streams 2.0 objects. All such objects share a common set of 122 base member properties as defined in the following table: 124 +---------+--------------------------+---------+--------------------+ 125 | Propert | Value | Require | Description | 126 | y | | d | | 127 +---------+--------------------------+---------+--------------------+ 128 | confirm | Boolean | No | True if the | 129 | | | | consuming | 130 | | | | application ought | 131 | | | | to seek | 132 | | | | confirmation prior | 133 | | | | to using the | 134 | | | | action handler to | 135 | | | | carry out it's | 136 | | | | associated action. | 137 | | | | Defaults to False. | 138 | context | JSON Object | No | Contextual | 139 | | | | information | 140 | | | | associated with | 141 | | | | the action | 142 | | | | handler, | 143 | | | | represented as a | 144 | | | | JSON Object | 145 | | | | without any | 146 | | | | particular | 147 | | | | structure. How the | 148 | | | | context is used is | 149 | | | | dependent entirely | 150 | | | | on the action | 151 | | | | handler definition | 152 | | | | and on how a | 153 | | | | consuming | 154 | | | | application | 155 | | | | chooses to | 156 | | | | implement the | 157 | | | | action handler. | 158 | expects | Type Value [I-D.snell-ac | No | For action | 159 | | tivitystreams] | | handlers with a | 160 | | | | distinct input | 161 | | | | requirement (e.g. | 162 | | | | HttpActionHandler) | 163 | | | | , the expects | 164 | | | | property provides | 165 | | | | a description of | 166 | | | | the expected | 167 | | | | input. | 168 | returns | Type Value [I-D.snell-ac | No | For action | 169 | | tivitystreams] | | handlers with a | 170 | | | | distinct output, | 171 | | | | the returns | 172 | | | | property provides | 173 | | | | a description of | 174 | | | | the expected | 175 | | | | output. | 176 +---------+--------------------------+---------+--------------------+ 178 This specification defines three specific base types of action 179 handler: 181 o The HTTP Action Handler (Section 3), 183 o The Embed Action Handler (Section 4), and 185 o The Intent Action Handler (Section 5). 187 Implementations are free to use Activity Stream objects of any 188 objectType as an action handler. Consuming applications MAY ignore 189 any object it encounters that use objectTypes that are not recognized 190 or supported as action handlers. Alternatively, the consuming 191 application MAY treat such objects as implied Intent Action Handlers 192 (Section 5). 194 Multiple independent action handlers can be associated with any 195 single verb using a JSON Array. The ordering of objects within such 196 an array is not considered to be significant. 198 For example, in the following, the "share" action has two associated 199 action handlers: 201 { 202 "objectType": "note", 203 ..., 204 "actions": { 205 "share": [ 206 { 207 "objectType": "HttpActionHandler", 208 "method": "GET", 209 "url": "http://example.org/share-action" 210 }, 211 { 212 "objectType": "EmbedActionHandler", 213 "mediaType": "text/plain", 214 "content": "Hello World!" 215 } 216 ] 217 } 218 } 220 3. HTTP Action Handler 222 An HTTP Action Handler describes an HTTP request/response flow that 223 is used to carry out an action. It is identified using an objectType 224 value of "HttpActionHandler". 226 +----------+----------------------------+----------+----------------+ 227 | Property | Value | Required | Description | 228 +----------+----------------------------+----------+----------------+ 229 | url | Link Value | Yes | Specifies the | 230 | | | | HTTP or HTTPS | 231 | | | | URL to which | 232 | | | | the HTTP | 233 | | | | request is | 234 | | | | directed. | 235 | method | HTTP Method String (e.g. | No | The HTTP | 236 | | "GET", "POST", "PUT", etc) | | method to use. | 237 | | | | Defaults to | 238 | | | | "GET" | 239 | target | "DEFAULT" - Consumer | No | Specifies the | 240 | | defined default; "NONE" - | | intended | 241 | | No navigation or UI | | target of the | 242 | | context (e.g. a hidden | | HTTP action. | 243 | | HTTP action that does not | | This | 244 | | result in the creation or | | determines | 245 | | use of a browser window); | | whether the | 246 | | "NEW" - A new navigation | | action results | 247 | | or UI context (e.g. show | | in a new | 248 | | the results of the HTTP | | navigation | 249 | | request in a browser | | context (e.g. | 250 | | window or tab.); "CURRENT" | | new browser | 251 | | - Reuse the existing | | window) or | 252 | | navigation or UI context | | whether the | 253 | | (e.g. show the results of | | action is | 254 | | the HTTP request in an | | "hidden". When | 255 | | existing browser window or | | not specified, | 256 | | tab.); {Other token value} | | defaults to | 257 | | - Any other TOKEN value. | | "DEFAULT", | 258 | | Interpretation and support | | meaning that | 259 | | of such extension tokens | | the consuming | 260 | | is dependent on the | | application is | 261 | | consuming application. | | free to | 262 | | Unknown or unsupported | | determine an | 263 | | values MUST be ignored. | | appropriate | 264 | | | | target | 265 | | | | context. | 266 +----------+----------------------------+----------+----------------+ 268 For example: 270 { 271 "objectType": "note", 272 ..., 273 "actions": { 274 "view": { 275 "objectType": "HttpActionHandler", 276 "url": "http://example.org/foo", 277 "method": "GET" 278 } 279 } 280 } 282 As a shortcut, HttpActionHandlers that use the "GET" method and a 283 "DEFAULT" target can be specified using a JSON string containing the 284 absolute URL. For instance: 286 { 287 "objectType": "note", 288 ..., 289 "actions": { 290 "view": "http://example.org/foo" 291 } 292 } 294 In the Activity Streams 2.0 format, the "url" property is defined as 295 a "Link Value", this means that it is possible for the value of the 296 "url" property to be an Activity Stream object that a consuming 297 application can use to resolve the actual target URL. This 298 specification defines a new UrlTemplate (Section 8) objectType 299 specifically intended for such use. 301 The UrlTemplate object can be used within an HTTP Action Handler, for 302 instance, whenever carrying out the HTTP request requires the 303 construction of a new URL that includes variable parameters: 305 { 306 "objectType": "note", 307 ..., 308 "actions": { 309 "review": { 310 "objectType": "HttpActionHandler", 311 "url": { 312 "objectType": "UrlTemplate", 313 "method": "POST", 314 "template": "http://example.org/note/123{?rating}", 315 "parameters": { 316 "rating": { 317 "id": "http://schema.org/ratingValue", 318 "displayName": "Rating", 319 "bestRating": 5, 320 "worstRating": 1 321 } 322 } 323 }, 324 "method": "GET", 325 "target": "NEW" 326 } 327 } 328 } 330 If the intended HTTP request uses the GET method and DEFAULT target, 331 the UrlTemplate object itself can be used directly as the action 332 handler. 334 "GET" HttpActionHandler shortcut using a URL Template: 336 { 337 "objectType": "note", 338 ..., 339 "actions": { 340 "review": { 341 "objectType": "UrlTemplate", 342 "template": "http://example.org/note/123{?rating}", 343 "parameters": { 344 "rating": { 345 "id": "http://schema.org/ratingValue", 346 "displayName": "Rating", 347 "bestRating": 5, 348 "worstRating": 1 349 } 350 } 351 } 352 } 353 } 355 If the HTTP request requires an input payload, the HttpActionHandler 356 object can contain an "expects" property. The value of "expects" is 357 an Activity Streams 2.0 "Type Value" represented either as a simple 358 JSON string containing a fully qualified IRI or as an Activity Stream 359 object. This specification defines a new HtmlForm (Section 7) 360 objectType to be used whenever the input of the HTTP request is an 361 HTML Form POST. 363 For example, the following describes an HTML Form post with a single 364 "foo" parameter submitted using the "application/x-www-form- 365 urlencoded" format: 367 { 368 "objectType": "note", 369 ..., 370 "actions": { 371 "share": { 372 "objectType": "HttpActionHandler", 373 "method": "POST", 374 "url": "http://example.org/foo", 375 "expects": { 376 "objectType": "HtmlForm", 377 "mediaType": "application/x-www-form-urlencoded", 378 "parameters": { 379 "foo": { 380 "id": "http://example.org/foo", 381 "type": "http://www.w3.org/2001/XMLSchema#string", 382 "displayName": "Foo Property" 383 } 384 } 385 } 386 } 387 } 388 } 390 4. Embed Action Handler 392 An Embed Action Handler defines static or dynamic content to be 393 visually rendered to carry out an action. Examples of embeds can 394 include static HTML, images, videos, gadgets and applications. It is 395 identified using an objectType value of "EmbedActionHandler". 397 +-----------+------------+--------------+---------------------------+ 398 | Property | Value | Required | Description | 399 +-----------+------------+--------------+---------------------------+ 400 | url | Link Value | Yes if | The URL from which to | 401 | | | "content" is | retrieve the content for | 402 | | | not | this embed. | 403 | | | specified. | | 404 | content | String | Yes if "url" | The character based | 405 | | | is not | "static" content to be | 406 | | | specified. | embeded. The "mediaType" | 407 | | | | parameter specifies the | 408 | | | | MIME media type of the | 409 | | | | content. | 410 | mediaType | MIME Media | No (but | The MIME Media Type of | 411 | | Type | strongly | the embedded content. | 412 | | | recommended) | | 413 | style | Styles | No | Visual CSS styling hints | 414 | | Object | | to apply to the element | 415 | | (Section | | containing the embedded | 416 | | 10) | | content. | 417 | preview | Link Value | No | A reference to a | 418 | | | | "preview" representation | 419 | | | | of the embedded content. | 420 | | | | Typically, this would a | 421 | | | | URL to a thumbnail or | 422 | | | | screenshot image of the | 423 | | | | content. | 424 | target | "DEFAULT"; | No | | 425 | | "INLINE"; | | | 426 | | {Other | | | 427 | | token | | | 428 | | value} | | | 429 +-----------+------------+--------------+---------------------------+ 431 In the following example, the "view" action is associated with an 432 "EmbedActionHandler" containing a static fragment of HTML markup: 434 { 435 "objectType": "note", 436 ..., 437 "actions": { 438 "view": { 439 "objectType": "EmbedActionHandler", 440 "content": "
This is some bit of embedded HTML
", 441 "mediaType": "text/html", 442 "style": { 443 "height": "100px", 444 "width": "100px", 445 "box-shadow": "10px 10px 5px #888888" 446 }, 447 "displayName": "Some embedded content", 448 "preview": "http://example.org/preview/123.jpg" 449 } 450 } 451 } 453 Alternatively, the embedded content can be referenced by URL: 455 { 456 "objectType": "note", 457 ..., 458 "actions": { 459 "view": { 460 "objectType": "EmbedActionHandler", 461 "url": "http://example.org/foo", 462 "mediaType": "text/html" 463 } 464 } 465 } 467 The mediaType parameter specifies the type of content to be embedded. 468 Consuming applications MAY ignore Embed Action Handlers that specify 469 unrecognized or unsupported mediaTypes. 471 Example: 473 { 474 "objectType": "note", 475 ..., 476 "actions": { 477 "view": { 478 "objectType": "EmbedActionHandler", 479 "url": "http://example.org/foo.mpg", 480 "mediaType": "video/mpeg" 481 } 482 } 483 } 485 5. Intent Action Handler 487 An Intent Action Handler provides a generic way for the publisher of 488 an Activity object to tell the consuming application to figure out 489 how to handle the action on it's own. The consumer can, for 490 instance, pass the object off to some other native platform 491 application. It is identified using an objectType value of 492 "IntentActionHandler". 494 For example: 496 { 497 "objectType": "note", 498 ..., 499 "actions": { 500 "share": { 501 "objectType": "IntentActionHandler", 502 "displayName": "Share This", 503 "context": { 504 "foo": "ABC", 505 "bar": 123 506 } 507 } 508 } 509 } 511 6. Using "service" and "application" objects as action handlers 513 The "service" and "application" object are existing objectTypes 514 defined by the Activity Streams 1.0 core schema. While these objects 515 were not originally designed to be used as action handlers, they can 516 be. Specifically, the "service" objectType can be used when the 517 action is to be carried out using some specific third party service 518 interface; the "application" objectType can be used when the action 519 is to be carried out by deferring some some specific native platform 520 application. 522 For example: 524 { 525 "objectType": "note", 526 ..., 527 "actions": { 528 "share": { 529 "objectType": "service", 530 "displayName": "My Sharing Service", 531 "url": "http://share.example.org/api" 532 }, 533 "save": { 534 "objectType": "application", 535 "displayName": "Read this later!", 536 "platform": "android", 537 "id": "123", 538 "url": "http://play.google.com/..." 539 } 540 } 541 } 543 7. HTML Form Objects 545 +----------+-----------+----------+---------------------------------+ 546 | Property | Value | Required | Description | 547 +----------+-----------+----------+---------------------------------+ 548 | mediaTyp | MIME | No | Defaults to "application/x-www- | 549 | e | Media | | form-urlencoded" | 550 | | Type | | | 551 | paramete | Parameter | No | Defines the HTML form | 552 | rs | s Object | | parameters. | 553 | | (Section | | | 554 | | 9) | | | 555 +----------+-----------+----------+---------------------------------+ 557 For example: 559 { 560 "objectType": "note", 561 ..., 562 "actions": { 563 "review": { 564 "objectType": "HttpActionHandler", 565 "method": "POST", 566 "url": "http://example.org/foo", 567 "expects": { 568 "objectType": "HtmlForm", 569 "mediaType": "application/x-www-form-urlencoded", 570 "parameters": { 571 "foo": { 572 "displayName": "Foo", 573 "id": "http://example.org/FooProperty", 574 "type": "http://www.w3.org/2001/XMLSchema#string", 575 "required": True 576 }, 577 "bar": { 578 "displayName": "Bar", 579 "id": "http://example.org/BarProperty", 580 "type": "http://www.w3.org/2001/XMLSchema#", 581 "required": True, 582 "value": "Provided Value" 583 } 584 } 585 } 586 } 587 } 588 } 590 8. URL Template Objects 592 Objects with the "UrlTemplate" object type represent [RFC6570] URL 593 Templates. 595 +------------+-------------------+----------+-----------------------+ 596 | Property | Value | Required | Description | 597 +------------+-------------------+----------+-----------------------+ 598 | template | URL Template | Yes | The [RFC6570] URL | 599 | | | | Template | 600 | parameters | Parameters Object | No | Defines the URL | 601 | | (Section 9) | | Template parameters | 602 +------------+-------------------+----------+-----------------------+ 603 { 604 "objectType": "note", 605 ..., 606 "actions": { 607 "review": { 608 "objectType": "UrlTemplate", 609 "template": "http://example.org/foo/123{?rating}", 610 "parameters": { 611 "rating": { 612 "displayName": "Rating", 613 "id": "http://example.org/RatingProperty", 614 "required": True 615 } 616 } 617 } 618 } 619 } 621 9. Parameters Object 623 A Parameters Object is used to provide descriptions of the variable 624 inputs of objects such as HTML Forms (Section 7) and URL Templates 625 (Section 8). The object is expressed as a JSON dictionary mapping 626 parameter names to Type Values [I-D.snell-activitystreams] describing 627 the parameters. 629 By default, all parameters defined within the object are assumed to 630 be required. When a parameter is described using an Object, the 631 object MAY contained a boolean "required" member. If "required" is 632 false, use of the parameter is assumed to be optional. 634 Using the Parameters Object in UrlTemplate objects: 636 { 637 "objectType": "UrlTemplate", 638 "template": "http://example.org{/foo,bar}" 639 "parameters": { 640 "foo": "http://example.org/FooProperty", 641 "bar": { 642 "id": "http://example.org/BarProperty", 643 "displayName": "Bar", 644 "required": False 645 } 646 } 647 } 649 Using the Parameters Object in HtmlForm objects: 651 { 652 "objectType": "HtmlForm", 653 "mediaType": "application/x-www-form-urlencoded", 654 "parameters": { 655 "foo": "http://example.org/FooProperty", 656 "bar": { 657 "id": "http://example.org/BarProperty", 658 "displayName": "Bar", 659 "required": False 660 } 661 } 662 } 664 10. Styles Object 666 A Styles Object is used by EmbedActionHandlers to provide CSS style 667 hints for the container within which embedded content is to be 668 displayed. The object is expressed as either a single JSON 669 dictionary object mapping CSS property names to appropriate CSS 670 values, or an array of JSON dictionary objects. An optional "media" 671 member can be included within the dictionary providing a CSS Media 672 Query. 674 Example style hints: 676 { 677 "objectType": "note", 678 ..., 679 "actions": { 680 "view": { 681 "objectType": "EmbedActionHandler", 682 "content": "Some plain text content", 683 "mediaType": "text/plain", 684 "style": { 685 "height": "100px", 686 "width": "100px", 687 "box-shadow": "10px 10px 5px #888888" 688 } 689 } 690 } 691 } 693 Multiple style hints for specific media query targets: 695 { 696 "objectType": "note", 697 ..., 698 "actions": { 699 "view": { 700 "objectType": "EmbedActionHandler", 701 "content": "Some plain text content", 702 "mediaType": "text/plain", 703 "style": [ 704 { 705 "media": "print", 706 "height": "100px", 707 "width": "100px", 708 "box-shadow": "10px 10px 5px #888888" 709 }, 710 { 711 "media": "screen and (orientation: landscape)", 712 "height": "100px", 713 "width": "100px", 714 "box-shadow": "10px 10px 5px #888888" 715 } 716 ] 717 } 718 } 719 } 721 11. Security Considerations 723 TBD 725 12. IANA Considerations 727 TBD 729 13. Normative References 731 [I-D.snell-activitystreams] 732 Snell, J., "JSON Activity Streams 2.0", draft-snell- 733 activitystreams-05 (work in progress), November 2013. 735 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 736 Requirement Levels", BCP 14, RFC 2119, March 1997. 738 [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., 739 and D. Orchard, "URI Template", RFC 6570, March 2012. 741 Appendix A. Using Action Handlers From Other Vocabularies 742 The Activity Streams 2.0 Actions mechanism is specifically designed 743 to allow Action Handlers from multiple vocabularies. 745 A.1. Schema.org Actions Proposal 747 Based on http://www.w3.org/wiki/images/b/b9/Actionsinschema.org.pdf: 749 { 750 "objectType": "video", 751 ..., 752 "actions": { 753 "watch": [ 754 { 755 "objectType": "http://schema.org/WebPageHandler", 756 "url": "http://movies.example.com/player?id=123" 757 }, 758 { 759 "objectType": "http://schema.org/AndroidHandler", 760 "url": "http://movies.example.com/player?id=123", 761 "package": "com.movies" 762 } 763 ] 764 } 765 } 767 A.2. Google's "Actions in the Inbox" 769 Based on https://developers.google.com/gmail/actions/reference/ 770 review-action: 772 { 773 "objectType": "note", 774 ..., 775 "actions": { 776 "review": { 777 "objectType": "http://schema.org/ReviewAction", 778 "review": { 779 "objectType": "http://schema.org/Review", 780 "itemReviewed": { 781 "objectType": "http://schema.org/FoodEstablishment", 782 "name": "Joe's Diner" 783 }, 784 "reviewRating": { 785 "objectType": "http://schema.org/Rating", 786 "bestRating": "5", 787 "worstRating": "1" 788 } 789 }, 790 "handler": { 791 "objectType": "http://schema.org/HttpActionHandler", 792 "url": "http://reviews.com/review?id=123", 793 "requiredProperty": { 794 "objectType": "http://schema.org/Property", 795 "name": "review.reviewRating.ratingValue" 796 }, 797 "method": "http://schema.org/HttpRequestMethod/POST" 798 } 799 } 800 } 801 } 803 A.3. Mixing Vocabularies 804 { 805 "objectType": "video", 806 ..., 807 "actions": { 808 "watch": [ 809 { 810 "objectType": "HttpActionHandler", 811 "url": "http://movies.example.com/player?id=123", 812 "target": "NEW" 813 }, 814 { 815 "objectType": "http://schema.org/AndroidHandler", 816 "url": "http://movies.example.com/player?id=123", 817 "package": "com.movies" 818 } 819 ] 820 } 821 } 823 A.4. Example Drawing From Multiple Vocabularies 825 { 826 "objectType": "video", 827 "displayName": "A Movie!", 828 ..., 829 "actions": { 830 "watch": [ 831 { 832 "objectType": "EmbedActionHandler", 833 "displayName": "HD", 834 "mediaType": "video/mpeg", 835 "url": "http://cdn.example.org?id=123amp;fmt=HD", 836 }, 837 { 838 "objectType": "EmbedActionHandler", 839 "displayName": "SD", 840 "mediaType": "video/mpeg", 841 "url": "http://cdn.example.org?id=123&fmt=SD", 842 }, 843 { 844 "objectType": "application", 845 "displayName": "Watch on Netflix", 846 "url": "http://netflix.com..." 847 } 848 ], 849 "like": { 850 "objectType": "EmbedActionHandler", 851 "mediaType": "text/html", 852 "url": "http://www.facebook.com/plugins/like.php...", 853 "style": { 854 "width": "150px", 855 "height": "50px" 856 } 857 }, 858 "share": [ 859 { 860 "objectType": "HttpActionHandler", 861 "displayName": "Twitter", 862 "url": "https://twitter.com/share?url=...", 863 "target": "DIALOG" 864 }, 865 { 866 "objectType": "HttpActionHandler", 867 "displayName": "Facebook", 868 "url": "https://www.facebook.com/sharer/sharer.php?u=...", 869 "target": "DIALOG" 870 } 871 ], 872 "save": [ 873 { 874 "objectType": "service", 875 "id": "http://getpocket.com", 876 "displayName": "Pocket", 877 "context": { 878 "url": "http://example.org/movie?id=123", 879 "title": "A Movie!", 880 "tags": "foo, bar, baz" 881 } 882 }, 883 { 884 "objectType": "service", 885 "id": "http://instapaper.com", 886 "displayName": "Instapaper", 887 "context": { 888 "url": "http://example.org/movie?id=123", 889 "title": "A Movie!", 890 "selection": "An action movie!" 891 } 892 } 893 ], 894 "review": { 895 "objectType": "HttpActionHandler", 896 "displayName": "Rate this movie!", 897 "url": "http://review.example.org/movie?id=123", 898 "method": "POST", 899 "expects": { 900 "objectType": "HtmlForm", 901 "mediaType": "application/x-www-form-urlencoded", 902 "parameters": { 903 "rating": { 904 "id": "http://schema.org/ratingValue", 905 "bestRating": 5, 906 "worstRating": 0, 907 "displayName": "Rating", 908 "required": true 909 }, 910 "comments": { 911 "id": "http://schema.org/commentText", 912 "displayName": "Comments", 913 "required": "false" 914 } 915 } 916 } 917 } 918 } 919 } 921 Authors' Addresses 923 James M Snell 924 IBM 926 Email: jasnell@gmail.com 928 Matthew Marum 929 SugarCRM 931 Email: mgmarum@gmail.com