Send Helper Version 2
This document describes the OSDI send helper endpoint as implemented by the Action Network.
The send helper allows you to send a message to the targeted list. It takes no fields or other arguments. POSTing an empty JSON object will send the email, and DELETEing an empty JSON object will stop the email from sending mid-send, assuming it has not all been sent already.
Sections:
- Endpoint
- Field names and descriptions
- Related resources
- Scenario: Send a message (POST)
- Scenario: Stop a message mid-send (DELETE)
Endpoint
Endpoint:
https://actionnetwork.org/api/v2/messages/[message_id]/send
The send helper lives at the endpoint relating to the specific message you want to send.
Back To Top ↑Field names and descriptions
Send Helper fields:
The send helper has no fields.
Back To Top ↑Related resources
Back To Top ↑Scenario: Send a message (POST)
If you POST with a blank JSON object, you will send the message to the targeted list, assuming the message can be sent:
Request
POST https://actionnetwork.org/api/v2/messages/9f837109-710d-442f-8a99-857a21f36d25/send/ Header: Content-Type: application/json OSDI-API-Token: your_api_key_here
{}
Response
200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "message": "Your email has been sent." }
Messages can only be sent if they contain all of the required fields (subject
, body
, from
, and reply_to
), are in 'draft' status, and have a total_targeted
count greater than 0.
Scenario: Stop a message mid-send (DELETE)
If you DELETE with a blank JSON object, you will stop a message from sending if it is in the process of sending:
Request
DELETE https://actionnetwork.org/api/v2/messages/9f837109-710d-442f-8a99-857a21f36d25/send/ Header: Content-Type: application/json OSDI-API-Token: your_api_key_here
{}
Response
200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "message": "Your email has been stopped. You can exclude this email in future targeting to exclude activists who received email from this partial send." }
DELETE will only stop a send that has not finished sending already.
Back To Top ↑