forio Toggle navigation

User API Adapter

The User API Adapter allows you to retrieve details about end users in your team (account). It is based on the querying capabilities of the underlying RESTful User API.

To use the User API Adapter, instantiate it and then call its methods.

  var ua = new F.service.User({
      account: 'acme-simulations',
      token: 'user-or-project-access-token'
  });
  ua.getById('42836d4b-5b61-4fe4-80eb-3136e956ee5c');
  ua.get({ userName: 'jsmith' });
  ua.get({ id: ['42836d4b-5b61-4fe4-80eb-3136e956ee5c',
              '4ea75631-4c8d-4872-9d80-b4600146478e'] });

The constructor takes an optional options parameter in which you can specify the account and token if they are not already available in the current context.

Configuration Options

account

  • String

The account id. In the Epicenter UI, this is the Team ID (for team projects) or User ID (for personal projects). Defaults to empty string.

token

  • String

The access token to use when searching for end users. (See more background on access tokens).

transport

  • Object

Options to pass on to the underlying transport layer. All jquery.ajax options at http://api.jquery.com/jQuery.ajax/ are available. Defaults to empty object.

Methods

get

Retrieve details about particular end users in your team, based on user name or user id.

Example

  var ua = new F.service.User({
      account: 'acme-simulations',
      token: 'user-or-project-access-token'
  });
  ua.get({ userName: 'jsmith' });
  ua.get({ id: ['42836d4b-5b61-4fe4-80eb-3136e956ee5c',
              '4ea75631-4c8d-4872-9d80-b4600146478e'] });

Parameters

  • filter: object Object with field userName and value of the username. Alternatively, object with field id and value of an array of user ids.

  • options: object (Optional) Overrides for configuration options.

getById

Retrieve details about a single end user in your team, based on user id.

Example

  var ua = new F.service.User({
      account: 'acme-simulations',
      token: 'user-or-project-access-token'
  });
  ua.getById('42836d4b-5b61-4fe4-80eb-3136e956ee5c');

Parameters

  • userId: string The user id for the end user in your team.

  • options: object (Optional) Overrides for configuration options.