Custom Variable
- 16 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Custom Variable
- Updated on 16 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Custom Variable
You need the Manage Custom Variables to manage Custom Variables.
Custom Variables
- Custom Variables ManageGET livechat/customVariables
- Get the list of Custom VariablesGET livechat/customVariables/{id}
- Get a single Custom VariablePOST livechat/customVariables
- Create a new Custom VariablePUT livechat/customVariables/{id}
- Update the Custom VariableDELETE livechat/customVariables/{id}
- Remove the Custom Variable
Custom Variable JSON Format
Custom Variable is represented as simple flat JSON objects with the following keys:
Name | Type | Description |
---|---|---|
id | guid | Id of the custom variable. |
name | string | Name of the custom variable. |
value | string | Value of the custom variable. |
hyperlink | string | Hyperlink of the custom variable. |
type | string | Allowed values are "text", "integer", "decimal". |
Get the list of Custom Variables
GET livechat/customVariables
Parameters:
No Parameters
Response:
An array of Custom Variable
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/customVariables \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
[
{
"id": "6BB15329-7C46-EB11-8100-00155D081D0B",
"name": "c_v_name",
"value": "c_v_value",
"hyperlink": "{!Visitor.IP}",
"type": "text"
}
]
Get a single Custom Variable
GET livechat/customVariables/{id}
Parameters:
No Parameters
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/customVariables/6BB15329-7C46-EB11-8100-00155D081D0B \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"id": "6BB15329-7C46-EB11-8100-00155D081D0B",
"name": "c_v_name",
"value": "c_v_value",
"hyperlink": "{!Visitor.IP}",
"type": "text"
}
Create a new Custom Variable
POST livechat/customVariables
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
name | string | body | yes | Name of the custom variable. |
value | string | body | no | Value of the custom variable. |
hyperlink | string | body | no | Hyperlink of the custom variable. |
type | string | body | yes | Allowed values are "text", "integer", "decimal". |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/customVariables \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"name":"c_v_name","value":"c_v_value","hyperlink":"{!Visitor.IP}","type":"text"}'
Response:
HTTP/1.1 201 Created
{
"id": "6BB15329-7C46-EB11-8100-00155D081D0B",
"name": "c_v_name",
"value": "c_v_value",
"hyperlink": "{!Visitor.IP}",
"type": "text"
}
Update the Custom Variable
PUT livechat/customVariables/{id}
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
name | string | body | yes | Name of the custom variable. |
value | string | body | no | Value of the custom variable. |
hyperlink | string | body | no | Hyperlink of the custom variable. |
type | string | body | yes | Allowed values are "text", "integer", "decimal". |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/customVariables/6BB15329-7C46-EB11-8100-00155D081D0B \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"name":"c_v_name","value":"c_v_value","hyperlink":"{!Visitor.IP}","type":"text"}'
Response:
HTTP/1.1 200 OK
{
"id": "6BB15329-7C46-EB11-8100-00155D081D0B",
"name": "c_v_name",
"value": "c_v_value",
"hyperlink": "{!Visitor.IP}",
"type": "text"
}
Remove the Custom Variable
DELETE livechat/customVariables/{id}
Parameters:
No Parameters
Response:
No Content
Example
Sample Request:
curl https://api11.comm100.io/v4/livechat/customVariables/6BB15329-7C46-EB11-8100-00155D081D0B \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 204 No Content
Was this article helpful?