SETUP_AUTOMATION_MANAGE SETUP Endpoint
  /rpc/setup/?method=SETUP_AUTOMATION_MANAGE  
  Object: 349. Click here for more information.  
  PARAMETERS TYPE NOTES
  DataReturn Text A comma delimited list of advanced search fields to be returned after a successful save
  Id Numeric  
  Remove Numeric Pass '1' to remove the item
       
  AdvancedSearchMethod Numeric For DeliveryType of 1 (Email) or 2 (SMS), is mandatory. The id of the Advanced Search to be run. See SETUP_METHOD_SEARCH
  ApplyStandardEmailTemplate Text (1) Y [default] / N. If sending as an Email, should the standard email template be used in addition to the document (below)
  BodyDocument Numeric For DeliveryType of 1 (Email) or 2 (SMS), is mandatory. The id of the document that is the main body of the email. See DOCUMENT_SEARCH. It should have the tag [[AUTOMATION.LINEDOCUMENT]] to indicate where the LineDocument should be inserted.  It can include the special tags [[CONTACTPERSON.FIRSTNAME]] and [[CONTACTPERSON.SURNAME]].
  Data Text (Long) For DeliveryType of 1 (Email) or 2 (SMS), is mandatory. The Advanced Search data to process. Can be part of the data, for example just filters: {"filters":[{"name":"id","comparison":"IN_LIST","value1":"734,735"}]}
You can have the tags [[AUTOMATION.USER]] and [[AUTOMATION.CONTACTPERSON]] in the filters.  For example {"filters":[{"name":"action.actionby","comparison":"EQUAL_TO","value1":"[[AUTOMATION.USER]]"}]}
Any fields passed are ignored, instead it picks up the required fields from the documents
  EmailFrom Text (100) Defaults to the user's creating the record
  LineDocument Numeric For DeliveryType of 1 (Email) or 2 (SMS), is mandatory. The id of the document that is repeated for each row returned. See DOCUMENT_SEARCH
  Notes Text (2000)  
  RunAttempts Numeric Can only be set when DeliveryType = 4 (Custom). Is reset to 0 whenever this method is called (if not passed)
  Schedule Numeric 1 = Sunday [default], 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday, 8 = All Week Days, 9 = Every Day
  ScheduleHour Numeric The time the automation gets run. 24 hour time, i.e. 00..23
  ScheduleMinute Numeric 00..59. Note: The scheduler runs at approximately 5 minute intervals, and picks up any due automations
  ScheduleTimeZone Numeric Defaults to the user's creating the record. See SETUP_TIMEZONE_SEARCH
  Status Numeric 1 = Enabled [default], 2 = Disabled
  Subject Text (100) Subject of the email. If blank defaults to the Title (below)
  Title Text (50) Mandatory
  Type Numeric

1 = Email [default], 2 = SMS, 3 = URL, 4 = Custom. 

When DeliveryType = 3, the url (below) will be called passing

{
automationguid:,
user: {id:, guid:, firstname:, surname:, email:, username:},
data: ... data as above ...
}

The url needs to reply with either:

{status: 'OK'}

{status: 'ER', error: {errornotes: '... error message ...'}}

When DeliveryType = 4, you need to the processing yourself - i.e. it will not be processed by MESSAGING_AUTOMATION_SCHEDULER_RUN

You can log the run using MESSAGING_AUTOMATION_SCHEDULER_LOG_MANAGE.

  URL Text (200) For DeliveryType = 3 (URL)
  RETURN  
  Id Numeric
  Status ADDED
  EXAMPLE  
    To send out a list of products modified yesterday
  1. Create a header document via DOCUMENT_MANAGE.
  • You can include tags from your advanced search, for example [[PRODUCT.CREATEDDATE]]. These fields will be populated from the first row of results
  • You can also include the tags [[CONTACTPERSON.SURNAME]] AND [[CONTACTPERSON.FIRSTNAME]] - These will be populated with the recipient.
  • Add the tag where the lines will go [[AUTOMATION.LINEDOCUMENT]]. Typically, you would set up a table, for egReference[[AUTOMATION.LINEDOCUMENT]]
  2. Create a line document via DOCUMENT_MANAGE. This document will be repeated for each row in the results. For example, [[product.reference]]
  3. Build the advanced search. You don't need to pass the fields, they will be picked up automatically from the template. You can pass ordering, options etc, but the filter section is the most important. For example, {"filters":[{"name":"modifieddate","comparison":"equal_to","value1":"yesterday"}]}