Service

Schedule a service

Schedules a service to be triggered at a specified time.

Only services that can be triggered for the project context and handle the default event can be scheduled. This includes services with types scheduled_actions, scheduled_script, and other service types that support project-level triggering.

(Note: To schedule services that are triggered for a contact, project.scheduleMessage should be used instead with message_type=service.)

post/v1/projects/{project_id}/scheduled_services

Request

  • Base URL: https://api.telerivet.com
  • URL: https://api.telerivet.com/v1/projects/{project_id}/scheduled_services
  • Auth: one of:
    • HTTP basic
    • OAuth 2 (authorization code, authorization URL https://telerivet.com/oauth/authorize, token URL https://api.telerivet.com/oauth/token)

Path parameters

project_idstring required

ID of the Project

Request body

service_idstring required

ID of the service to schedule

start_timeinteger

The time that the service will be triggered (or first triggered for recurring scheduled services)

start_time_offsetinteger

Number of seconds from now to trigger the service

rrulestring

A recurrence rule describing how the schedule repeats, e.g. 'FREQ=MONTHLY' or 'FREQ=WEEKLY;INTERVAL=2'; see https://tools.ietf.org/html/rfc2445#section-4.3.10. (UNTIL is ignored; use end_time parameter instead).

timezone_idstring
end_timeinteger

Time after which a recurring scheduled service will stop (not applicable to non-recurring scheduled services)

end_time_offsetinteger

Number of seconds from now until the recurring scheduled service will stop

varsobject

Custom variables to store for this scheduled service

Example request

{
  "rrule": "FREQ=DAILY"
}

Response

Successful response

idstring

ID of the scheduled service

service_idstring

ID of the service to be triggered

rrulestring

Recurrence rule for recurring scheduled services, e.g. 'FREQ=MONTHLY' or 'FREQ=WEEKLY;INTERVAL=2'; see RFC2445.

timezone_idstring

Timezone ID used to compute times for recurring scheduled services; see List of tz database time zones Wikipedia article.

time_createdinteger

Time the scheduled service was created in Telerivet

start_timeinteger

The time that the service will be triggered (or first triggered for recurring scheduled services)

end_timeinteger nullable

Time after which a recurring scheduled service will stop (not applicable to non-recurring scheduled services)

prev_timeinteger nullable

The most recent time that Telerivet triggered this scheduled service (null if it has never been triggered)

next_timeinteger nullable

The next upcoming time that Telerivet will trigger this scheduled service (null if it will not be triggered again)

occurrencesinteger

Number of times this scheduled service has already been triggered

varsobject

Custom variables stored for this scheduled service. Variable names may be up to 32 characters in length and can contain the characters a-z, A-Z, 0-9, and _. Values may be strings, numbers, or boolean (true/false). String values may be up to 4096 bytes in length when encoded as UTF-8. Up to 100 variables are supported per object. Setting a variable to null will delete the variable.

project_idstring

ID of the project this scheduled service belongs to

Example response

{
  "id": "SEfaf2411ed3584f08",
  "service_id": "SVa1299c3d0e371023",
  "rrule": "COUNT=1",
  "timezone_id": "America/Los_Angeles",
  "time_created": 1395617416,
  "start_time": 1395617516,
  "next_time": 1395617516,
  "project_id": "PJ2ad0100821a98bea"
}

Changes

No recorded changes to this operation across all 1 revision of this API.