Shortcuts

You can use the API to get or set the Shortcuts information.

JSON Format

Shortcuts are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
agents array false false Agent the shortcut belongs to if scope is "agent". Currently only first element is taken into consideration
departments array false false Departments the shortcut belongs to if scope is "department"
id string true false Unique ID of the shortcut. Disallowed values: "/", "\", "$"
message string false false The message of the shortcut
name string false false The name of the shortcut. Disallowed values: "/", "\", "$"
options string false false Options for the shortcut
scope string false false Scope of the shortcut applicability. Allowed values are "all", "agent", or "department".
tags array false false List of tags that will be added to chat if the shortcut is used

Note that scope, departments and agents fields will only be considered for accounts with these features enabled.

For backward compatibility, name is equal to id. To future-proof your code, use id instead of name.

Example
{
  "id": "question",
  "message": "Hi! Do you need assistance?",
  "name": "question",
  "options": "Yes/No",
  "scope": "all",
  "tags": [
    "Question",
    "Survey"
  ]
}

List Shortcuts

  • GET /api/v2/shortcuts

Lists all shortcuts for the account.

Allowed for
  • Owner
  • Administrator
Using curl
curl https://www.zopim.com/api/v2/shortcuts \
  -v -u {email_address}:{password}
Example Response
Status 200 OK

[
  {
    "id": "question",
    "message": "Hi! Do you need assistance?",
    "name": "question",
    "options": "Yes/No",
    "scope": "all",
    "tags": [
      "Question",
      "Survey"
    ]
  },
  {
    "id": "sign up",
    "message": "When would you like to sign up?",
    "name": "sign up",
    "options": "Now/Later",
    "scope": "all",
    "tags": [
      "Question",
      "Signup"
    ]
  }
]

Create Shortcut

  • POST /api/v2/shortcuts

Adds a shortcut to the account.

Allowed for
  • Owner
  • Administrator
Using curl
curl https://www.zopim.com/api/v2/shortcuts \
  -d '{
        "name" : "intro",
        "message" : "Hi! Do you need assistance?",
        "options" : "Yes/No"
      }' \
  -v -u {email_address}:{password} \
  -X POST -H "Content-Type: application/json"
Example Response
Status 201 Created

{
  "id": "intro",
  "message": "Hi! Do you need assistance?",
  "name": "intro",
  "options": "Yes/No",
  "scope": "all",
  "tags": []
}

Show Shortcut

  • GET /api/v2/shortcuts/{shortcut_id}

Returns shortcut information by specifying the shortcut name.

Allowed for
  • Owner
  • Administrator
Parameters
Name Type In Required Description
shortcut_id integer Path true The ID of the shortcut
Using curl
curl https://www.zopim.com/api/v2/shortcuts/(shortcut_id) \
  -v -u {email_address}:{password}
Example Response
Status 200 OK

{
  "id": "intro",
  "message": "Hi! Do you need assistance?",
  "name": "intro",
  "options": "Yes/No",
  "scope": "all",
  "tags": [
    "Question",
    "Survey"
  ]
}

Update Shortcut

  • PUT /api/v2/shortcuts/{shortcut_id}

Updates a specified shortcut.

Allowed for
  • Owner
  • Administrator
Parameters
Name Type In Required Description
shortcut_id integer Path true The ID of the shortcut
Using curl
curl https://www.zopim.com/api/v2/shortcuts/{shortcut_id} \
  -d '{
        "message" : "Hi! Are you confused?",
        "options" : "Yes/No/Definitely Maybe",
        "tags" : ["Question"]
      }' \
  -v -u {email_address}:{password} \
  -X PUT -H "Content-Type: application/json"
Example Response
Status 200 OK

{
  "id": "intro",
  "message": "Hi! Are you confused?",
  "name": "intro",
  "options": "Yes/No/Definitely Maybe",
  "scope": "all",
  "tags": [
    "Question"
  ]
}

Delete Shortcut

  • DELETE /api/v2/shortcuts/{shortcut_id}

Deletes a specified shortcut.

Allowed for
  • Owner
  • Administrator
Parameters
Name Type In Required Description
shortcut_id integer Path true The ID of the shortcut
Using curl
curl https://www.zopim.com/api/v2/shortcuts/{shortcut_id} \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status 204 No Content