Skip to content

Latest commit

 

History

History
393 lines (262 loc) · 10.9 KB

UserAttributeApi.md

File metadata and controls

393 lines (262 loc) · 10.9 KB

LookerApi30Reference.UserAttributeApi

All URIs are relative to https://madisonreed.looker.com:19999/api/3.0

Method HTTP request Description
allUserAttributeGroupValues GET /user_attributes/{user_attribute_id}/group_values Get User Attribute Group Values
allUserAttributes GET /user_attributes Get All User Attributes
createUserAttribute POST /user_attributes Create User Attribute
deleteUserAttribute DELETE /user_attributes/{user_attribute_id} Delete User Attribute
setUserAttributeGroupValues POST /user_attributes/{user_attribute_id}/group_values Set User Attribute Group Values
updateUserAttribute PATCH /user_attributes/{user_attribute_id} Update User Attribute
userAttribute GET /user_attributes/{user_attribute_id} Get User Attribute

allUserAttributeGroupValues

[UserAttributeGroupValue] allUserAttributeGroupValues(userAttributeId, opts)

Get User Attribute Group Values

Returns all values of a user attribute defined by user groups, in precedence order.

A user may be a member of multiple groups which define different values for a given user attribute. The order of group-values in the response determines precedence for selecting which group-value applies to a given user. For more information, see Set User Attribute Group Values.

Results will only include groups that the caller's user account has permission to see.

Example

var LookerApi30Reference = require('looker-api-3');

var apiInstance = new LookerApi30Reference.UserAttributeApi()

var userAttributeId = 789; // {Integer} Id of user attribute

var opts = { 
  'fields': "fields_example" // {String} Requested fields.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.allUserAttributeGroupValues(userAttributeId, opts, callback);

Parameters

Name Type Description Notes
userAttributeId Integer Id of user attribute
fields String Requested fields. [optional]

Return type

[UserAttributeGroupValue]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

allUserAttributes

[UserAttribute] allUserAttributes(opts)

Get All User Attributes

Get information about all user attributes.

Example

var LookerApi30Reference = require('looker-api-3');

var apiInstance = new LookerApi30Reference.UserAttributeApi()

var opts = { 
  'fields': "fields_example", // {String} Requested fields.
  'sorts': "sorts_example" // {String} Fields to sort by.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.allUserAttributes(opts, callback);

Parameters

Name Type Description Notes
fields String Requested fields. [optional]
sorts String Fields to sort by. [optional]

Return type

[UserAttribute]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createUserAttribute

UserAttribute createUserAttribute(opts)

Create User Attribute

Create a new user attribute.

Example

var LookerApi30Reference = require('looker-api-3');

var apiInstance = new LookerApi30Reference.UserAttributeApi()

var opts = { 
  'body': new LookerApi30Reference.UserAttribute(), // {UserAttribute} User Attribute
  'fields': "fields_example" // {String} Requested fields.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createUserAttribute(opts, callback);

Parameters

Name Type Description Notes
body UserAttribute User Attribute [optional]
fields String Requested fields. [optional]

Return type

UserAttribute

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteUserAttribute

'String' deleteUserAttribute(userAttributeId)

Delete User Attribute

Delete a user attribute (admin only).

Example

var LookerApi30Reference = require('looker-api-3');

var apiInstance = new LookerApi30Reference.UserAttributeApi()

var userAttributeId = 789; // {Integer} Id of user_attribute


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.deleteUserAttribute(userAttributeId, callback);

Parameters

Name Type Description Notes
userAttributeId Integer Id of user_attribute

Return type

'String'

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

setUserAttributeGroupValues

[UserAttributeGroupValue] setUserAttributeGroupValues(userAttributeId, body)

Set User Attribute Group Values

Define values for a user attribute across a set of groups, in priority order.

This function defines all values for a user attribute defined by user groups. This is a global setting, potentially affecting all users in the system. This function replaces any existing group value definitions for the indicated user attribute.

The value of a user attribute for a given user is determined by searching the following locations, in this order:

  1. the user's account settings
  2. the groups that the user is a member of
  3. the default value of the user attribute, if any

The user may be a member of multiple groups which define different values for that user attribute. The order of items in the group_values parameter determines which group takes priority for that user. Lowest array index wins.

An alternate method to indicate the selection precedence of group-values is to assign numbers to the 'rank' property of each group-value object in the array. Lowest 'rank' value wins. If you use this technique, you must assign a rank value to every group-value object in the array.

To set a user attribute value for a single user, see Set User Attribute Value. To set a user attribute value for all members of a group, see Set User Attribute Group Value

Example

var LookerApi30Reference = require('looker-api-3');

var apiInstance = new LookerApi30Reference.UserAttributeApi()

var userAttributeId = 789; // {Integer} Id of user attribute

var body = [new LookerApi30Reference.UserAttributeGroupValue()]; // {[UserAttributeGroupValue]} Array of group values.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.setUserAttributeGroupValues(userAttributeId, body, callback);

Parameters

Name Type Description Notes
userAttributeId Integer Id of user attribute
body [UserAttributeGroupValue] Array of group values.

Return type

[UserAttributeGroupValue]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateUserAttribute

UserAttribute updateUserAttribute(userAttributeId, body, opts)

Update User Attribute

Update a user attribute definition.

Example

var LookerApi30Reference = require('looker-api-3');

var apiInstance = new LookerApi30Reference.UserAttributeApi()

var userAttributeId = 789; // {Integer} Id of user attribute

var body = new LookerApi30Reference.UserAttribute(); // {UserAttribute} User Attribute

var opts = { 
  'fields': "fields_example" // {String} Requested fields.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateUserAttribute(userAttributeId, body, opts, callback);

Parameters

Name Type Description Notes
userAttributeId Integer Id of user attribute
body UserAttribute User Attribute
fields String Requested fields. [optional]

Return type

UserAttribute

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

userAttribute

UserAttribute userAttribute(userAttributeId, opts)

Get User Attribute

Get information about a user attribute.

Example

var LookerApi30Reference = require('looker-api-3');

var apiInstance = new LookerApi30Reference.UserAttributeApi()

var userAttributeId = 789; // {Integer} Id of user attribute

var opts = { 
  'fields': "fields_example" // {String} Requested fields.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.userAttribute(userAttributeId, opts, callback);

Parameters

Name Type Description Notes
userAttributeId Integer Id of user attribute
fields String Requested fields. [optional]

Return type

UserAttribute

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json