Schedule Helper Version 2
This document describes the OSDI schedule helper endpoint as implemented by the Action Network.
The schedule helper allows you to schedule a message to be sent to the targeted list in the future, or cancel a scheduled message so it does not send at the scheduled date and time. It takes a date field to schedule the message at that time, and no fields or other arguments to cancel scheduling.
Sections:
- Endpoint
- Field names and descriptions
- Related resources
- Scenario: Schedule a message (POST)
- Scenario: Cancel a message's scheduling (DELETE)
Endpoint
Endpoint:
https://actionnetwork.org/api/v2/messages/[message_id]/schedule
The schedule helper lives at the endpoint relating to the specific message you want to schedule.
Back To Top ↑Field names and descriptions
Send Helper fields:
Field Name | Type | Required on POST | Description |
---|---|---|---|
scheduled_start_date | datetime | Yes | The date and time your message will be scheduled to be sent, in UTC. Must be in the future. |
Related resources
Back To Top ↑Scenario: Schedule a message (POST)
If you POST with a scheduled_start_date
field, you will schedule the message to be sent to the targeted list at that future time, assuming the message can be sent:
Request
POST https://actionnetwork.org/api/v2/messages/9f837109-710d-442f-8a99-857a21f36d25/schedule/ Header: Content-Type: application/json OSDI-API-Token: your_api_key_here
{ "scheduled_start_date": "2015-03-14T12:00:00Z" }
Response
200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "message": "Your message has been scheduled" }
Messages can only be scheduled if they contain all of the required fields (subject
, body
, from
, and reply_to
), are in 'draft' status, have a total_targeted
count greater than 0, and the scheduled_start_date
is in the future.
Scenario: Cancel a message's scheduling (DELETE)
If you DELETE with a blank JSON object, you will cancel a message's scheduling, so it will no longer be sent at the scheduled time:
Request
DELETE https://actionnetwork.org/api/v2/messages/9f837109-710d-442f-8a99-857a21f36d25/schedule/ Header: Content-Type: application/json OSDI-API-Token: your_api_key_here
{}
Response
Back To Top ↑200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "message": "Your message scheduling has been canceled" }