Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

User account

The user account contains the minimum information needed to create a user in EthosCE. When creating or updating a user, only the following fields are valid: name, mail, roles and status.

When calling a GET request for user data, the return is amended with additional information. These fields are not required, nor valid, in creation and update calls.

User (user)
Code Block
title
languagejsUser (user)
var user = {
  "name" : "webservice_username", // Username
  "mail" : "webservice@dlcdev.com",
  "status" : 1, // 1 = Enabled, 0 = Blocked
  "roles" : [
    {"id":123123123}    // The internal role id. 
    {"id":789789789}
  ]
};
title
Info
iconfalse

See also

Creating a user via web service

...

The user profile contains all additional data related to an account, including a user's address, first and last name, as well as all custom fields. Required fields vary depending on the profile type selection.

Profile (profile2)
Code Block
languagejstitleProfile (profile2)
var profile2 = {
  "user" : 1,
  "label" : "Profile",
  "type" : "profile",
  "field_first_name" : "Tom",  // A text field
  "field_middle_name" : "Stewart",
  "field_last_name" : "Baker",
  "field_profile_location" : {  // An address field
    "street" : "1520 Locust Street",
    "additional" : "Suite 1000",
    "city" : "Phila",
    "province" : "PA",
    "postal_code" : "19102",
    "country" : "us",
  },

// The field types below are not used in the main profile, but may be used in additional profile types
// They are listed here for reference

  "field_text_area" : {  // A text area field
    "value" : "this is the summary<b>This is bold</b>", // Basic HTML structure is supported
    "format" : "filtered_html" // Text format is a required field. All users have access to Filtered HTML
  },

 "field_boolean" : 1,  // A single on/off checkbox or radio button selection

 "field_collection": {  // A field collection
        "id": 1234  // This is the id of the field collection on the profile. 
    },
    "field_name_of_board": "ABIM", // This is just an example. Check your site to confirm field names and values.
    "field_board_id": "848309583", // This is just an example. Check your site to confirm field names and values.
    "field_name": "field_board_certification",  // Example name of the field collection
    "host_entity": { // host_entity is the Form ID of the profile form to update.
        "id": 4567,
        "resource": "profile2"
    }

 "field_checkbox_select" : {  // A multi-select box or group of checkboxes
    // The first key in this array is the language selection, which defaults to 'undefined'
   "und" : {
      // Using the keys found in the field Allowed Values configuration
     "option_one",
     "option_two",
    },
  },

};
title
Info
iconfalse

See also

Main profile: Creating a user via web service

Faculty Management Add-on profiles: Creating user profiles via web service

...

The authentication name is used to track the user's unique key provided by an external SSO service. The module value may vary by installation. In this example, the user is assigned a key for compatibility with SimpleSAML.

Authentication Name (authmap)
Code Block
languagejstitleAuthentication Name (authmap)
var authmap = {
  "uid" : 1,
  "authname" : "external_user_id",
  "module" : "simplesamlphp_auth",
};
title
Info
iconfalse

See also

Creating an SSO User via Webservice

...