PUT masters/{id}/schedule

Overview

This resource is used to update the scheduling for a specific master. A master can be scheduled for a one time delivery or on a recurring schedule. If a master has other scheduling parameters defined this will replace those parameters. To edit a master it must be in the disabled state.

  • hourly - takes an interval value which can be from 1-24. 1 is the defualt value.
  • daily - takes no parameters
  • weekly - takes a weekDay value which is any named week day. sunday is the default value
  • monthly - takes a monthDate value which can be from 1-31. 1 is the default value

Resource URI

 https://api.yesmail.com/v2/masters/{id}/schedule

Call Description

The PUT /v2/masters/{id}/schedule replaces the schedule of the specified message master {id} with a new schedule.

HTTP Return Codes

Code

Description

200 OK

Returned when the master ID exists, the payload will have the master's schedule section only.

400 Bad Request

The request if malformed, the schedule criteria are invalid, or the master is not in disabled state.

401 Unauthorized

The request requires user authentication.  Invalid Api-User and/or Api-Key header value.

404 Not Found

The master ID cannot be found, may not exist for the given Api-User or is archived.

Request

Send the message once with localized time offset. Audience is pre-compiled an hour before start time.

{
  "frequency": "once",
  "start": "2015-06-10T10:00:00-0800",
  "preCompileStart":"2015-06-10T9:00:00-0800"
}

Response

Response returns time in UTC.

{
    "start": "2015-06-10T18:00:00.000Z",
    "frequency": "once",
    "preCompileStart": "2015-06-10T17:00:00.000Z"
}

Request

This sends a message every hour for the month of June.

{
  "frequency": "hourly",
  "interval": 1,
  "start": "2015-06-01T10:00:00Z",
  "stop": "2015-06-30T23:59:59Z"
}

Request

Sends the message every Sunday in June.

{
  "frequency": "weekly",
  "weekDay": "Sunday",
  "start": "2015-06-10T10:00:00Z",
  "stop": "2015-06-30T23:59:59Z"
}