NAV Navbar
HTTP Node.JS Python Ruby
  • Chaport API v1.0.0
  • Authentication
  • Operators API
  • Visitors API
  • Chats API
  • Hooks API
  • Events
  • Schemas
  • Javascript API
  • Chaport API v1.0.0

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    Welcome to Chaport API v1! You can find descriptions for all API endpoints and events (a.k.a. webhooks) here.

    Base URLs:

    Email: API Help

    Authentication

    All API calls expect you to send a bearer token in Authentication HTTP header. For now to receive a token please contact us at [email protected], later we are planning to allow bearer token retrieval from within our app. You can test your bearer token by sending a GET request to /me.json endpoint.

    Operators API

    Operators API provides access to your team members.

    List Operators

    Code samples

    GET https://app.chaport.com/api/v1/operators HTTP/1.1
    Host: app.chaport.com
    
    Accept: application/json
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/operators',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://app.chaport.com/api/v1/operators', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://app.chaport.com/api/v1/operators',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /operators

    Retrieves list of existing operators.

    Example responses

    {
      "result": [
        {
          "id": "59747c3ff77948220136b7b3",
          "email": "[email protected]",
          "name": "Jon Snow",
          "jobTitle": "The Wall supervisor",
          "role": "admin",
          "lastLoginAt": "2017-10-03T10:47:31.873Z",
          "image": "https://app.chaport.com/uploads/operator-images/123123ad-9c59-4859-a062-20d818b2c582.jpg",
          "acceptOfflineMessages": true,
          "lastStatus": "online"
        }
      ]
    }
    

    Responses

    Status Meaning Description
    200 OK successful request
    500 Internal Server Error server was unable to process the request due to internal error

    Response Schema

    Status Code 200

    Name Type Required Description
    result [Operator] false No description
    » id string true Operator ID.
    » email string(email) false Email address of the operator.
    » name string false Name of the operator.
    » jobTitle string false Job title of the operator.
    » role string in ['admin', 'operator'] false 'operator' - generic operator role, 'admin' - operator with advanced administrative permissions.
    » lastLoginAt string(date-time) false Time of last login.
    » image string false Image (avatar) of the operator.
    » acceptOfflineMessages boolean false A flag defining whether this operator should be receiving messages when everyone is offline.
    » lastStatus string in ['online', 'invisible', 'offline'] false Status of the operator when they were last seen. This status will be restored next time the operator logs in to the app.

    Retrieve an Operator

    Code samples

    GET https://app.chaport.com/api/v1/operators/{operatorId} HTTP/1.1
    Host: app.chaport.com
    
    Accept: application/json
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/operators/{operatorId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://app.chaport.com/api/v1/operators/{operatorId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://app.chaport.com/api/v1/operators/{operatorId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /operators/{operatorId}

    Retrieves a single operator by id.

    Parameters

    Parameter In Type Required Description
    operatorId path string true ID of an operator to retrieve.

    Example responses

    {
      "result": {
        "id": "59747c3ff77948220136b7b3",
        "email": "[email protected]",
        "name": "Jon Snow",
        "jobTitle": "The Wall supervisor",
        "role": "admin",
        "lastLoginAt": "2017-10-03T10:47:31.873Z",
        "image": "https://app.chaport.com/uploads/operator-images/123123ad-9c59-4859-a062-20d818b2c582.jpg",
        "acceptOfflineMessages": true,
        "lastStatus": "online"
      }
    }
    

    Responses

    Status Meaning Description
    200 OK successful request
    400 Bad Request invalid or missing parameters in the request, more details in the response body
    404 Not Found requested entity has not been found
    500 Internal Server Error server was unable to process the request due to internal error

    Response Schema

    Status Code 200

    Name Type Required Description
    result Operator true No description
    » id string true Operator ID.
    » email string(email) false Email address of the operator.
    » name string false Name of the operator.
    » jobTitle string false Job title of the operator.
    » role string in ['admin', 'operator'] false 'operator' - generic operator role, 'admin' - operator with advanced administrative permissions.
    » lastLoginAt string(date-time) false Time of last login.
    » image string false Image (avatar) of the operator.
    » acceptOfflineMessages boolean false A flag defining whether this operator should be receiving messages when everyone is offline.
    » lastStatus string in ['online', 'invisible', 'offline'] false Status of the operator when they were last seen. This status will be restored next time the operator logs in to the app.

    Visitors API

    Visitors API provides access to the data of your site visitors you conversed with.

    List Visitors

    Code samples

    GET https://app.chaport.com/api/v1/visitors?page=59747c3ff77948220136b7b3 HTTP/1.1
    Host: app.chaport.com
    
    Accept: application/json
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/visitors?page=59747c3ff77948220136b7b3',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://app.chaport.com/api/v1/visitors', params={
      'page': '59747c3ff77948220136b7b3'
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://app.chaport.com/api/v1/visitors',
      params: {
      'page' => 'integer'
    }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /visitors

    Retrieves list of existing visitors.

    Parameters

    Parameter In Type Required Description
    page query integer true Results page number.

    Example responses

    {
      "result": [
        {
          "id": "59747c3ff77948220136b7b3",
          "email": "[email protected]",
          "name": "London #1399",
          "phone": "+44 (111) 111 11 11",
          "notes": "Asked us to notify him when the Others come. What is he talking about?",
          "sourceHost": "example.com",
          "language": "en",
          "lastSeen": "2017-10-03T10:47:31.873Z",
          "location": "London",
          "utm": {
            "source": "string",
            "medium": "string",
            "term": "string",
            "campaign": "string"
          },
          "browser": {
            "name": "Chrome",
            "version": "61.0.3163.100"
          },
          "os": {
            "name": "OS X",
            "version": "10.12.6"
          }
        }
      ],
      "links": {
        "next": "/visitors?page=5",
        "prev": "/visitors?page=3"
      }
    }
    

    Responses

    Status Meaning Description
    200 OK successful request
    400 Bad Request invalid or missing parameters in the request, more details in the response body
    500 Internal Server Error server was unable to process the request due to internal error

    Response Schema

    Status Code 200

    Name Type Required Description
    links object false No description
    » next string false Relative link to a next page of results if available.
    » prev string false Relative link to a previous page of results if available.
    result [Visitor] false No description
    » id string true ID of the visitor.
    » email string(email) false Email address of the visitor.
    » name string false Name of the visitor. Initally name is likely to include identified geolocation and a visitor number. However if ip geolocation is unsuccessful, name may be an integer representing a visitor number only.
    » phone string false A free format phone number.
    » notes string false Visitor-related notes left by operators.
    » sourceHost string false Website where the chat widget is installed.
    » language string false Preferred visitor language (identified automatically).
    » lastSeen string(date-time) false Time when the visitor was last seen.
    » location string false Visitor location based on ip geo location.
    » utm object false UTM captured when visitor comes to the website.
    »» source string false UTM source
    »» medium string false UTM medium
    »» term string false UTM term
    »» campaign string false UTM campaign
    » browser object false No description
    »» name string false Name of the visitor's browser.
    »» version string false Version of the visitor's browser.
    » os object false No description
    »» name string false Name of the visitor's operating system.
    »» version string false Version of the visitor's operating system.

    Retrieve a Visitor

    Code samples

    GET https://app.chaport.com/api/v1/visitors/{visitorId} HTTP/1.1
    Host: app.chaport.com
    
    Accept: application/json
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/visitors/{visitorId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://app.chaport.com/api/v1/visitors/{visitorId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://app.chaport.com/api/v1/visitors/{visitorId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /visitors/{visitorId}

    Retrieves a single visitor by id.

    Parameters

    Parameter In Type Required Description
    visitorId path string true ID of a visitor to retrieve.

    Example responses

    {
      "result": {
        "id": "59747c3ff77948220136b7b3",
        "email": "[email protected]",
        "name": "London #1399",
        "phone": "+44 (111) 111 11 11",
        "notes": "Asked us to notify him when the Others come. What is he talking about?",
        "sourceHost": "example.com",
        "language": "en",
        "lastSeen": "2017-10-03T10:47:31.873Z",
        "location": "London",
        "utm": {
          "source": "string",
          "medium": "string",
          "term": "string",
          "campaign": "string"
        },
        "browser": {
          "name": "Chrome",
          "version": "61.0.3163.100"
        },
        "os": {
          "name": "OS X",
          "version": "10.12.6"
        }
      },
      "links": {
        "chats": "string"
      }
    }
    

    Responses

    Status Meaning Description
    200 OK successful request
    400 Bad Request invalid or missing parameters in the request, more details in the response body
    404 Not Found requested entity has not been found
    500 Internal Server Error server was unable to process the request due to internal error

    Response Schema

    Status Code 200

    Name Type Required Description
    result Visitor true No description
    » id string true ID of the visitor.
    » email string(email) false Email address of the visitor.
    » name string false Name of the visitor. Initally name is likely to include identified geolocation and a visitor number. However if ip geolocation is unsuccessful, name may be an integer representing a visitor number only.
    » phone string false A free format phone number.
    » notes string false Visitor-related notes left by operators.
    » sourceHost string false Website where the chat widget is installed.
    » language string false Preferred visitor language (identified automatically).
    » lastSeen string(date-time) false Time when the visitor was last seen.
    » location string false Visitor location based on ip geo location.
    » utm object false UTM captured when visitor comes to the website.
    »» source string false UTM source
    »» medium string false UTM medium
    »» term string false UTM term
    »» campaign string false UTM campaign
    » browser object false No description
    »» name string false Name of the visitor's browser.
    »» version string false Version of the visitor's browser.
    » os object false No description
    »» name string false Name of the visitor's operating system.
    »» version string false Version of the visitor's operating system.
    links object false No description
    » chats string false A link to retrieve a most recent chat of this visitor and potentially others as well.

    Chats API

    Chat API provides access to your conversations.

    Retrieve a last Chat

    Code samples

    GET https://app.chaport.com/api/v1/visitors/{visitorId}/chats HTTP/1.1
    Host: app.chaport.com
    
    Accept: application/json
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/visitors/{visitorId}/chats',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://app.chaport.com/api/v1/visitors/{visitorId}/chats', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://app.chaport.com/api/v1/visitors/{visitorId}/chats',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /visitors/{visitorId}/chats

    Retrieves a last chat of a given visitor.

    Parameters

    Parameter In Type Required Description
    visitorId path string true ID of a visitor for a chat lookup.
    eventTypes query array[string] false Array of event types to include into output. Ignored if transcript is requested. By default, all events are included.
    transcript query boolean false Pass it as true if you need stringified chat transcript. eventTypes is ignored, and only message events are included in a transcript.

    Example responses

    {
      "result": {
        "id": 1506518520390,
        "initiator": "auto-invitation",
        "startedAt": "2017-09-27T13:22:00.390Z",
        "stage": "closed",
        "operators": [
          "59747c3ff77948220136b7b3",
          "597b0dd344e3410cc504c877"
        ],
        "transcript": "<p>V: Hello!</p>\n<p>Jon Snow: Winter is coming, stranger!</p>",
        "events": [
          {
            "timestamp": "2017-08-28T07:09:22.429Z",
            "type": "visitor-opened-page",
            "params": {
              "url": "http://example.com/hiring",
              "title": "Example – Example pricing page."
            }
          },
          {
            "timestamp": "2017-08-28T07:09:25.487Z",
            "type": "visitor-message",
            "params": {
              "text": "Hello! I want to join the Night Watch. Can I have an application form?"
            }
          },
          {
            "timestamp": "2017-08-28T07:09:39.540Z",
            "type": "operator-message",
            "params": {
              "text": "Hello, stranger! You can download an application form from http://example.com/application-form.",
              "operatorId": "59747c3ff77948220136b7b3"
            }
          },
          {
            "timestamp": "2017-08-28T07:09:56.038Z",
            "type": "operator-message",
            "params": {
              "text": "Let me know if you have questions, especially regarding the point \"10.12 Do you believe in snarks?\" and beyond.",
              "operatorId": "59747c3ff77948220136b7b3"
            }
          },
          {
            "timestamp": "2017-08-28T07:15:08.850Z",
            "type": "visitor-message",
            "params": {
              "text": "Thank you, Jon!"
            }
          },
          {
            "timestamp": "2017-08-28T07:24:21.951Z",
            "type": "visitor-opened-page",
            "params": {
              "url": "http://example.com/application-form",
              "title": "Example – Example application form."
            }
          }
        ],
        "visitor": {
          "id": "59747c3ff77948220136b7b3",
          "email": "[email protected]",
          "name": "London #1399",
          "phone": "+44 (111) 111 11 11",
          "notes": "Asked us to notify him when the Others come. What is he talking about?",
          "sourceHost": "example.com",
          "language": "en",
          "lastSeen": "2017-10-03T10:47:31.873Z",
          "location": "London",
          "utm": {
            "source": "string",
            "medium": "string",
            "term": "string",
            "campaign": "string"
          },
          "browser": {
            "name": "Chrome",
            "version": "61.0.3163.100"
          },
          "os": {
            "name": "OS X",
            "version": "10.12.6"
          }
        }
      },
      "links": {
        "more": [
          "string"
        ]
      }
    }
    

    Responses

    Status Meaning Description
    200 OK successful request
    400 Bad Request invalid or missing parameters in the request, more details in the response body
    404 Not Found requested entity has not been found
    500 Internal Server Error server was unable to process the request due to internal error

    Response Schema

    Status Code 200

    Name Type Required Description
    result Chat true No description
    » id integer false ID of the chat. Note, that it is only unique for a particular visitor to which the chat belongs.
    » initiator string in ['auto-invitation', 'visitor', 'operator', 'system'] false Initiator of the chat.
    » startedAt string(date-time) false Time when the chat was started.
    » stage string in ['closed', 'offline', 'invited manually', 'initiated', 'responded', 'engaged'] false Indicates the stage at which this chat currently is. 'initiated' - visitor started a chat, but no one replied; 'responded' - operator replied after visitor started a chat, but dialog has not progressed further; 'invited manually' - operator initiated a chat, but visitor did not reply; 'engaged' - visitor messaged after the operator either initiated a chat or replied to an initial visitor message, indicating that the visitor is successfully engaged in a conversation; 'offline' - same as 'initiated' except that all operators are offline; 'closed' - operator manually closed the chat without sending a single message.
    » transcript string false Only present if transcript request query parameter is passed and true. Chat messages and events serialised into a single string with a little bit of html for formatting.
    » visitor Visitor false No description
    »» id string true ID of the visitor.
    »» email string(email) false Email address of the visitor.
    »» name string false Name of the visitor. Initally name is likely to include identified geolocation and a visitor number. However if ip geolocation is unsuccessful, name may be an integer representing a visitor number only.
    »» phone string false A free format phone number.
    »» notes string false Visitor-related notes left by operators.
    »» sourceHost string false Website where the chat widget is installed.
    »» language string false Preferred visitor language (identified automatically).
    »» lastSeen string(date-time) false Time when the visitor was last seen.
    »» location string false Visitor location based on ip geo location.
    »» utm object false UTM captured when visitor comes to the website.
    »»» source string false UTM source
    »»» medium string false UTM medium
    »»» term string false UTM term
    »»» campaign string false UTM campaign
    »» browser object false No description
    »»» name string false Name of the visitor's browser.
    »»» version string false Version of the visitor's browser.
    »» os object false No description
    »»» name string false Name of the visitor's operating system.
    »»» version string false Version of the visitor's operating system.
    » operators [string] false Array of operator IDs assigned to this chat.
    » events [ChatEvent] false No description
    links object false No description
    » more [string] false Links to other chats of given visitor.

    Retrieve a Chat

    Code samples

    GET https://app.chaport.com/api/v1/visitors/{visitorId}/chats/{chatId} HTTP/1.1
    Host: app.chaport.com
    
    Accept: application/json
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/visitors/{visitorId}/chats/{chatId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://app.chaport.com/api/v1/visitors/{visitorId}/chats/{chatId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://app.chaport.com/api/v1/visitors/{visitorId}/chats/{chatId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /visitors/{visitorId}/chats/{chatId}

    Retrieves a chat by given visitorId and chatId combination.

    Parameters

    Parameter In Type Required Description
    visitorId path string true ID of a visitor for a chat lookup.
    chatId path integer true ID of a chat to retrieve.
    eventTypes query array[string] false Array of event types to include into output. Ignored if transcript is requested. By default, all events are included.
    transcript query boolean false Pass it as true if you need stringified chat transcript. eventTypes is ignored, and only message events are included in a transcript.

    Example responses

    {
      "result": {
        "id": 1506518520390,
        "initiator": "auto-invitation",
        "startedAt": "2017-09-27T13:22:00.390Z",
        "stage": "closed",
        "operators": [
          "59747c3ff77948220136b7b3",
          "597b0dd344e3410cc504c877"
        ],
        "transcript": "<p>V: Hello!</p>\n<p>Jon Snow: Winter is coming, stranger!</p>",
        "events": [
          {
            "timestamp": "2017-08-28T07:09:22.429Z",
            "type": "visitor-opened-page",
            "params": {
              "url": "http://example.com/hiring",
              "title": "Example – Example pricing page."
            }
          },
          {
            "timestamp": "2017-08-28T07:09:25.487Z",
            "type": "visitor-message",
            "params": {
              "text": "Hello! I want to join the Night Watch. Can I have an application form?"
            }
          },
          {
            "timestamp": "2017-08-28T07:09:39.540Z",
            "type": "operator-message",
            "params": {
              "text": "Hello, stranger! You can download an application form from http://example.com/application-form.",
              "operatorId": "59747c3ff77948220136b7b3"
            }
          },
          {
            "timestamp": "2017-08-28T07:09:56.038Z",
            "type": "operator-message",
            "params": {
              "text": "Let me know if you have questions, especially regarding the point \"10.12 Do you believe in snarks?\" and beyond.",
              "operatorId": "59747c3ff77948220136b7b3"
            }
          },
          {
            "timestamp": "2017-08-28T07:15:08.850Z",
            "type": "visitor-message",
            "params": {
              "text": "Thank you, Jon!"
            }
          },
          {
            "timestamp": "2017-08-28T07:24:21.951Z",
            "type": "visitor-opened-page",
            "params": {
              "url": "http://example.com/application-form",
              "title": "Example – Example application form."
            }
          }
        ],
        "visitor": {
          "id": "59747c3ff77948220136b7b3",
          "email": "[email protected]",
          "name": "London #1399",
          "phone": "+44 (111) 111 11 11",
          "notes": "Asked us to notify him when the Others come. What is he talking about?",
          "sourceHost": "example.com",
          "language": "en",
          "lastSeen": "2017-10-03T10:47:31.873Z",
          "location": "London",
          "utm": {
            "source": "string",
            "medium": "string",
            "term": "string",
            "campaign": "string"
          },
          "browser": {
            "name": "Chrome",
            "version": "61.0.3163.100"
          },
          "os": {
            "name": "OS X",
            "version": "10.12.6"
          }
        }
      },
      "links": {
        "more": [
          "string"
        ]
      }
    }
    

    Responses

    Status Meaning Description
    200 OK successful request
    400 Bad Request invalid or missing parameters in the request, more details in the response body
    404 Not Found requested entity has not been found
    500 Internal Server Error server was unable to process the request due to internal error

    Response Schema

    Status Code 200

    Name Type Required Description
    result Chat true No description
    » id integer false ID of the chat. Note, that it is only unique for a particular visitor to which the chat belongs.
    » initiator string in ['auto-invitation', 'visitor', 'operator', 'system'] false Initiator of the chat.
    » startedAt string(date-time) false Time when the chat was started.
    » stage string in ['closed', 'offline', 'invited manually', 'initiated', 'responded', 'engaged'] false Indicates the stage at which this chat currently is. 'initiated' - visitor started a chat, but no one replied; 'responded' - operator replied after visitor started a chat, but dialog has not progressed further; 'invited manually' - operator initiated a chat, but visitor did not reply; 'engaged' - visitor messaged after the operator either initiated a chat or replied to an initial visitor message, indicating that the visitor is successfully engaged in a conversation; 'offline' - same as 'initiated' except that all operators are offline; 'closed' - operator manually closed the chat without sending a single message.
    » transcript string false Only present if transcript request query parameter is passed and true. Chat messages and events serialised into a single string with a little bit of html for formatting.
    » visitor Visitor false No description
    »» id string true ID of the visitor.
    »» email string(email) false Email address of the visitor.
    »» name string false Name of the visitor. Initally name is likely to include identified geolocation and a visitor number. However if ip geolocation is unsuccessful, name may be an integer representing a visitor number only.
    »» phone string false A free format phone number.
    »» notes string false Visitor-related notes left by operators.
    »» sourceHost string false Website where the chat widget is installed.
    »» language string false Preferred visitor language (identified automatically).
    »» lastSeen string(date-time) false Time when the visitor was last seen.
    »» location string false Visitor location based on ip geo location.
    »» utm object false UTM captured when visitor comes to the website.
    »»» source string false UTM source
    »»» medium string false UTM medium
    »»» term string false UTM term
    »»» campaign string false UTM campaign
    »» browser object false No description
    »»» name string false Name of the visitor's browser.
    »»» version string false Version of the visitor's browser.
    »» os object false No description
    »»» name string false Name of the visitor's operating system.
    »»» version string false Version of the visitor's operating system.
    » operators [string] false Array of operator IDs assigned to this chat.
    » events [ChatEvent] false No description
    links object false No description
    » more [string] false Links to other chats of a given visitor.

    Hooks API

    Chaport can notify your application when certain events happen. Hooks API allows you to view your event subscriptions, subscribe to these events (i.e.create hooks), unsubscribe from them or update your subscriptions.

    List REST Hooks

    Code samples

    GET https://app.chaport.com/api/v1/events/subscriptions HTTP/1.1
    Host: app.chaport.com
    
    Accept: application/json
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/events/subscriptions',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://app.chaport.com/api/v1/events/subscriptions', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://app.chaport.com/api/v1/events/subscriptions',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /events/subscriptions

    Retrieves a list of existing REST hook subscriptions.

    Example responses

    {
      "result": [
        {
          "id": "59bbb7141c229b49765854a0",
          "targetUrl": "https://your-server.com/post-your-notifications-here",
          "event": "chat.finished",
          "createdAt": "2017-09-15T11:18:44.482Z"
        }
      ]
    }
    

    Responses

    Status Meaning Description
    200 OK successful request
    500 Internal Server Error server was unable to process the request due to internal error

    Response Schema

    Status Code 200

    Name Type Required Description
    result [Hook] false No description
    » id string false Hook ID
    » targetUrl string false URL to which event notifications are sent.
    » event string in ['chat.started', 'chat.finished', 'visitor.created', 'visitor.updated'] false Name of the event related to this subscription.
    » createdAt string(date-time) false Time the subscription has been created.

    Create a new Subscription

    Code samples

    POST https://app.chaport.com/api/v1/events/subscriptions HTTP/1.1
    Host: app.chaport.com
    Content-Type: application/json
    
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "id": "59bbb7141c229b49765854a0",
      "targetUrl": "https://your-server.com/post-your-notifications-here",
      "event": "chat.finished",
      "createdAt": "2017-09-15T11:18:44.482Z"
    }';
    const headers = {
      'Content-Type':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/events/subscriptions',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'application/json'
    }
    
    r = requests.post('https://app.chaport.com/api/v1/events/subscriptions', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json'
    }
    
    result = RestClient.post 'https://app.chaport.com/api/v1/events/subscriptions',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /events/subscriptions

    Creates an event subscription.

    Creates a hook pointing to a passed targetUrl parameter and firing every time when given event occurs.

    Body parameter

    {
      "id": "59bbb7141c229b49765854a0",
      "targetUrl": "https://your-server.com/post-your-notifications-here",
      "event": "chat.finished",
      "createdAt": "2017-09-15T11:18:44.482Z"
    }
    

    Parameters

    Parameter In Type Required Description
    body body Hook false No description
    » id body string false Hook ID
    » targetUrl body string false URL to which event notifications are sent.
    » event body string in ['chat.started', 'chat.finished', 'visitor.created', 'visitor.updated'] false Name of the event related to this subscription.
    » createdAt body string(date-time) false Time the subscription has been created.

    Example responses

    Responses

    Status Meaning Description
    200 OK Event subscription has been successfully created.
    400 Bad Request invalid or missing parameters in the request, more details in the response body
    500 Internal Server Error server was unable to process the request due to internal error

    Retrieve a Subscription

    Code samples

    GET https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId} HTTP/1.1
    Host: app.chaport.com
    
    Accept: application/json
    
    
    const request = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /events/subscriptions/{subscriptionId}

    Retrieves a REST hook subscription by id.

    Parameters

    Parameter In Type Required Description
    subscriptionId path string true ID of an event subscription.

    Example responses

    {
      "result": {
        "id": "59bbb7141c229b49765854a0",
        "targetUrl": "https://your-server.com/post-your-notifications-here",
        "event": "chat.finished",
        "createdAt": "2017-09-15T11:18:44.482Z"
      }
    }
    

    Responses

    Status Meaning Description
    200 OK successful request
    404 Not Found invalid or missing parameters in the request, more details in the response body
    404 Not Found invalid or missing parameters in the request, more details in the response body
    500 Internal Server Error server was unable to process the request due to internal error

    Response Schema

    Status Code 200

    Name Type Required Description
    result Hook true No description
    » id string false Hook ID
    » targetUrl string false URL to which event notifications are sent.
    » event string in ['chat.started', 'chat.finished', 'visitor.created', 'visitor.updated'] false Name of the event related to this subscription.
    » createdAt string(date-time) false Time the subscription has been created.

    Update a Hook

    Code samples

    PUT https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId} HTTP/1.1
    Host: app.chaport.com
    Content-Type: application/json
    
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "id": "59bbb7141c229b49765854a0",
      "targetUrl": "https://your-server.com/post-your-notifications-here",
      "event": "chat.finished",
      "createdAt": "2017-09-15T11:18:44.482Z"
    }';
    const headers = {
      'Content-Type':'application/json'
    
    };
    
    fetch('https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'application/json'
    }
    
    r = requests.put('https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json'
    }
    
    result = RestClient.put 'https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PUT /events/subscriptions/{subscriptionId}

    Updates an event subscription.

    Body parameter

    {
      "id": "59bbb7141c229b49765854a0",
      "targetUrl": "https://your-server.com/post-your-notifications-here",
      "event": "chat.finished",
      "createdAt": "2017-09-15T11:18:44.482Z"
    }
    

    Parameters

    Parameter In Type Required Description
    subscriptionId path string true ID of an event subscription.
    body body Hook false No description
    » id body string false Hook ID
    » targetUrl body string false URL to which event notifications are sent.
    » event body string in ['chat.started', 'chat.finished', 'visitor.created', 'visitor.updated'] false Name of the event related to this subscription.
    » createdAt body string(date-time) false Time the subscription has been created.

    Example responses

    Responses

    Status Meaning Description
    200 OK Event subscription has been successfully updated.
    404 Not Found invalid or missing parameters in the request, more details in the response body
    404 Not Found invalid or missing parameters in the request, more details in the response body
    500 Internal Server Error server was unable to process the request due to internal error

    Delete a Subscription

    Code samples

    DELETE https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId} HTTP/1.1
    Host: app.chaport.com
    
    
    
    
    const request = require('node-fetch');
    
    fetch('https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}',
    {
      method: 'DELETE'
    
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    
    r = requests.delete('https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}', params={
    
    )
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    
    result = RestClient.delete 'https://app.chaport.com/api/v1/events/subscriptions/{subscriptionId}',
      params: {
      }
    
    p JSON.parse(result)
    
    

    DELETE /events/subscriptions/{subscriptionId}

    Deletes an event subscription.

    Parameters

    Parameter In Type Required Description
    subscriptionId path string true ID of an event subscription.

    Example responses

    Responses

    Status Meaning Description
    200 OK Event subscription has been successfully deleted.
    404 Not Found invalid or missing parameters in the request, more details in the response body
    404 Not Found invalid or missing parameters in the request, more details in the response body
    500 Internal Server Error server was unable to process the request due to internal error

    Events

    This section lists currently existing REST events.

    Notify when Chat Started

    Code samples

    POST {$Create a new Subscription.request.body.targetUrl} HTTP/1.1
    Host: app.chaport.com
    Content-Type: application/json
    
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "link": "string",
      "extras": {}
    }';
    const headers = {
      'Content-Type':'application/json'
    
    };
    
    fetch('{$Create a new Subscription.request.body.targetUrl}',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'application/json'
    }
    
    r = requests.post('{$Create a new Subscription.request.body.targetUrl}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json'
    }
    
    result = RestClient.post '{$Create a new Subscription.request.body.targetUrl}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST {$Create a new Subscription.request.body.targetUrl}

    This event fires when a new chat is started.

    Please note, that if the chat is renewed (one of participants sends a new message shortly after the chat was marked as finished) this event will not fire again.

    Body parameter

    {
      "link": "string",
      "extras": {}
    }
    

    Parameters

    Parameter In Type Required Description
    body body object true No description
    » link body string true No description
    » extras body object false No description

    Notify when Chat Finished

    Code samples

    POST {$Create a new Subscription.request.body.targetUrl} HTTP/1.1
    Host: app.chaport.com
    Content-Type: application/json
    
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "link": "string",
      "extras": {}
    }';
    const headers = {
      'Content-Type':'application/json'
    
    };
    
    fetch('{$Create a new Subscription.request.body.targetUrl}',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'application/json'
    }
    
    r = requests.post('{$Create a new Subscription.request.body.targetUrl}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json'
    }
    
    result = RestClient.post '{$Create a new Subscription.request.body.targetUrl}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST {$Create a new Subscription.request.body.targetUrl}

    This event fires after a chat is idle for about 10 minutes.

    Please note, that any chat can be renewed (or restarted) shortly after it was finished, consequently this event may fire multiple times for some chats.

    Body parameter

    {
      "link": "string",
      "extras": {}
    }
    

    Parameters

    Parameter In Type Required Description
    body body object true No description
    » link body string true No description
    » extras body object false No description

    Notify when Visitor Created

    Code samples

    POST {$Create a new Subscription.request.body.targetUrl} HTTP/1.1
    Host: app.chaport.com
    Content-Type: application/json
    
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "link": "string",
      "extras": {}
    }';
    const headers = {
      'Content-Type':'application/json'
    
    };
    
    fetch('{$Create a new Subscription.request.body.targetUrl}',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'application/json'
    }
    
    r = requests.post('{$Create a new Subscription.request.body.targetUrl}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json'
    }
    
    result = RestClient.post '{$Create a new Subscription.request.body.targetUrl}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST {$Create a new Subscription.request.body.targetUrl}

    This event fires when a new visitor starts a chat.

    Body parameter

    {
      "link": "string",
      "extras": {}
    }
    

    Parameters

    Parameter In Type Required Description
    body body object true No description
    » link body string true No description
    » extras body object false No description

    Notify when Visitor Updated

    Code samples

    POST {$Create a new Subscription.request.body.targetUrl} HTTP/1.1
    Host: app.chaport.com
    Content-Type: application/json
    
    
    
    const request = require('node-fetch');
    const inputBody = '{
      "link": "string",
      "extras": {
        "fields": [
          "name"
        ]
      }
    }';
    const headers = {
      'Content-Type':'application/json'
    
    };
    
    fetch('{$Create a new Subscription.request.body.targetUrl}',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'application/json'
    }
    
    r = requests.post('{$Create a new Subscription.request.body.targetUrl}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json'
    }
    
    result = RestClient.post '{$Create a new Subscription.request.body.targetUrl}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST {$Create a new Subscription.request.body.targetUrl}

    This event fires when one or more of the following fields gets updated: name, email, phone and notes.

    Extras object of notification request contains a fields property containing an array of updated fields.

    Body parameter

    {
      "link": "string",
      "extras": {
        "fields": [
          "name"
        ]
      }
    }
    

    Parameters

    Parameter In Type Required Description
    body body object true No description
    » link body string true No description
    » extras body object false No description
    »» fields body [string] in ['name', 'email', 'phone', 'notes'] false No description

    Schemas

    Hook

    {
      "id": "59bbb7141c229b49765854a0",
      "targetUrl": "https://your-server.com/post-your-notifications-here",
      "event": "chat.finished",
      "createdAt": "2017-09-15T11:18:44.482Z"
    } 
    

    Properties

    Name Type Required Description
    id string false Hook ID
    targetUrl string false URL to which event notifications are sent.
    event string in ['chat.started', 'chat.finished', 'visitor.created', 'visitor.updated'] false Name of the event related to this subscription.
    createdAt string(date-time) false Time the subscription has been created.

    Operator

    {
      "id": "59747c3ff77948220136b7b3",
      "email": "[email protected]",
      "name": "Jon Snow",
      "jobTitle": "The Wall supervisor",
      "role": "admin",
      "lastLoginAt": "2017-10-03T10:47:31.873Z",
      "image": "https://app.chaport.com/uploads/operator-images/123123ad-9c59-4859-a062-20d818b2c582.jpg",
      "acceptOfflineMessages": true,
      "lastStatus": "online"
    } 
    

    Properties

    Name Type Required Description
    id string true Operator ID.
    email string(email) false Email address of the operator.
    name string false Name of the operator.
    jobTitle string false Job title of the operator.
    role string in ['admin', 'operator'] false 'operator' - generic operator role, 'admin' - operator with advanced administrative permissions.
    lastLoginAt string(date-time) false Time of last login.
    image string false Image (avatar) of the operator.
    acceptOfflineMessages boolean false A flag defining whether this operator should be receiving messages when everyone is offline.
    lastStatus string in ['online', 'invisible', 'offline'] false Status of the operator when they were last seen. This status will be restored next time the operator logs in to the app.

    Visitor

    {
      "id": "59747c3ff77948220136b7b3",
      "email": "[email protected]",
      "name": "London #1399",
      "phone": "+44 (111) 111 11 11",
      "notes": "Asked us to notify him when the Others come. What is he talking about?",
      "sourceHost": "example.com",
      "language": "en",
      "lastSeen": "2017-10-03T10:47:31.873Z",
      "location": "London",
      "utm": {
        "source": "string",
        "medium": "string",
        "term": "string",
        "campaign": "string"
      },
      "browser": {
        "name": "Chrome",
        "version": "61.0.3163.100"
      },
      "os": {
        "name": "OS X",
        "version": "10.12.6"
      }
    } 
    

    Properties

    Name Type Required Description
    id string true ID of the visitor.
    email string(email) false Email address of the visitor.
    name string false Name of the visitor. Initally name is likely to include identified geolocation and a visitor number. However if ip geolocation is unsuccessful, name may be an integer representing a visitor number only.
    phone string false A free format phone number.
    notes string false Visitor-related notes left by operators.
    sourceHost string false Website where the chat widget is installed.
    language string false Preferred visitor language (identified automatically).
    lastSeen string(date-time) false Time when the visitor was last seen.
    location string false Visitor location based on ip geo location.
    utm object false UTM captured when visitor comes to the website.
    » source string false UTM source
    » medium string false UTM medium
    » term string false UTM term
    » campaign string false UTM campaign
    browser object false No description
    » name string false Name of the visitor's browser.
    » version string false Version of the visitor's browser.
    os object false No description
    » name string false Name of the visitor's operating system.
    » version string false Version of the visitor's operating system.

    Chat

    {
      "id": 1506518520390,
      "initiator": "auto-invitation",
      "startedAt": "2017-09-27T13:22:00.390Z",
      "stage": "closed",
      "operators": [
        "59747c3ff77948220136b7b3",
        "597b0dd344e3410cc504c877"
      ],
      "transcript": "<p>V: Hello!</p>\n<p>Jon Snow: Winter is coming, stranger!</p>",
      "events": [
        {
          "timestamp": "2017-08-28T07:09:22.429Z",
          "type": "visitor-opened-page",
          "params": {
            "url": "http://example.com/hiring",
            "title": "Example – Example pricing page."
          }
        },
        {
          "timestamp": "2017-08-28T07:09:25.487Z",
          "type": "visitor-message",
          "params": {
            "text": "Hello! I want to join the Night Watch. Can I have an application form?"
          }
        },
        {
          "timestamp": "2017-08-28T07:09:39.540Z",
          "type": "operator-message",
          "params": {
            "text": "Hello, stranger! You can download an application form from http://example.com/application-form.",
            "operatorId": "59747c3ff77948220136b7b3"
          }
        },
        {
          "timestamp": "2017-08-28T07:09:56.038Z",
          "type": "operator-message",
          "params": {
            "text": "Let me know if you have questions, especially regarding the point \"10.12 Do you believe in snarks?\" and beyond.",
            "operatorId": "59747c3ff77948220136b7b3"
          }
        },
        {
          "timestamp": "2017-08-28T07:15:08.850Z",
          "type": "visitor-message",
          "params": {
            "text": "Thank you, Jon!"
          }
        },
        {
          "timestamp": "2017-08-28T07:24:21.951Z",
          "type": "visitor-opened-page",
          "params": {
            "url": "http://example.com/application-form",
            "title": "Example – Example application form."
          }
        }
      ],
      "visitor": {
        "id": "59747c3ff77948220136b7b3",
        "email": "[email protected]",
        "name": "London #1399",
        "phone": "+44 (111) 111 11 11",
        "notes": "Asked us to notify him when the Others come. What is he talking about?",
        "sourceHost": "example.com",
        "language": "en",
        "lastSeen": "2017-10-03T10:47:31.873Z",
        "location": "London",
        "utm": {
          "source": "string",
          "medium": "string",
          "term": "string",
          "campaign": "string"
        },
        "browser": {
          "name": "Chrome",
          "version": "61.0.3163.100"
        },
        "os": {
          "name": "OS X",
          "version": "10.12.6"
        }
      }
    } 
    

    Properties

    Name Type Required Description
    id integer false ID of the chat. Note, that it is only unique for a particular visitor to which the chat belongs.
    initiator string in ['auto-invitation', 'visitor', 'operator', 'system'] false Initiator of the chat.
    startedAt string(date-time) false Time when the chat was started.
    stage string in ['closed', 'offline', 'invited manually', 'initiated', 'responded', 'engaged'] false Indicates the stage at which this chat currently is. 'initiated' - visitor started a chat, but no one replied; 'responded' - operator replied after visitor started a chat, but dialog has not progressed further; 'invited manually' - operator initiated a chat, but visitor did not reply; 'engaged' - visitor messaged after the operator either initiated a chat or replied to an initial visitor message, indicating that the visitor is successfully engaged in a conversation; 'offline' - same as 'initiated' except that all operators are offline; 'closed' - operator manually closed the chat without sending a single message.
    transcript string false Only present if transcript request query parameter is passed and true. Chat messages and events serialised into a single string with a little bit of html for formatting.
    visitor Visitor false No description
    » id string true ID of the visitor.
    » email string(email) false Email address of the visitor.
    » name string false Name of the visitor. Initally name is likely to include identified geolocation and a visitor number. However if ip geolocation is unsuccessful, name may be an integer representing a visitor number only.
    » phone string false A free format phone number.
    » notes string false Visitor-related notes left by operators.
    » sourceHost string false Website where the chat widget is installed.
    » language string false Preferred visitor language (identified automatically).
    » lastSeen string(date-time) false Time when the visitor was last seen.
    » location string false Visitor location based on ip geo location.
    » utm object false UTM captured when visitor comes to the website.
    »» source string false UTM source
    »» medium string false UTM medium
    »» term string false UTM term
    »» campaign string false UTM campaign
    » browser object false No description
    »» name string false Name of the visitor's browser.
    »» version string false Version of the visitor's browser.
    » os object false No description
    »» name string false Name of the visitor's operating system.
    »» version string false Version of the visitor's operating system.
    operators [string] false Array of operator IDs assigned to this chat.
    events [ChatEvent] false No description

    ChatEvent

    {
      "type": "string",
      "timestamp": "2017-10-30T13:27:12Z"
    } 
    

    Properties

    Name Type Required Description
    type string true No description
    timestamp string(date-time) true No description

    VisitorMessageChatEvent

    {
      "type": "visitor-message",
      "timestamp": "2017-08-28T08:24:56.899Z",
      "params": {
        "text": "Hello! I have a question regarding your application form. Can you help me?"
      }
    } 
    

    Properties

    Name Type Required Description
    type string in ['visitor-message'] true No description
    timestamp string(date-time) true No description
    params object false No description
    » text string false No description

    OperatorMessageChatEvent

    {
      "type": "operator-message",
      "timestamp": "2017-10-30T13:27:12Z",
      "params": {
        "text": "string",
        "operatorId": "string"
      }
    } 
    

    Properties

    Name Type Required Description
    type string in ['operator-message'] true No description
    timestamp string(date-time) true No description
    params object false No description
    » text string false No description
    » operatorId string false No description

    TriggerMessageChatEvent

    {
      "type": "trigger-message",
      "timestamp": "2017-10-30T13:27:12Z",
      "params": {
        "text": "string",
        "operatorId": "string"
      }
    } 
    

    Properties

    Name Type Required Description
    type string in ['trigger-message'] true No description
    timestamp string(date-time) true No description
    params object false No description
    » text string false No description
    » operatorId string false No description

    VisitorOpenedPageChatEvent

    {
      "type": "visitor-opened-page",
      "timestamp": "2017-10-30T13:27:12Z",
      "params": {
        "url": "string",
        "title": "string"
      }
    } 
    

    Properties

    Name Type Required Description
    type string in ['visitor-opened-page'] true No description
    timestamp string(date-time) true No description
    params object false No description
    » url string false No description
    » title string false No description

    EmailRequestChatEvent

    {
      "type": "email-request",
      "timestamp": "2017-10-30T13:27:12Z"
    } 
    

    Properties

    Name Type Required Description
    type string in ['email-request'] true No description
    timestamp string(date-time) true No description

    FileTransferChatEvent

    {
      "type": "file-transfer",
      "timestamp": "2017-10-30T13:27:12Z"
    } 
    

    Properties

    Name Type Required Description
    type string in ['file-transfer'] true No description
    timestamp string(date-time) true No description

    OperatorInviteChatEvent

    {
      "type": "operator-invite",
      "timestamp": "2017-10-30T13:27:12Z",
      "params": {
        "operatorId": "string",
        "targetOperatorId": "string"
      }
    } 
    

    Properties

    Name Type Required Description
    type string in ['operator-invite'] true No description
    timestamp string(date-time) true No description
    params object false No description
    » operatorId string false No description
    » targetOperatorId string false No description

    OperatorChangeChatEvent

    {
      "type": "operator-change",
      "timestamp": "2017-10-30T13:27:12Z",
      "params": {
        "operatorId": "string",
        "targetOperatorId": "string"
      }
    } 
    

    Properties

    Name Type Required Description
    type string in ['operator-change'] true No description
    timestamp string(date-time) true No description
    params object false No description
    » operatorId string false No description
    » targetOperatorId string false No description

    VisitorMutedChatEvent

    {
      "type": "visitor-muted",
      "timestamp": "2017-10-30T13:27:12Z"
    } 
    

    Properties

    Name Type Required Description
    type string in ['visitor-muted'] true No description
    timestamp string(date-time) true No description

    Javascript API

    Javascript API Overview

    Do you want to have more control over chat widget or want to integrate Chaport closely with your user base? Read Chaport Javascript API docs.