Triggers
You can use the API to get or set the Trigger information.
JSON Format
Triggers are represented as JSON objects with the following properties:
Name | Type | Read-only | Mandatory | Description |
---|---|---|---|---|
description | string | false | false | The description of the trigger |
enabled | integer | false | false | Whether the trigger is enabled or not |
id | integer | true | false | The ID of the trigger |
name | string | false | false | The name of the trigger |
Example
{
"description": "Visitor entered page",
"enabled": 1,
"id": 4,
"name": "Good Trigger"
}
List Triggers
GET /api/v2/triggers
Lists triggers for an account.
Allowed for
- Administrator
Using curl
curl https://www.zopim.com/api/v2/triggers \
-v -u {email_address}:{password}
Example Response
Status 200 OK
[
{
"description": "Visitor entered page",
"enabled": 1,
"id": 4,
"name": "Good Trigger"
},
{
"description": "Visitor requested chat",
"enabled": 1,
"id": 5,
"name": "Better Trigger"
}
]
Show Trigger
GET /api/v2/triggers/{trigger_name}
Returns trigger information by specifying its name.
Allowed for
- Administrator
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
trigger_name | string | Path | true | The name of the trigger |
Using curl
curl https://www.zopim.com/api/v2/triggers/{trigger_name} \
-v -u {email_address}:{password}
Example Response
Status 200 OK
{
"description": "Visitor entered page",
"enabled": 1,
"id": 4,
"name": "Good Trigger"
}
Create Trigger
POST /api/v2/triggers
Adds a trigger to an account.
Allowed for
- Administrator
Using curl
curl https://www.zopim.com/api/v2/triggers \
-d '{
"name" : "Good Trigger",
"enabled" : 1,
"description" : "Visitor requested chat"
}' \
-v -u {email_address}:{password} \
-X POST -H "Content-Type: application/json"
Example Response
Status 201 Created
{
"description": "Visitor requested chat",
"enabled": 1,
"id": 4,
"name": "Good Trigger"
}
Update Trigger
PUT /api/v2/triggers/{trigger_name}
Updates the data of a trigger.
Allowed for
- Administrator
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
trigger_name | string | Path | true | The name of the trigger |
Using curl
curl https://www.zopim.com/api/v2/triggers/{trigger_name} \
-d '{
"name" : "Best Trigger",
"description" : "Visitor requested new chat"
}' \
-v -u {email_address}:{password} \
-X PUT -H "Content-Type: application/json"
Example Response
Status 200 OK
{
"description": "Visitor requested new chat",
"enabled": 1,
"id": 4,
"name": "Best Trigger"
}
Delete Trigger
DELETE /api/v2/triggers/{trigger_name}
Deletes a trigger.
Allowed for
- Administrator
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
trigger_name | string | Path | true | The name of the trigger |
Using curl
curl https://www.zopim.com/api/v2/triggers/{trigger_name} \
-v -u {email_address}:{password} -X DELETE
Example Response
Status 204 No Content