Embedded Experience In OpenSocial Messages

Proposal

Embedded experiences was introduced as part of OpenSocial 2.0 with the two main use cases being email and activity streams.  A natural addition to objects that can contain embedded experience is the OpenSocial Message object.  The use case here being a gadget or user sends a message to another user containing an embedded experience.  

Use Case

Say you have a photo sharing gadget which allows a user to share photos, or photo albums with other users in the network.  User A uploads a photo using the gadget and then selects to share the photo with all of his friends.  The photo sharing gadget chooses to send a message to each of User A's friends including an embedded experience allowing the recipients to comment on the photo.

Updates To The Message Data Model

Here is the existing message data model.

The easiest way to add embedded experiences to the message object would be to add an embed field to data model.  This field would contain the embedded experiences data model.

The other option would be to leverage the data field (not currently listed in the fields table Issue 1262) to include the embedded experiences data model.  However the spec defines how to use the data field as...

The 'data' field is used for information specific to the gadget that is sending or displaying the message. It may be omitted in most messages. An example is a message from a user asking to join a group. In the received message to the group's owner(s), the 'data' field could contain the JSON or XML representation of an OpenSocial Group.

This seems to indicate that the data field should be used for information specific tot he gadget sending or displaying the message.  However the embedded experience may not necessarily be specific to either gadget.