Snapshot API

From Second Life Wiki
Revision as of 12:29, 17 January 2010 by Dedric Mauriac (talk | contribs)
Jump to navigation Jump to search

Overview

Email snapshot of user interface

The Second Life Snapshot API enables you to parse information from Snapshot emails sent from the viewer for:

  • Blogging
  • Social Networking
  • Image Libraries

Where is the Snapshot API used?

There are many websites that already use this information. Some of them are as follows:

More can be found at Snapshot_resources#Social_sites_featuring_snapshots.

Structure

Headers

Email messages have headers that provide metadata about the message itself. Most of this information is hidden from the person reading an email message. You can use some of this information to verify that the snapshot came from a Linden Lab server.

The following headers are available.

Parameter Data type Description
X-Originating-IP string IP of simulator in brackets. [216.82.41.11]. See Simulator_IP_Addresses to verify origin.
Subject string Subject of message
Sender string email address of www-data account on simulator. "www-data" <www-data@sim8938.agni.lindenlab.com>
From string Combination of address and name. Note: name is not always avatar name.
Date date Date of snapshot in Pacific timezone.

Body

Snapshots are sent as two parts. The first is plain text, and the second is a multi-part message in MIME format.

  • text/plain
  • multipart/related
    • text/html
    • image/jpeg - secondlife-postcard.jpg
    • image/jpeg - logo_secondlife.jpg

Details

The HTML content within the multi-part message will contain details of the snapshot in a comment tag:

<!-- BEGIN POSTCARD DETAILS
agent_id=c4822e40-f763-4eec-bba3-e4bf842a074a
username="Dedric Mauriac"
region_id=714a15be-8511-4842-a8c1-38c1f54f3c58
sim_name="Applewood"
global_x=260282
global_y=235143
local_x=186
local_y=135
local_z=56
END POSTCARD DETAILS -->
Parameter Data type Description
agent_id key The UUID of the avatar that sent the message.
username string Quoted name of the avatar who sent the message.
region_id key The UUID of the region that the avatar was standing when the snapshot was taken.
sim_name string Quoted name of the region that the avatar was standing when the snapshot was taken.
global_x integer The grids horizontal location of where the avatar was standing when the snapshot was taken.
global_y integer The grids vertical location of where the avatar was standing when the snapshot was taken.
local_x integer The regions horizontal location of where the avatar was standing when the snapshot was taken.
local_y integer The regions vertical location of where the avatar was standing when the snapshot was taken.

Message

Although you could use the entire HTML source code of a message, it is often not wanted. The original message contains additional information that is not needed. The message that the end-user wrote in the postcard itself is identified with comments:

<!-- BEGIN POSTCARD BODY -->
test message
<!-- END POSTCARD BODY -->

HTML Entities will be encoded. "<" will appear as "&lt;".

Referral Bonus

Snapshots include a URL to invite others to join them. If a new account is created from following the link, and certain conditions are met, then the sender could receive a bonus. This URL is wrapped around the logo in the message.

http://secondlife.com/ss/?u=123456789abcdef0123456789abcdef0

Snapshot

The snapshot is a JPEG image. Postcards have two images, including a logo. The snapshot file name is always called "secondlife-postcard.jpg".