forio Toggle navigation

Consensus Group Service

The Consensus Group Service provides a way to group different consensus points within your world. This is typically used in faculty pages to report progression throw different Consensus Points.

 var cg = new F.service.ConsensusGroup({
     worldId: world.id,
     name: 'rounds'
 });
 cg.consensus('round1').create(..);

You can use the Consensus Service (F.service.Consensus) without using the ConsensusGroup (F.service.ConsensusGroup) - the Consensus Service uses a group called "default" by default.

Constructor options

Required? Name Type Description
Yes worldId string Id of world this consensus service is a part of
  name string Unique identifier for this consensus group. Defaults to being named 'default'
  token string For projects that require authentication, pass in the user access token (defaults to undefined). If the user is already logged in to Epicenter, the user access token is already set in a cookie and automatically loaded from there. (See more background on access tokens). @see Authentication API Service for getting tokens.
  transport JQueryAjaxOptions Options to pass on to the underlying transport layer. All jquery.ajax options are supported.
  server object
  server.host string The value of host is usually the string api.forio.com, the URI of the Forio API server. This is automatically set, but you can pass it explicitly if desired. It is most commonly used for clarity when you are hosting an Epicenter project on your own server
  server.protocol https / http Defaults to https

Methods

list(outputModifier[, options])

List all consensus points within this group

Parameters

Required? Name Type Description
Yes outputModifier object Currently unused, may be used for paging etc later
  options object Overrides for serviceoptions

delete([options])

Deletes all consensus points within this group

Parameters

Required? Name Type Description
  options object Overrides for serviceoptions

consensus([name, options])

Helper to return a Consensus instance

Parameters

Required? Name Type Description
  name string Returns a new instance of a consensus service. Note it is not created until you call create on the returned service.
  options object Overrides for serviceoptions