Get User Canned Responses
Get a list of all canned responses in the workspace that belong to the current user scope. It is helpful for omnichannel agents to see all private canned responses that belong to them, canned responses in their departments, and all public canned responses. It supports the Pagination parameters.
URL | Requires Auth | HTTP Method |
---|---|---|
/api/v1/canned-responses.get | yes | GET |
Argument | Example | Required | Description |
---|---|---|---|
X-User-Id | myuser-name | Required | The authenticated user ID. |
X-Auth-Token | myauth-token | Required | Auth token. |
curl --location 'http://localhost:3000/api/v1/canned-responses.get' \
--header 'x-auth-token: heWTP8sY_9EPrmVHclUKT31tttCSpbLzE4JrOYR3qpD' \
--header 'x-user-id: GonjPyg3gB3Z9ur9s'
{
"responses": [
{
"_id": "6470086ba8c3a3ba32d0fb1b",
"shortcut": "department-checking",
"text": "This is check test for departmental canned response",
"scope": "global",
"departmentId": "64181a0728384134ed600dcc",
"createdBy": {
"_id": "2tTEqR7ZNMJ4HGGNa",
"username": "testroxie"
},
"_createdAt": "2023-05-26T01:16:27.848Z",
"_updatedAt": "2023-05-26T01:16:27.848Z"
},
{
"_id": "647009e1a8c3a3ba32d0fb1f",
"shortcut": "admin-checking",
"text": "This is check test for departmental canned response",
"scope": "department",
"departmentId": "64181a0728384134ed600dcc",
"createdBy": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "funke.olasupo"
},
"_createdAt": "2023-05-26T01:22:41.104Z",
"_updatedAt": "2023-05-26T01:22:41.104Z"
},
{
"_id": "647009fba8c3a3ba32d0fb21",
"shortcut": "admin-checking3",
"text": "This is check test for departmental canned response",
"scope": "global",
"departmentId": "64181a0728384134ed600dcc",
"createdBy": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "funke.olasupo"
},
"_createdAt": "2023-05-26T01:23:07.374Z",
"_updatedAt": "2023-05-26T01:23:07.374Z"
}
],
"success": true
}
Any of the following errors can occur on the endpoint.
- Authorization: Requires an authentication token for the request to be made.
- No Permission: Occurs when the authenticated user doesn't have the
view-canned-responses
permission.
Authorization
No Permission
{
"status": "error",
"message": "You must be logged in to do this."
}
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
Version | Description |
---|---|
1.0.0 | Added |
Last modified 2mo ago