API Overview

eGain Hubs

The eGain REST API provides a simple and powerful way to interact with resources, such as Article, Bookmarks or Guided Help in eGain Platform using the standard HTTP methods (GET, PUT, POST, and DELETE).

  • GET method allows retrieving a resource
  • POST method allows creating a new resource
  • PUT method allows updating a resource
  • DELETE method allows deleting or removing a resource

Since eGain REST API operates over HTTP(s), it makes it easy to use it with any programming language or framework. The API can be used for many purposes, including:

  • Building mobile apps and modern web applications.
  • Integrating eGain platform with other applications.
  • Building AJAX-based browser applications that provide a user interface for operations, reporting or monitoring.
  • Writing programs that access data from the eGain database.

Range Query Parameter Representation

Range query parameters allow to specify a start and end value between which the parameter value lies.
For date query parameter values, following range format is supported:[start,end]

  • "start" and "end" represent range start date and range end date respectively.
  • The range values have to be specified within square brackets.
  • The values specified in the range are inclusive.
    For example [2015-12-23T08:39:16.000Z,2015-12-28T08:39:16.000Z] will fetch all records starting from 2015-12-23T08:39:16.000Z to 2015-12-28T08:39:16.000Z date.
  • At least one of "start" or "end" must be provided.
  • If only "start" is provided, the application gets all matching records "on-or-after" start date.
    For example [2015-12-23T08:39:16.000Z,] will fetch all records on or after 2015-12-23T08:39:16.000Z date. Note that comma is required after start date.
  • If only "end" is provided, the application gets all matching records "on-or-before" end date.
    For example [,2015-12-28T08:39:16.000Z] will fetch all records on or before 2015-12-28T08:39:16.000Z date. Note that comma is required before end date.

Supported Common Query Parameters in eGain REST API

  • In addition to API specific query parameters, eGain REST API define query parameters that are applicable to sets of APIs and are not closely related to the function of any API. Such parameters are referred to as "common query parameters" or simply "common parameters" in this documentation. Common parameters always start with '$' (dollar sign) symbol.
  • This page describes all the common query parameters that may appear in eGain REST APIs. While this is a comprehensive list of common parameters that are currently in use, each API may choose from below list which parameters to support.
  • All common query parameters are optional query parameters unless stated otherwise in a specific API documentation.
    Name Description Default value Allowed Values
    $pagenum Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize. 1 A positive integer
    $pagesize Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum. 25 An integer between 1 and 75
    $rangestart Range parameter that specifies the starting index of the range of results to be returned. Used in conjunction with $rangesize. 1 A positive integer
    $rangesize Range parameter that specifies the number (range) of results to be returned. Used in conjunction with $rangestart. 25 An integer between 1 and 75
    $sort Indicates the resource attribute name on which the results must be sorted. Only a single attribute name is allowed; comma separated values are not supported. N/A Each API that supports sorting, has its own set of allowed values.
    $order Indicates the sorting order. Must be accompanied by $sort. 'asc' 'asc' and 'desc'
    $lang Mostly used in Authoring APIs to specify the language of requested Authoring resource, like article, folder, topic etc. Default user language Refer KB specification.
    $level If the requested resource represents a hierarchical structure (e.g., folders), $level may be used to indicate the depth of hierarchy (starting from root node) up to which the results should be returned. 0
    • 0 (only root node is returned)
    • a positive integer (the actual level of depth)
    • -1 (entire hierarchy is expanded)
    $count If this parameter is provided, only the total number of items qualifying the request will be returned, along with the link to the first page of the items. The actual items will not be returned. 'N/A' 'yes'
    $attribute A comma separated list of attribute names to be returned in resource representation in addition to summary attributes. N/A
    • all (all available attributes are returned)
    • Additionally, each API that supports $attribute, has its own set of allowed values

    NOTE: Pagination and Range parameters cannot be used together in the same request and will result in 400 - Bad Request server response.