Comment on Quote
This PUT API allows you to add or update a comment on an existing quote. This can be useful for documenting changes or providing additional context during a business transaction.
Endpoint Details
- URL:
/quote/comment/{quote_id} - Method:
PUT - Authentication: Bearer Token (required)
Path Parameters
| Parameter | Type | Description |
|---|---|---|
quote_id | string | The unique identifier of the quote to comment on. |
Authentication
You must provide a valid accessToken in the request headers to authenticate and access this endpoint.
Authentication Headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | Must be set to application/json. |
accessToken | string | A valid access token is required. |
Request Body
The request body should be in JSON format and must include the details for the comment:
| Field | Type | Description |
|---|---|---|
company | string | The unique identifier of the company associated with the quote. |
customer | string | The unique identifier of the customer related to the quote. |
comment | string | The text content of the comment to be added or updated. |
commentId | string | The unique identifier of the comment to be updated (if applicable). |
Sample Request Body
{
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"comment": "Agreed terms after discussion.",
"commentId": "66fb9ddfac1453f825712ca3"
}
Response
Success Response
| Status Code | Description |
|---|---|
| 200 OK | The request was successful, and the comment was added or updated. |
Success Response Body Structure
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the request was successful. |
message | string | Message indicating the result of the operation. |
data | object | Contains the updated details of the quote, including comments. |
Sample Response Body
{
"success": true,
"message": "Quote updated Successfully",
"data": {
"id": "7323abc1648b4f3a8dfd7e23",
"company": "65ba028af764f931f1c7c18b",
"customer": "66d07121db294e0b70180bf6",
"comments": [
{
"commentId": "66fb9ddfac1453f825712ca3",
"text": "Agreed terms after discussion.",
"createdAt": "2024-01-10T12:00:00Z",
"updatedAt": "2024-01-15T14:00:00Z"
}
]
}
}
Error Responses
| Status Code | Description |
|---|---|
| 400 Bad Request | Invalid request format or missing data. |
| 401 Unauthorized | Invalid or missing access token. |
| 403 Forbidden | Access denied. |
| 404 Not Found | Quote or comment not found. |
| 500 Internal Server Error | Server encountered an error. |
Notes
- Ensure that the
quote_idin the URL corresponds to the actual ID of the quote you wish to comment on. - Include all necessary fields in the request body to avoid validation errors.
- A valid access token is necessary for authentication to successfully add or update the comment on the quote.