Message Replies

Create a Message Reply

POST /messages/{message_id}/messageReplies.json

This will create a new message. Also, you have the option of sending a notification to a list of people you select.people.

Request

{
  "messagereply": {
    "body": "Reply Body",
    "notify": []
  }
}

Response

HTTP status code 201 (“Created”) on success. The Location header will then be set to the “Get message” URL for your new message. using that URL, you can get the new message ID.

If unsuccessful, a non-200 status code will be returned, possibly with error information in json format.


Retrieve a Single Message Reply

GET /messageReplies/{id}.json

Uses the given messsage ID to retrieve a message

Response

{
    "messageReplies": [
        {
            "attachments_count": "0",
            "author-lastname": "User",
            "attachments-count": "0",
            "emailed-from": "",
            "author-avatar-url": "https://s3.amazonaws.com/TWFiles/2/users/999.avatar",
            "author_id": "999",
            "posted-on": "2014-04-01T10:04:26Z",
            "body": "Reply Body",
            "attachments": [],
            "author-firstname": "Demo",
            "id": "999",
            "last-changed-on": "2014-04-01T10:04:26Z",
            "author-id": "999",
            "messageId": "999"
        }
    ],
    "STATUS": "OK"
}


Retrieve Replies to a Message

GET /messages/{id}/replies.json

Uses the given messsage ID to retrieve a all replies to a message specified in the url.

By default 20 records are returned at a time. You can pass "page" and "pageSize" to change this:

eg. GET /messages/54/replies.json?page=2&pageSize=50.

The following headers are returned:

  • X-Records - The total number of replies
  • X-Pages - The total number of pages
  • X-Page - The page you requested

Response

{
    "messageReplies": [
        {
            "attachments_count": "0",
            "author-lastname": "User",
            "numNotified": "0",
            "isRead": "1",
            "datetime": "2014-04-01T10:04:26Z",
            "author-avatar-url": "https://s3.amazonaws.com/TWFiles/2/users/999.avatar",
            "author_id": "999",
            "id": "999",
            "content-type": "TEXT",
            "last-changed-on": "2014-04-01T10:04:26Z",
            "isOriginal": "0",
            "user-display-posted-date": "Tue, 01 Apr 2014",
            "user-display-posted-time": "10:04AM",
            "message-status": "active",
            "attachments-count": "0",
            "_author_id": {
                "deprecated": true
            },
            "posted-on": "2014-04-01T10:04:26Z",
            "body": "Reply Body",
            "author-firstname": "Demo",
            "attachments": [],
            "author-id": "999",
            "post-status": "active",
            "display-body": "Reply Body",
            "messageId": "999",
            "replyNo": "0"
        }
    ],
    "STATUS": "OK"
}


 

Update Message Reply

PUT /messageReplies/{id}.json

Updates an existing message body only.

Request

{
  "messagereply": {
    "body": "Message Reply Body"
  }
}

Response

Returns HTTP status code 200 on success, or any other code on error.


Destroy Message Reply

DELETE /messageReplies/{id}.json

Deletes the message including all comments etc

Response

Returns HTTP status code 200 on success.


Mark Message Reply Read

PUT /messageReplies/{id}/markread.json

Marks a specific message reply as read by the current authenticated user

Response

Returns HTTP status code 200 on success.