Add attachment to ticket

API Method: POST /api/tickets/message

Description:

This endpoint allows users to add a new message or comment to an existing support or service ticket in the banking application. By providing the ticketId and the text of the message, the user can update the ticket with additional information, questions, or responses, facilitating ongoing communication between the client and the support team.

Request:

  • HTTP Method: POST
  • Endpoint: /api/tickets/message
  • Authentication: Requires authentication (e.g., Bearer token or session ID) to ensure that only authorized users can add messages to their tickets.

Request Body Parameters:

  • ticketId (int32, required): The unique identifier of the ticket to which the message will be added.
  • text (string, required): The content of the message that the user wants to add to the ticket.
Example Request Body:
{
    "ticketId": "123456",
    "text": "Can you provide an update on the issue?"
}

Request Headers:

  • Authorization: Bearer <token> (required) — The token used to authenticate the request.
  • Content-Type: application/json — The content type of the request body must be in JSON format.

Response:

  • Status Code: 200 OK — On success, the API confirms that the message has been added to the specified ticket.
  • Content-Type: application/json
Example Response:
{
    "success": true,
    "message": "Message added to ticket successfully.",
    "ticketId": "123456",
    "commentId": "987654",               // Unique identifier of the new comment/message
    "createdDate": "2023-09-25T12:00:00Z" // Timestamp when the message was added
}

Response Fields:

  • success (boolean): Indicates whether the message was successfully added.
  • message (string): A confirmation message.
  • ticketId (string): The unique identifier of the ticket to which the message was added.
  • commentId (string): The unique identifier of the newly created comment or message.
  • createdDate (string): The date and time when the message was added to the ticket.

Possible Errors:

  • 400 Bad Request: The request is missing required fields (ticketId or text) or contains invalid data.
  • 401 Unauthorized: The request was made without proper authentication or with an invalid token.
  • 403 Forbidden: The user does not have permission to add a message to the specified ticket.
  • 404 Not Found: The specified ticketId does not exist or is invalid.
  • 500 Internal Server Error: An error occurred on the server while processing the request.

Example Usage:

curl -X POST  /api/tickets/message \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
    "ticketId": "123456",
    "text": "Can you provide an update on the issue?"
}'

This request adds a message to the ticket with ID 123456, allowing for additional information to be shared with the support team or tracking further developments related to the issue.

Language
Credentials
Bearer
JWT
Click Try It! to start a request and see the response here!