Documentation

    REST API (on premise)

    On-Premise REST API Overview

    The on-premise REST API functions similarly to the cloud version, with some differences detailed below.

    Enabling the API

    By default, the API is disabled. It will only be enabled when you add a REST_KEY environment variable.

    Authentication

    To authenticate your requests to the REST API, add an Authorization header set to the value you provided in the REST_KEY environment variable.

    The Visitor Object

    The Visitor object may differ slightly in the on-premise version, depending on your configuration. Most attributes will be present, and all Visitors will have the same properties.

    Endpoints

    On-premise, the REST API is mounted on the /api path of your base endpoint. For example, if your BASE_ENDPOINT is https://support.acmetech.com/cobrowsing, one of the endpoints will be https://support.acmetech.com/cobrowsing/api/visitors/list/latest.

    Listing the Latest Visitors

    Use this endpoint to list the latest online Visitors. This only works with MongoDB.

    GET /visitors/list/latest
    

    Response

    // HTTP 200
    {
      "status": "ok",
      "visitors": [
        {
          "short_id": "1234",
          // ...
        }
      ]
    }
    
    FieldTypeDescription
    visitorsVisitor[]List of Visitors matching the query.

    Searching for a Visitor

    Use this endpoint to search for Visitors.

    GET /visitors/list/search
    
    ParameterTypeDescription
    qstring, optionalThe search query in this format. If left empty, the latest Visitors will be returned.

    Response

    // HTTP 200
    {
      "status": "ok",
      "visitors": [
        {
          "short_id": "1234",
          // ...
        }
      ]
    }
    
    FieldTypeDescription
    visitorsVisitor[]List of Visitors matching the query.

    Retrieving a Visitor

    Use this endpoint to retrieve a specific Visitor.

    GET /visitors/{visitor_id}
    
    ParameterTypeDescription
    {visitor_id}stringThe short id of the Visitor.

    Response

    // HTTP 200
    {
      "status": "ok",
      "visitor": {
        "short_id": "1234",
        // ...
      }
    }
    
    FieldTypeDescription
    visitorVisitor[]The Visitor.