REST API:user Resource

REST API:user Resource

From LongJump Support Wiki

REST API:user Resource
Jump to: navigation, search

Performs actions on User records via the REST API

Contents

Access Permissions

File:Lock-tiny.gif

Users that have the User Management permission can use this Resource. 

Determine if a Valid Session is in Progress

Determine if the current session is valid.

Method
GET
URI
https://na.longjump.com/networking/rest/user/isSessionValid
Response
:
<platform>
    <user>
        <is_session_valid>true</is_session_valid>
    </user>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Get Information about the Logged-In User

Gets information about the logged in user.

Method
GET
URI
https://na.longjump.com/networking/rest/user/info
Response
The same information returned by the query to Get a User Record: first name, last name, employee number, and so on.

Get a User Record

Retrieves data for the specified user.

Method
GET
URI
https://na.longjump.com/networking/rest/user/{user_id}
Response
<platform>
    <user>
        <id>16016a880c064ad1ba92115424851462</id>
        <first_name>John</first_name>
        <last_name>Smith</last_name>
        <company>CompanyA</company>
        <title/>
        <time_zone>12</time_zone>
        <date_format>MM/dd/yyyy</date_format>
        <employee_number/>
        <language>en</language>
        <email>userA@gmail.com</email>
        <username>userA@gmail.com</username>
        <active>1</active>
        <team_id type="TEAM"
          uri="https://qamain.longjump.com/networking/rest/team/1"
          displayValue="Order Processing">5</team_id>
        <accessProfileId type="ROLE"
          uri="https://qamain.longjump.com/networking/rest/accessProfile/1"
          displayValue="Shipping Clerk">6</accessProfileId>
        <federation_id/>
        <sso_type>0</sso_type>
        <single_sign_on>false</single_sign_on>
        <enable_mobile>true</enable_mobile>
        <phone/>
        <mobile/>
        <fax/>
        <street/>
        <city/>
        <state/>
        <zip/>
        <country/>
        <force_password_change_on_login>false</force_password_change_on_login>
        <date_last_password_change>2011-07-22T12:48:46.000Z</date_last_password_change>
        <force_security_question_change_on_login>1</force_security_question_change_on_login>
        <last_login>1236041001000</last_login>
        <created_id type=""
         uri="https://{domain}/networking/rest/user/1524089492"
         displayValue="Peter Parker">1424089492</created_id>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <modified_id type=""
         uri="https://{domain}/networking/rest/user/1524089492"
         displayValue="Peter Parker">1424089492</modified_id>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <customer_language>en</customer_language>
        <full_name>John Smith</full_name>
        <community_user_id/>
        <auto_generated_community_user_record>0</auto_generated_community_user_record>
        <user_type>P</user_type>
        <alias/>
        <description/>
        <photo_id/>
        <thumbnail_photo_id/>
        <date_status_updated>2011-07-28T12:41:11.000Z</date_status_updated>
        <status>
           {#package_installation.add_feed^Email Campaign Manager}.
           <a href='#' class='blueText smallText'
             style='font-weight:normal; text-decoration:underline;'
             onclick="javascript:top.loadApplication('1555611998wwy1718621231');">
              {#app.launch_appln}</a>
        </status>
        <tenant_user_id/>
        <tenant_id/>
        <notify_info>1</notify_info>
        <base_currency/>
        <customerId>123223323</customerId>
        <user_id_type>0</user_id_type>
        <object_id>USER</object_id>
        <flag_logged_in>1</flag_logged_in>

        <userTenantCapabilities>
            <isRelayEnabled>true</isRelayEnabled>
        </userTenantCapabilities>
        <emailNotificationOptions>
            <userWallPost>true</userWallPost>
            <recordWallPost>true</recordWallPost>
            <documentWallPost>true</documentWallPost>
            <groupWallPost>true</groupWallPost>
            <commentOnMyPost>true</commentOnMyPost>
            <commentOnComment>true</commentOnComment>
            <like>true</like>
        </emailNotificationOptions>

        <reports_to type=""
          uri="https://{domain}/rest/user/123qwe456rty"
          displayValue="John Smith">123qwe456rty</reports_to>
    </user>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Dynamic Search

Returns the fields requested by a dynamic search based on number of records, offset, sort column, sort order, and specified criteria.

Method
GET
URI
https://na.longjump.com/networking/rest/user?{query_parameters}
Sample Search
?fieldList=name,id & filter=name contains 'smith' & sortby='id'
(Field names are in the Fields section.)
Query Parameters
  • fieldList - A comma-separated list of field names to retrieve
  • The asterisk (*) wildcard specifies all fields
  • Use the REST API:field Resource to get a complete list of fields
  • Field lists for database views need to specify the object's alias, as well as the field name.
  • filter - Filtering criteria to filter the records
  • pageSize - Number of records to retrieve from the result set in order to make a "page".
  • page - Number of the logical page in a database result set. The first page is page "zero" (0).
Page zero is returned by default, so appending &pageSize=1 to your query returns a single record.
  • getTotalRecordCount returns the number of total records.
    Causes the following structure to be returned, where N is the total number of records:
<platform>
   ...
   <message>
      <code>0</code>
      <description>Success</description>
   </message>

   <!-- added by the query param -->
   <totalRecordCount>N</totalRecordCount>
</platform>
  • sortBy - Field name for primary sort
    Ex: &sortBy=name
  • sortOrder - Sort order of the primary field, either "asc" or "desc" (ascending or descending)
    Ex: &sortOrder="desc"
  • sortBy2 - Field name for secondary sort
  • sortOrder2 - Sort order of the second field, either "asc" or "desc" (ascending or descending)
For more information, see: Specifying Query Parameters in REST APIs
Response
<platform>
    <record>
        <phone/>
        <street/>
        <state/>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <city/>
        <id>1424089492</id>
        <first_name>Admin</first_name>
        <username>admin@platform.com</username>
        <title/>
        <reports_to/>
        <zip/>
        <employee_number/>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <object_id>USER</object_id>
        <last_login>1267756624000</last_login>
        <country/>
        <created_id type=""
            uri="https://{domain}/networking/rest/user/5"
            displayValue="Platform Admin">5</created_id>
        <time_zone>12</time_zone>
        <modified_id type=""
            uri="https://{domain}/networking/rest/user/16016a880c064ad1ba92115424851462"
            displayValue="Sheela Sarva">16016a880c064ad1ba92115424851462</modified_id>
        <email>demo@platform.com</email>
        <last_name>Platform</last_name>
        <active>1</active>
    </record>

    <record>
        <phone/>
        <street/>
        <state/>
        <date_created>2010-11-12T13:14:15Z</date_created>
        <city/>
        <id>151b28b700dc45abbb12b65ea451fc97</id>
        <first_name>Me</first_name>
        <username>myusername</username>
        <title/>
        <reports_to/>
        <zip/>
        <employee_number/>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <object_id>USER</object_id>
        <last_login/>
        <country/>
        <created_id type=""
            uri="https://{domain}/networking/rest/user/123223323"
            displayValue="Platform Admin">123223323</created_id>
        <time_zone>12</time_zone>
        <modified_id type=""
            uri="https://{domain}/networking/rest/user/123223323"
            displayValue="Platform Admin">123223323</modified_id>
        <email>myusernamecp@gmail.com</email>
        <last_name>Mostly</last_name>
        <active>1</active>
    </record>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
    <recordCount>2</recordCount>
</platform>
See also: REST API:Error Codes

Add a User Record

Adds a user record

Method
POST
URI
https://na.longjump.com/networking/rest/user/
Request
<platform>
    <user>
        <phone/>
        <street/>
        <city/>
        <first_name>John</first_name>
        <username>userA@gmail.com</username>
        <employee_number/>
        <single_sign_on>0</single_sign_on>
        <enable_mobile>true</enable_mobile>
        <fax/>
        <country/>
        <time_zone>12</time_zone>
        <email>userA@gmail.com</email>
        <company>CompanyA</company>
        <last_name>Smith</last_name>
        <active>1</active>
        <language>en</language>
        <mobile/>
        <state/>
        <title/>
        <notify_info>1</notify_info>
        <reports_to>151b28b700dc45abbb12b65ea451fc97</reports_to>
        <zip/>
        <alias/>
        <customer_language>en</customer_language>
        <team_id>1</team_id>                  // only required on add
        <accessProfileId>3</accessProfileId>  // only required on add
    </user>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
        <id>1818437421</id>      // id of the user that was added
    </message>
</platform>
See also: REST API:Error Codes

Update a User Record

Updates data for a specified User.

Method
PUT
URI
https://na.longjump.com/networking/rest/user/{recordId}
Request
Field elements are optional. If a field is missing, existing data in that field is unaffected. If a field is specified, but empty, any existing data in that field is deleted.
<platform>
    <user>
        <phone/>
        <street/>
        <city/>
        <first_name>John</first_name>
        <username>userA@gmail.com</username>
        <single_sign_on>0</single_sign_on>
        <employee_number/>
        <fax/>
        <country/>
        <time_zone>12</time_zone>
        <email>userA@gmail.com</email>
        <company>CompanyA</company>
        <last_name>Smith</last_name>
        <active>1</active>
        <language>en</language>
        <mobile/>
        <state/>
        <title/>
        <reports_to>151b28b700dc45abbb12b65ea451fc97</reports_to>
        <zip/>
        <alias/>
        <customer_language>en</customer_language>        
    </user>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
        <id>1818437421</id>      // id of the user that was updated
    </message>
</platform>
See also: REST API:Error Codes

Update (Reset) Password for a User

Change the password to a new or existing user.

Method
POST
Example
URI
https://na.longjump.com/networking/rest/user/operation/updatePassword
Request
<platform>
    <user>
        <id>da80488c7e8d4f5a83c66a3bb2590295</id>
        <password>abc</password>
        <longjump_reset_user>1</longjump_reset_user>
        <skip_email>1</skip_email>
    </user>
</platform>
longjump_reset_user
  • 0 = Password field is required. User is not required to change it at next log in. (default)
  • 1 = Password field does not have to be specified. System automatically generates a new, random password. User is required to change it at next log in.
skip_email
This field is only used for a new user.
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>        
    </message>
</platform>
See also: REST API:Error Codes

Change Password for the Current User

Change the password for the current user.

Method
POST
URI
https://na.longjump.com/networking/rest/user/operation/changePassword
Request
<platform>
    <user>
        <old_password>world44</old_password>
        <password>pass123</password>
    </user>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>        
    </message>
</platform>
See also: REST API:Error Codes

Delete a User Record

Deletes a User record

Method
DELETE
URI
https://na.longjump.com/networking/rest/user/{recordId}
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>             
    </message>
</platform>
See also: REST API:Error Codes


Fields

Notes:
  • In this object, Boolean fields accept either 1/0 or TRUE/FALSE
  • Because there are so many fields, and so many of them can be empty, empty fields generally are not returned as part of user data. However, they can still be specified for an update.
NameTypeAttributeRequired During AddDescriptionAdditional Information
idStringRead OnlyRecord Id
first_nameStringEditable on Add/Update
last_nameStringEditable on Add/Update
companyStringEditable on Add/Update
titleStringEditable on Add/Update
time_zoneIntegerEditable on Add/UpdateSee: Time Zone Codes
date_formatStringEditable on Add/UpdateSee: Date/Time Formats
reports_toStringEditable on Add/Update User's manager/supervisor
employee_numberEditable on Add/Update
languageStringEditable on Add/UpdateTwo letter language code that is available to tenant (ex: 'en', 'es', 'hi')
emailStringEditable on Add/Update
usernameStringEditable on Add/Update
site_nameStringEditable on Add/Update Optional. When the name of a Site is specified, it designates the user as a site user, rather than a platform user.
passwordStringEditable on Add/Update Only Password used to login
  • Password is required for Login
  • Password is optional when creating a new user
If not provided, a temporary password is generated and sent to the user/tenant via email
Learn more: Manage Email Templates - Forgot Reset Password Email
  • Password is not used when retrieving or updating user info
  • Password is not returned as part of user data
custom_security_questionStringEditable on Add/Update The question to ask to confirm identify when user has forgotten their password.
security_answerStringEditable on Add/Update The expected answer.
activeBooleanEditable on Add/Update
single_sign_onBooleanEditable on Add/Update
sso_typeIntegerRead OnlyType of single sign on:

1 - Delegated
  Authentication
2 - SAML

See: Single Sign On
federation_idStringRead Only Used in SAML authentication, if SAML is enabled
user_id_type NumberEditable on Add/Update1: User ID
2:Federated ID
Used in SAML authentication, if SAML is enabled
enable_mobile BooleanEditable on Add/Update Allow mobile access to the platform


team_id IntegerEditable on Add/Update
accessProfileId IntegerEditable on Add/Update
phoneStringEditable on Add/Update
mobileStringEditable on Add/Update
fax StringEditable on Add/Update
streetStringEditable on Add/Update
city StringEditable on Add/Update
state StringEditable on Add/Update
zipStringEditable on Add/Update
countryStringEditable on Add/Update
notify_infoBooleanEditable on Add/Update Send the Welcome email message When enabled, a notification email is sent (containing the username, welcome and login information) when a new user is added.

Default is 1 (email is sent automatically on new user creation)

This value is not stored in the database, and is not returned by a GET.

base_currency StringEditable on Add/Update The currency format displayed to the user, and used for data entry
force_password_change_on_loginBooleanEditable on Add/Update Force a password change action on first-time login When enabled, the User is prompted to change the password when logging in for the first time

Default is 1 (new user is forced to change password on first login)

force_security_question_change_on_loginBooleanEditable on Add/Update Force the user to change their security question the next time they login. Default value is 1 when a user a new user record is created.
last_login DateRead OnlyDate and time of last login UTC Format
date_last_password_changedateRead Only Date and time of last password change UTC Format
customer_languageStringRead OnlyDefault Language, specified in My Information
full_nameStringRead OnlyFull name of the user
date_createdDateRead OnlyUTC Format
created_idLookupRead Only
date_modifiedDateRead OnlyUTC Format
modified_idLookupRead Only
community_user_idStringRead OnlyUser's ID in the community
auto_generated_community_user_recordBooleanRead Only<true> for the initial admin user and any other user IDs automatically generated for the community
user_typeStringRead OnlyUser type: Platform user (P) or Site User (S)
aliasStringEditable on Add/UpdateUser's alias in the community
description StringEditable on Add/Update User's self-description Relay fields
photo_id imageEditable on Add/Update ID of the User's picture.
Access: REST document Resource.
thumbnail_photo_id imageEditable on Add/Update ID of the thumbnail image.
Access: REST document Resource.
status StringEditable on Add/UpdateUser's status
date_status_updated dateEditable on Add/UpdateLast date and time user's status was changed
tenant_idStringRead Only
  • Blank when logged in as normal user in a non-community tenant.
  • The ID of the host tenant, when logged in as a community user.
tenant_user_idStringRead Only
customerIdStringRead OnlyCustomer IDThe ID of the tenant where the user is logged in:
  • The host tenant ID, when logged in as a user for a normal (non-community) tenant.
  • The ID of the community tenant, when logged in as a community user.
flag_logged_in BooleanRead only True if the user is logged in
custom field(s)User FieldsUser can add fields of various type, including text, date, time, etc.
userTenantCapabilities
  • isRelayEnabled
BooleanRead only True if Relay is enabled in this tenancy
emailNotificationOptions
  • userWallPost
Boolean True to send a notification when someone writes on the user's wall.
  • recordWallPost
Boolean True to send a notification when someone writes on the record's wall, if the user is following that record.
  • documentWallPost
Boolean True to send a notification when someone writes on a document wall, if the user is following that document.
  • groupWallPost
Boolean True to send a notification when someone writes on a group wall, if the user is following that group.
  • commentOnMyPost
Boolean True to send a notification when someone comments on one of the user's posts.
  • commentOnComment
Boolean True to send a notification when someone comments on one of the user's comments.
  • like
Boolean True to send a notification when someone votes "like" on one of the user's posts.
Personal tools