LiveZilla Live Chat
1-Click Demo
EN  DE Bitte einloggen oder anmelden Hallo


LiveZilla API V2





Chat
Chat Object Format
Chat is represented as JSON objects having the following keys:

JSON Key Type Required Read only Comment Example
UserIdstringYesNoUnique identifier of the user, max 32 charsd9729feb63a1a010
ChatIdstringNoYesThe chat ID11123
FullnamestringNoNoUser full nameJohn Doe
EmailstringNoNoUser emailjohn@doe.com
CompanystringNoNoUser companyDoe Ltd.
PhonestringNoNoUser phone004977311894432
CustomsstringNoNoCustom input field values

array<index,array<input_name, input_value>>
GroupstringYesNoChat target group idsupport
OperatorstringNoNoChat target operator idfc6a5761d39598c
CountrystringNoNoISO two letter county codeES
LanguagestringNoNoISO two letter language codeDE
IdentifierstringNoNoCustom indentifier textThis is an API chat
IPstringNoNoUser IP111.111.111.111
WebhookstringYesNoWebhook URL to receive operator messageshttp://website.com/hook.php


Chat Functions


Create Chat Session
Function
As of version 8.0.0.0


POST /api/v2/api.php p_chat_create=1


Filters


Name POST Key Type Required Comment Example


CURL Example


curl {yourdomain}{livezilla_folder}/api/v2/api.php
-d {authenthication}
-d p_chat_create=1
-d p_data={ "Chat": { "UserId": "d9729feb63a1a010", "Fullname": "John Doe", "Email": "john@doe.com", "Company": "Doe Ltd.", "Phone": "004977311894432", "Customs": "", "Group": "support", "Operator": "fc6a5761d39598c", "Country": "ES", "Language": "DE", "Identifier": "This is an API chat", "IP": "111.111.111.111", "Webhook": "http:\/\/website.com\/hook.php" } } -X POST

Response


200 Ok: {
    "Chat": {
        "ChatId": 12212,
        "UserId": "d9729feb63a1a010",
        "Fullname": "John Doe",
        "Email": "john@doe.com",
        "Company": "Doe Ltd.",
        "Phone": "004977311894432",
        "Customs": "",
        "Group": "support",
        "Operator": "fc6a5761d39598c",
        "Country": "ES",
        "Language": "DE",
        "Identifier": "This is an API chat",
        "IP": "111.111.111.111",
        "Webhook": "http:\/\/website.com\/hook.php"
    }
}

Error Codes


                            403 Forbidden: Invalid or no user authentication data sent (see General API Authentication)
400 Bad Data: Invalid or missing POST parameters (see required fields/filters and data types)
                        



Add Chat Message
Function
As of version 8.0.0.0


POST /api/v2/api.php p_chat_add_message=1


Filters


Name POST Key Type Required Comment Example


CURL Example


curl {yourdomain}{livezilla_folder}/api/v2/api.php
-d {authenthication}
-d p_chat_add_message=1
-d p_data={
"Message": {
"ChatId": "12212",
"Text": "Hi, I have a question"
}
} -X POST

Response


200 Ok: {
    "Message": {
        "ChatId": 12212,
        "Text": "Hi, I have a question"
    }
}

Error Codes


                            403 Forbidden: Invalid or no user authentication data sent (see General API Authentication)
400 Bad Data: Invalid or missing POST parameters (see required fields/filters and data types)
                        





Something missing?


If you find anything missing please let us know and we will add the missing structures right away. Thanks.