Shortcuts

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

JSON Format

Shortcuts are represented as JSON objects with the following attributes:

Name Type Read-only Description
name string no The name of the shortcut
scope string no Scope of the shortcut applicability. Allowed values: all, agent, department
agents array no Agent the shortcut belongs to if the scope is agent. Currently only first element is taken into consideration.
departments array no Departments the shortcut belongs to if the scope is department
options integer no Options for the shortcut
message string no The message of the shortcut
tags array no 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.

Get All Shortcuts

GET /api/v2/shortcuts

Fetches all the shortcuts for your account.

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/shortcuts \
  -v -u {email_address}:{password}
Example Response
HTTP/1.1 200 OK
Content-Type: application/json

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

Get Shortcut

GET /api/v2/shortcuts/{shortcut_name}

Fetches the specified shortcut.

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/shortcuts/{shortcut_name} \
  -v -u {email_address}:{password}
Example Response
HTTP/1.1 200 OK
Content-Type: application/json

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

Create Shortcut

POST /api/v2/shortcuts

Allows an account owner/administrator to add 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
HTTP/1.1 201 Created
Content-Type: application/json

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

Update Shortcut

PUT /api/v2/shortcuts/{shortcut_name}

Lets an agent update a shortcut.

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/shortcuts/{shortcut_name} \
  -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
HTTP/1.1 200 OK
Content-Type: application/json

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

Delete Shortcut

DELETE /api/v2/shortcuts/{shortcut_name}

Allowed for
  • Owner
  • Administrator
Using cURL
curl https://www.zopim.com/api/v2/shortcuts/{shortcut_name} \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status: 204 No Content