api_user

Description

Makes an API user request.

api_user( object options [, string id ] )

This is for use only within a trigger custom zephyr script.

Make a user API Request

  • optionsA Key/Value Hash containing one or all items
    • keythe key type of id (see keys)
    • fieldsthe fields to return (see fields)
    • keysset some or all of the user keys (see keys)
    • keysconflictdefine behavior if keys conflict with existing keys (see keysconflict)
    • listskey/value hash; each key is the name of a list, and each value is 1 to subscribe the user from that list and 0 to remove the user from the list
    • varskey/value hash of replacement variables you want to set or a json string
    • optout_emailset email opt-out status to `none`, `all`, or `blast`
    • loginmark the user as logged in – pass site to represent a site login, app to represent an app login, and optionally user_agent and ip
  • idIf not set, Sailthru ID (SID) will be used

This function is basically a User API call in POST mode

Examples

api_user({"lists": {"listA": 1, "listB": 0}})

To set for a different email:

api_user({"lists": {"listA": 1, "listB": 0, "key": "email"}}, "joe@example.com")
Top