api Convo {convoId} Message {messageId} - nonduality345/Convos GitHub Wiki
/api/Convo/{convoId}/Message/{messageId}
Note, {convoId} is a valid natural number (long) representing the Id of the Convo and {messageId} is a valid natural number (long) representing the Id of the Message.
-
DELETE
When performing the DELETE method on this endpoint, the application deletes the specific Message from the system.
-
Request
-
Custom Headers
- X-Authorization: {userId} Required
-
Body
None
-
-
Response
-
Custom Headers
-
X-Message
In the case of 4xx responses from the API where the custom result code is > 0, this header will hold a message describing the client based error that occurred.
-
X-Result-Code:
This header holds the custom result code of the operation. A successful response will return 6 (DELETED) to the client. Details of results codes can be found here.
-
-
Body
None
-
Status
A 204 (No Content) status code is sent for successful requests. Requests with bad client information will return a 4xx level error and if there are problems with the server, a 5xx level status code is sent.
-
-
-
GET
When performing the GET method on this endpoint, the application returns the specific Message object with the supplied message Id.
-
Request
-
Custom Headers
- X-Authorization: {userId} Required
-
Body
None
-
-
Response
-
Custom Headers
-
X-Last-Modified
This header holds the date and time at which the Message was last modified.
-
X-Message
In the case of 4xx responses from the API where the custom result code is > 0, this header will hold a message describing the client based error that occurred.
-
X-Result-Code:
This header holds the custom result code of the operation. A successful response will return 0 (OK) to the client. Details of results codes can be found here.
-
-
Body
The specific Message object that was requested is returned along with the thread of replies that it follows.
-
Status
A 200 (OK) status code is sent for successful requests. Requests with bad client information will return a 4xx level error and if there are problems with the server, a 5xx level status code is sent. If the Message with an Id of {messageId} does not belong to the Convo with the Id of {convoId}, the request will result in a 404 (Not Found).
-
-
-
PATCH
When performing a PATCH operation on this endpoint, the specific Message object will be partially updated with the supplied information.
-
Request
-
Custom Headers
- X-Authorization: {userId} Required
-
Body
{ "Body":"Body of the message", "IsRead":true }
The body of a patch request is an object with two fields. The "Body" field contains the new value for the body for the specific Message. There is a maximum character limit of 64,000 characters on this field. The "IsRead" field contains a boolean value to indicate whether or not the Message was read. At least one of the fields is required for the request to succeed. If a field is not supplied, it will not be updated. The "Parent" field is explicitly disallowed from being updated to avoid cycles among Messages.
-
-
Response
-
Custom Headers
-
X-Message
In the case of 4xx responses from the API where the custom result code is > 0, this header will hold a message describing the client based error that occurred.
-
X-Result-Code:
This header holds the custom result code of the operation. A successful response will return 0 (OK) to the client. Details of results codes can be found here.
-
-
Body
None
-
Status
A 200 (OK) status code is sent for successful requests. Requests with bad client information will return a 4xx level error and if there are problems with the server, a 5xx level status code is sent. If the Message with an Id of {messageId} does not belong to the Convo with the Id of {convoId}, the request will result in a 404 (Not Found).
-
-
-
POST
When performing a POST operation on this endpoint, a new Message will be created in the system as a reply to the specified Message.
-
Request
-
Custom Headers
- X-Authorization: {userId} Required
-
Body
{ "Body":"This is the body of the message", "Recipient":9999 }
The body of a post request is an object with two fields. The "Recipient" field is the user Id of the person who is receiving the Message. The user must be a participant within the Convo. The "Body" field contains the body of the Message. There is a maximum character limit of 64,000 characters on this field. The parent of the newly created message will be the {messageId} specified in the endpoint.
-
-
Response
-
Custom Headers
-
X-Message
In the case of 4xx responses from the API where the custom result code is > 0, this header will hold a message describing the client based error that occurred.
-
X-Result-Code:
This header holds the custom result code of the operation. A successful response will return 5 (CREATED) to the client. Details of results codes can be found here.
-
X-URI-Reference:
This header holds the URI to the newly created resource.
-
-
Body
None
-
Status
A 201 (Created) status code is sent for successful requests. Requests with bad client information will return a 4xx level error and if there are problems with the server, a 5xx level status code is sent.
-
-