sends to all users
POST /api/v1/messages/
Parameters
| Name |
Description |
|
subject
|
subject
|
|
message
|
message
|
|
recipient_ids
|
array of user ids to deliver the message to
|
|
recipient_filters
|
hash of user filters to search users to deliveries the message to
|
|
course_id
|
id of a course to determine which users receive the message
|
|
disable_html_template
|
html or text email
|
|
send_to_all
|
boolean of whether or not you should send to everybody
|
Request
Headers
Route
POST /api/v1/messages/
Body
{"subject":"Marty we have to go","message":"BACK TO THE FUTURE!","recipient_ids":[1254,1255],"send_to_all":true}
cURL
curl "http://localhost:3000/api/v1/messages/" -d '{"subject":"Marty we have to go","message":"BACK TO THE FUTURE!","recipient_ids":[1254,1255],"send_to_all":true}' -X POST \
-H "Accept: application/json" \
-H "X-Api-Token: 5VSpEk_43qMDy7s7a4xmJpmd51hDdp5W2A" \
-H "X-Api-Email: user-150@example.com" \
-H "Content-Type: application/json" \
-H "Host: school.worksonmy.computer"
Response
Headers
Status
201 Created
Body
{
"created_at": "2019-10-31T22:08:50Z",
"receipt_count": 2,
"drop_rate": 0,
"open_rate": 0,
"click_rate": 0,
"deliver_rate": 0,
"bounce_rate": 0,
"message": "BACK TO THE FUTURE!",
"email_unsubscribed_students": false,
"failed_recipient_ids": null,
"recipient_ids": [
1254,
1255
],
"subject": "Marty we have to go",
"send_to_all": true,
"id": 7,
"sent_count": 0,
"meta": {
"class": "message",
"url": null,
"name": "7",
"description": "",
"image_url": null
},
"open_count": 0,
"click_count": 0,
"drop_count": 0,
"bounce_count": 0,
"deliver_count": 0
}