Service Levels

Sometimes, you might have a scenario where you want to preferentially display a widget for one queue (or user) over another. Maybe you have a cooperative service with another department. Maybe you have a web page for a specialized area, and you'd like the guest to get connected to the specialist(s) if they are available, but if they're not, then your general guest support queue is fine and is better than a simple offline contact point. In any case, you want to do something more flexible than showing and hiding a widget for only one queue. You can use service rollover to set-up preferential chat routing based upon availability.

The service levels for a service are ordered starting at 0. Your zeroth service level has the highest preference. That is, guests will be routed there when the user or queue associated with that level is available. If service level 0 is unavailable, guests will be routed to service level 1 if available and so on. If no service levels are available, the guest will see your service as offline.

Authentication

LibraryH3lp supports cookie-based authentication. To learn more, you can read the details on authentication.

HTTP and HTTPS

Requests are served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported.

Service Level Instance Resource

A Service Level instance resource represents a single service level attached to a given service managed by the user account provided during authentication.

Resource URI

/2011-12-03/services/{ServiceId}/level/{Level}

Resource Properties

A Service Level resource is represented by the following properties:

Property Description
serviceId The id of the service to which this level is attached.
level A non-negative integer indicating this level's precedence within the service rollover ordering.
type Either queues or users depending on whether this service level is associated with a queue or user.
name The queue name or username associated with this service level.
widgetId The id of the widget associated with this service level.
html An HTML string that determines this level's online appearance. When empty, the online behavior is a clickable link with "Chat is online." anchor text. Read HTML code samples to get a better idea of what this field typically looks like when customized.

HTTP GET

Returns a JSON response containing a representation of a service level, including the properties above.

Example

GET /2011-12-03/services/1933/level/0

[
  {
    "serviceId": 1933,
    "level": 0,
    "type": "queues",
    "name": "example-queue",
    "widgetId": 411,
    "html": ""
  }
]

HTTP POST

Not supported.

HTTP PUT

Allows you to modify the properties of an existing service level.

Optional PUT data

You may include, as JSON PUT data, name, widgetId, or html. When changing name, type will be automatically inferred.

Response

Always returns a JSON response containing the representation of the service level resource.

Example - change the queue associated with a service level

PUT /2011-12-03/services/1933/levels/0
{
  "name": "another-queue",
}

[
  {
    "serviceId": 1933,
    "level": 0,
    "type": "queues",
    "name": "another-queue",
    "widgetId": 411,
    "html": ""
  }
]

HTTP DELETE

Removes a service level.

Response

Returns a JSON response with the following properties:

Property Description
success Boolean indicating if the request was successful.
message Optional. If success is null, message is a string describing the reason for the failed request.

Example

DELETE /2011-12-03/services/1933/level/0

{
  "success": true
}

Reordering Service Levels

In order to minimize HTTP requests and simplify the process of reordering service levels, we have added two convenience URIs.

Moving a service level up in precedence

Moves the specified service level up in precedence and automatically reorders any other levels. Only POST is supported. GET, PUT, and DELETE on this URI are not supported.

URI

/2011-12-03/services/{ServiceId}/levels/{Level}/up

Response

Returns the modified service level.

Example - HTTP POST

POST /2011-12-03/services/1933/levels/1/up

{
  "serviceId": 1933,
  "level": 0,
  "type": "queues",
  "name": "an-example-queue",
  "widgetId": 411,
  "html": ""
}

Moving a service level down in precedence

Moves the specified service level down in precedence and automatically reorders any other levels. Only POST is supported. GET, PUT, and DELETE on this URI are not supported.

URI

/2011-12-03/services/{ServiceId}/levels/{Level}/down

Response

Returns the modified service level.

Example - HTTP POST

POST /2011-12-03/services/1933/levels/0/down

{
  "serviceId": 1933,
  "level": 1,
  "type": "queues",
  "name": "example-queue",
  "widgetId": 411,
  "html": ""
}

Service Levels List Resource

The Service Levels list resource represents the set of Service Levels attached to a given service managed by the user whose credentials were used to make the API request.

Resource URI

/2011-12-03/services/{ServiceId}/levels

HTTP GET

Returns all the service levels managed by the user whose credentials were used to make the API request.

Response

Returns a JSON response containing a list of Service Level resources.

Example

GET /2011-12-03/services/1933/levels

[
  {
    "serviceId": 1933,
    "level": 0,
    "type": "queues",
    "name": "example-queue",
    "widgetId": 411,
    "html": ""
  }
]

HTTP POST

Allows you to add a new service level.

Required and optional POST data

You must include, as JSON POST data, the level, name and widgetId properties of a service level. You may include the html property. type is automatically inferred from name.

Response

If successful, returns a JSON response containing the resource representation of the newly created service level. If unsuccessful, returns a JSON response with the following properties:

Property Description
success Boolean indicating if the request was successful.
message Optional. If success is null, message is a string describing the reason for the failed request.

Example

POST /2011-12-03/services/1933/levels
{
  "level": 1,
  "name": "another-queue",
  "widgetId": 3,
}

{
  "serviceId": 1933,
  "level": 1,
  "type": "queues",
  "name": "another-queue",
  "widgetId": 3,
  "html": ""
}

HTTP PUT

Not supported.

HTTP DELETE

Not supported.