Create a messsage

POST /messages

Required scopes: create_messages

Input

content_type Required string The type of a message content. Valid options:

  • note
content Required object The content JSON.
For type note:

text Required string The text of the note.
attachments Optional object Attachments included with the note.
recipients Required recipients object The recipients of the message
post_at Optional datetime string If provided, the message will be posted at the given time. If not provided, the message is posted immediately.
moderated Optional boolean If provided, the message created will be put into the moderated queue before being posted

Example Request

POST /messages
{
"content_type": "note",
"content": {
"text": "This is my note",
"attachments": {
"links": [{"title": "A web page", "link_url": "https://google.com"}]
}
},
"recipients": {
"users": [{"id": 1}],
"groups": [{"id": 2}],
"parent_groups": [{"id": 2}]
},
"moderated": "true"
}

Example Response

201 Created
Location: https://api.edmodo.com/messages/1
{
"id": 23,
"url": "https://api.edmodo.com/messages/23",
"content_type": "note",
"content": {
"id": 23,
"url": "https://api.edmodo.com/messages/23",
"text": "This is my note",
"attachments": {
"links": [{"title": "A web page", "link_url": "https://google.com"}]
}
},
"creator": {
"id": 400,
"url": "https://api.edmodo.com/users/400",
"first_name": "Nic",
"last_name": "Borg",
"username": "nic",
"avatars": {...}
},
"recipients": {
"users": [
{
"id": 1,
"url": "https://api.edmodo.com/users/1"
"name": "Nic Borg"
"avatars": {...}
}
],
"groups": [
{
"id": 2,
"url": "https://api.edmodo.com/groups/2"
"name": "My Group"
}
]
}
"replies_url": https://api.edmodo.com/replies?message_id=23
"last_replies": [],
"created_at": "2013-03-04"
}