Creating Messages
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!"}
cURL
curl "http://localhost:3000/api/v1/messages/" -d '{"subject":"Marty we have to go","message":"BACK TO THE FUTURE!"}' -X POST \
-H "Accept: application/json" \
-H "X-Api-Token: Hgq2Bgik_zeEm7tyxb-pShxqxPi85vxKDw" \
-H "X-Api-Email: user-166@example.com" \
-H "Content-Type: application/json" \
-H "Host: school.worksonmy.computer"
Response
Headers
Status
201 Created
Body
{
"created_at": "2019-10-31T22:09:05Z",
"receipt_count": 0,
"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": [
],
"subject": "Marty we have to go",
"send_to_all": false,
"id": 12,
"sent_count": 0,
"meta": {
"class": "message",
"url": null,
"name": "12",
"description": "",
"image_url": null
},
"open_count": 0,
"click_count": 0,
"drop_count": 0,
"bounce_count": 0,
"deliver_count": 0
}