Get a list of all canned responses in the workspace. It is helpful for omnichannel managers to get all canned responses in the workspace, including private and departmental canned responses.
HTTP Method | URL | Requires Auth |
---|---|---|
GET | /api/v1/canned-responses | yes |
{% hint style="info" %} Permissions required:
view-canned-responses
view-all-canned-responses
{% endhint %}
This endpoint supports the optional#pagination parameters and the fields
parameter from the#query-and-fields parameters. Additional optional parameters are as follows:
Key | Example Value | Description |
---|---|---|
shortcut | card-declined | The shortcut to trigger the message snippet. |
text | reasons for your card malfunction | The message snippet. |
scope | global | The scope of the canned response. It can either be global , user or department . |
tags | card | The tags for your canned response. |
departmentId | 64181a0728384134ed600dcc | The departmentId where the canned response belongs to. It is required if the scope is department . |
createdBy | Ccjofofjikwcno | The user ID who created the canned responses. |
curl --location 'http://localhost:3000/api/v1/canned-responses' \
--header 'x-auth-token: Ja29cTtF-wkmIBCBysrknSoYf' \
--header 'x-user-id: rbAXPnMktTFbNpwtJ'
{
"cannedResponses": [
{
"_id": "646c747ca8c3a3ba32d0e2e8",
"shortcut": "Denied",
"text": "This is an example",
"scope": "global",
"createdBy": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "kim.jane"
},
"_createdAt": "2023-05-23T08:08:28.241Z",
"_updatedAt": "2023-05-23T08:08:28.241Z"
},
{
"_id": "646c6ed9a8c3a3ba32d0e2db",
"shortcut": "my-new-canned",
"text": "This is an example",
"scope": "global",
"tags": [
"failed",
"card"
],
"createdBy": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "doe.john"
},
"_createdAt": "2023-05-23T07:44:25.912Z",
"_updatedAt": "2023-05-23T07:44:25.912Z"
},
{
"_id": "646c7350a8c3a3ba32d0e2e0",
"shortcut": "my-new-canned-",
"text": "This is an example",
"scope": "hi",
"tags": [
"failed",
"card"
],
"createdBy": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "jane.mary"
},
"_createdAt": "2023-05-23T08:03:28.148Z",
"_updatedAt": "2023-05-23T08:03:28.148Z"
}
],
"count": 3,
"offset": 0,
"total": 3,
"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
andview-all-canned-responses
permission.
{% tabs %} {% tab title="Authorization" %}
{
"status": "error",
"message": "You must be logged in to do this."
}
{% endtab %}
{% tab title="No Permission" %}
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
{% endtab %} {% endtabs %}
Version | Description |
---|---|
1.0.0 | Added |