SPM

In Sailthru’s Site Recommendations, a section is a personalized area of your site that may exist across any number of pages.

For each section, you will specify:

  • A content feed and rules written in the Zephyr language to select and prepare content from the feed, for example, to filter by tag and request user-specific content recommendations.
  • A template or JSON object name.
    • If you choose to receive a JSON object of feed items, you can present the content using your own JavaScript code.
    • If you want Sailthru to render the HTML for the section, specify template code (using Zephyr, HTML, CSS, and/or JavaScript) along with the ID of the HTML div on your page where the content will be displayed.
  • One or more optional section audiences, to vary the feed, rules, and/or template based on whether the viewer is part of a particular user list. Each audience is assigned a unique list, chosen from the lists in your Sailthru account. If no audience is matched, default section parameters are used.

Each template and set of rules is stored as a string in its own block object. Blocks are referenced by sections and can be reused across multiple sections.

Personalization Engine Section Data Structure

Users of my.sailthru.com can configure sections and their attributes through the site. As a developer, you can also do this using Site Personalization Manager’s block and section API endpoints.

block

Method Description Parameters Response
GET Get all blocks’ data
(excluding content)
required:
none
Array of block objects:

[
  { 
    "id":<string>,
    "name":<string>,
    "type":<string>,
    "create_time":<string>,
    "create_user":<string>,
    "modify_time":<string>,
    "modify_user":<string>
  },
  {...}
]
GET Get all data for a block required:
id: <string>
{
  "id":<string>,
  "name":<string>,
  "type":<string>,
  "content":<string>,
  "create_time":<string>,
  "create_user":<string>,
  "modify_time":<string>,
  "modify_user":<string>
}

204: if the block ID does not exist

404: if client ID does not exist or block ID is malformed

POST Create a block required:
name: <string>
type: <string>

  • setup
    (i.e. rules),
    html (template),
    or json

content: <string>

201 (created)
400/500 (on failure)
PUT Update a block required:
id: <string>

optional
:
name: <string>
type: <string>

  • setup
    (i.e. rules),
    html (template),
    or json

content: <string>

204 (on success)
400/500 (on failure)
DELETE Delete a block required:
id: <string>

 

section

Method Description Parameters Response
GET Get the array
of all sections’
data excluding
audience data
(list, feed, blocks)
required:
none
{
  "id": ,
  "name": ,
  "create_time": ,
  "create_user": ,
  "modify_time": ,
  "modify_user": 
}
GET Get all data for a section required:
id: <string>
{  
  "id":,
  "name":,
  "audiences":[  
    {  
      "list_id":,
      "feed_id":,
      "blocks":[  
        {  
          "block_id":
        },
        {  
          <additional blocks>
        }
      ]
    },
    {  
      <additional audiences>
    }
  ],
  "create_time":,
  "create_user":,
  "modify_time":,
  "modify_user":
}
POST Create a section required:
name: <string>
audiences: <array>
201 (created)
400/500 (on failure)
PUT Update a section required:
id: <string>optional :
name: <string>
audiences: <array>
204 (on success)
400/500 (on failure)
DELETE Delete a section required:
id: <string>
204 (on success; no content returned)
400/500 (on failure with error message(s) returned)

{
  "errormsg": <messages>
}
Top