Documentation

    API Endpoints

    Retrieving Usage Statistics

    Use this endpoint to retrieve statistics about your account's usage.

    Request

    GET https://api.upscope.io/v1.3/usage
    

    Response

    // HTTP 200
    {
      "status": "ok",
      "usage": {
          "agents": {
              "last_30_days": 10,
              "today": 0
          },
          "session_counts": {
              "last_30_days": 20,
              "now": 0,
              "today": 0
          },
          "session_seconds": {
              "last_30_days": 5000,
              "today": 0
          },
          "visitors": {
              "last_24_hrs": 50000,
              "online_now": 400
          }
      }
    }
    
    FieldTypeDescription
    usage.agents.last_30_daysintegerNumber of Agents who used Co-Browsing API in the last 30 days.
    usage.agents.todayintegerNumber of Agents who used Co-Browsing API in the last 24 hours.
    usage.session_counts.last_30_daysintegerNumber of Sessions in the last 30 days.
    usage.session_counts.nowintegerNumber of Sessions currently ongoing.
    usage.session_counts.todayintegerNumber of Sessions in the last 24 hours.
    usage.session_seconds.last_30_daysintegerNumber of Session seconds in the past 30 days.
    usage.session_seconds.todayintegerNumber of Session seconds in the past 24 hours.
    usage.visitors.last_24_hrsintegerNumber of Visitors in the past 24 hours.
    usage.visitors.online_nowintegerNumber of Visitors online now.

    Searching for a Visitor or Retrieving a List of Visitors

    Use this endpoint to search for a particular Visitor or to show a list of recently online Visitors.

    Know the Visitor's ID?
    If you know the Visitor's ID, avoid using the search functionality and instead use the direct endpoint, which will be considerably faster.
    Need just 1 result?
    Make sure to set max_results to 1. This will be considerably faster as our API service will be making a bunch of parallel requests to all the co-browsing regions you have enabled, and by setting to 1, it can respond to you as soon as it gets the first result.

    Request

    GET https://api.upscope.io/v1.3/list
    
    ParameterTypeDescription
    searchstringThe search query in this format. If left empty, the latest Visitors will be returned.
    max_resultsnumberThe max number of results to return, up to 10. Defaults to 10. Setting this to 1 will make the search faster.

    Response

    // HTTP 200
    {
      "status": "ok",
      "visitors": [
        {
          "short_id": "1234",
          // ...
        }
      ]
    }
    
    FieldTypeDescription
    visitorsVisitor[]List of Visitors matching the query.
    visitors.sessionsSession[]List of the Visitor's last 50 Sessions.

    Retrieving a Visitor

    Use this endpoint to retrieve a particular Visitor.

    Request

    GET https://api.upscope.io/v1.3/visitors/{visitor_id}
    
    ParameterTypeDescription
    {visitor_id}stringThe short id of the Visitor.

    Response

    // HTTP 200
    {
      "status": "ok",
      "visitor": {
        "short_id": "1234",
        // ...
      }
    }
    
    FieldTypeDescription
    visitorVisitorThe Visitor.

    Errors

    CodeDescription
    404The Visitor does not exist.

    Stopping an Active Session

    Use this endpoint to stop an active Session.

    Request

    DELETE https://api.upscope.io/v1.3/visitors/{visitor_id}/session
    
    ParameterTypeDescription
    {visitor_id}stringThe short id of the Visitor.

    Response

    // HTTP 200
    {
      "status": "ok"
    }
    

    Errors

    CodeDescription
    404The Visitor does not exist.

    Deleting a Visitor from Co-Browsing API

    Use this endpoint to delete a Visitor from Co-Browsing API entirely. You can only delete Visitors who are not currently online.

    Request

    DELETE https://api.upscope.io/v1.3/visitors/{visitor_id}
    
    ParameterTypeDescription
    {visitor_id}stringThe short id of the Visitor.

    Response

    // HTTP 200
    {
      "status": "ok"
    }
    

    Errors

    CodeDescription
    404The Visitor does not exist.
    409The Visitor is online.

    Deleting All Visitors from Co-Browsing API

    Use this endpoint to delete all Visitors from your Co-Browsing API account. This will delete only Visitors that are offline.

    Request

    DELETE https://api.upscope.io/v1.3/visitors?all=true
    
    ParameterTypeDescription
    allbooleanSet to true to confirm deleting all Visitors.

    Response

    // HTTP 200
    {
      "status": "ok"
    }
    

    Agent Lookup

    Use this endpoint to lookup an agent from your Co-Browsing API account.

    You must send either the email or the external_id
    Using the email it will lookup for users from your account, while using the external_id it will lookup for external agents from your account. If you use any other parameter rather than email or external_id it will return not found.

    Request

    GET https://api.upscope.io/v1.3/agents/lookup?email=john@acme.com
    
    ParameterTypeDescription
    emailstring (Only specify email or external_id)The Agent email, this will return a HelloScreen or UserView user.
    external_idstring (Only specify email or external_id)The External Agent id, this will return a Co-Browsing API Agent.

    Response

    // HTTP 200
    {
      "agent": {
        "id": "u_1234",
        // ... Agent data
      },
      "status": "ok"
    }
    
    FieldTypeDescription
    agentAgentThe Agent who started or joined the Session as an observer
    agent.sessionsSession[]The list of the agent's last 10 sessions.

    Errors

    CodeDescription
    404Agent not found

    Retrieving a List of Sessions

    Use this endpoint to retrieve a list of Sessions.

    Request

    GET https://api.upscope.io/v1.3/cobrowsing_sessions/list
    
    ParameterTypeDescription
    before_idstring, optionalOnly list Sessions that happened before the Session with the specified id (used for pagination)
    after_idstring, optionalOnly list Sessions that happened before the Session with the specified id (used for pagination)
    ongoing_onlyboolean (defaults to false)Only list Sessions that are currently active.
    updated_afterDatetime, optionalOnly list Sessions that have had some sort of update to their record after this time.

    Response

    // HTTP 200
    {
        "status": "ok",
        "cobrowsing_sessions": [
          {
            id: "s_123",
    		// ... Session details
          }
    	],
        "has_more": true,
        "last_id": "s_456"
    }
    
    FieldTypeDescription
    cobrowsing_sessionsSession[]A list of Sessions, sorted by start date, from first to last.
    has_morebooleanWhether there are more Sessions matching your filter. (If so, paginate by changing the after_id)
    last_idstring | nullThe id of the last Session. This is always the same as the last Session from the array, and can be used as a cursor with after_id.

    Authorizing an On-Premise Session

    Use this endpoint to authorize an on-premise Session.

    Using our Dashboard?
    If you have integrated your on-premise version of Co-Browsing API to our dashboard, you don't need to use the API. It all just works.

    Request

    POST https://api.upscope.io/v1.3/onpremise/token
    {
      "visitor_id": "VISITOR123",
      "agent": {
        "id": "123",
        "name": "Joe Smith"
      }
    }
    
    ParameterTypeDescription
    agent.idstringThe ID of the Agent (required).
    agent.namestringThe name of the Agent (required).
    visitor_idstringThe ID of the Visitor you want to co-browse with.

    Response

    // HTTP 200
    {
        "authorized": true,
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkw...."
    }
    
    FieldTypeDescription
    authorizedbooleantrue to indicate the Session was authorized.
    tokenstringThe token to send to the on-premise version of Co-Browsing API.

    Errors

    CodeDescription
    402This session was not authorized.