Custom Variable
  • 16 Jun 2022
  • 2 Minutes to read
  • Dark
    Light

Custom Variable

  • Dark
    Light

Article summary

Custom Variable

You need the Manage Custom Variables to manage Custom Variables.

Custom Variable JSON Format

Custom Variable is represented as simple flat JSON objects with the following keys:

NameTypeDescription
idguidId of the custom variable.
namestringName of the custom variable.
valuestringValue of the custom variable.
hyperlinkstringHyperlink of the custom variable.
typestringAllowed 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:

Custom Variable

  • 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:

NameTypeinRequiredDescription
namestringbodyyesName of the custom variable.
valuestringbodynoValue of the custom variable.
hyperlinkstringbodynoHyperlink of the custom variable.
typestringbodyyesAllowed values are "text", "integer", "decimal".
  • Response:

Custom Variable

  • 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:

NameTypeinRequiredDescription
namestringbodyyesName of the custom variable.
valuestringbodynoValue of the custom variable.
hyperlinkstringbodynoHyperlink of the custom variable.
typestringbodyyesAllowed values are "text", "integer", "decimal".
  • Response:

Custom Variable

  • 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?