Difference between revisions of "REST API:user Resource"
imported>Aeric |
Wikieditor (talk | contribs) |
||
(68 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
Performs actions on [[User]] records via the [[REST API]] | Performs actions on [[User]] records via the [[REST API]] | ||
===Access Permissions=== | ===Access Permissions=== | ||
{{ | {{PermissionRef|User Management|use this Resource.}} | ||
===Determine if a Valid Session is in Progress=== | ===Determine if a Valid Session is in Progress=== | ||
Line 12: | Line 12: | ||
Retrieves data for the specified user. | Retrieves data for the specified user. | ||
;Method:GET | ;Method:GET | ||
;URI:<tt> | ;URI:<tt>{{platformURL}}/rest/user/{user_id}</tt> | ||
;Response: | ;Response: | ||
:<syntaxhighlight lang="html4strict" enclose="div"> | :<syntaxhighlight lang="html4strict" enclose="div"> | ||
<platform> | <platform> | ||
<user> | <user> | ||
< | <id>16016a880c064ad1ba92115424851462</id> | ||
<first_name>John</first_name> | <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/> | <employee_number/> | ||
< | <language>en</language> | ||
<email>userA@gmail.com</email> | <email>userA@gmail.com</email> | ||
< | <username>userA@gmail.com</username> | ||
<active>1</active> | <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> | |||
<accessibility_mode>1<accessibility_mode> | |||
<acts_as_delegate>1<acts_as_delegate> | |||
<html_signature>test<html_signature> | |||
<phone/> | |||
<mobile/> | <mobile/> | ||
<fax/> | |||
<street/> | |||
<city/> | |||
<state/> | <state/> | ||
<zip/> | <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="" | <created_id type="" | ||
uri="https://{domain}/networking/rest/user/1524089492" | uri="https://{{domain}}/networking/rest/user/1524089492" | ||
displayValue="Peter Parker">1424089492</created_id> | displayValue="Peter Parker">1424089492</created_id> | ||
<date_created>2010-11-12T13:14:15Z</date_created> | |||
<modified_id type="" | <modified_id type="" | ||
uri="https://{domain}/networking/rest/user/1524089492" | uri="https://{{domain}}/networking/rest/user/1524089492" | ||
displayValue="Peter Parker">1424089492</modified_id> | 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> | <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> | |||
<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> | </user> | ||
Line 72: | Line 115: | ||
Returns the fields requested by a dynamic search based on number of records, offset, sort column, sort order, and specified criteria. | Returns the fields requested by a dynamic search based on number of records, offset, sort column, sort order, and specified criteria. | ||
;Method:GET | ;Method:GET | ||
;URI:<tt> | ;URI:<tt>{{platformURL}}/rest/user?{query_parameters}</tt> | ||
:;Sample Search: | :;Sample Search: | ||
::<tt><nowiki>?fieldList=name,id & filter=name contains 'smith' & sortby='id'</nowiki></tt> | ::<tt><nowiki>?fieldList=name,id&filter=name contains 'smith' & sortby='id'</nowiki></tt> | ||
:: (Field names are in the [[#Fields|Fields]] section.) | :: (Field names are in the [[#Fields|Fields]] section.) | ||
Line 92: | Line 135: | ||
<username>admin@platform.com</username> | <username>admin@platform.com</username> | ||
<title/> | <title/> | ||
<reports_to/> | |||
<reports_to | |||
<zip/> | <zip/> | ||
<employee_number/> | <employee_number/> | ||
Line 101: | Line 143: | ||
<country/> | <country/> | ||
<created_id type="" | <created_id type="" | ||
uri="https://{domain}/networking/rest/user/5" | uri="https://{{domain}}/networking/rest/user/5" | ||
displayValue="Platform Admin">5</created_id> | displayValue="Platform Admin">5</created_id> | ||
<time_zone>12</time_zone> | <time_zone>12</time_zone> | ||
<modified_id type="" | <modified_id type="" | ||
uri="https://{domain}/networking/rest/user/16016a880c064ad1ba92115424851462" | uri="https://{{domain}}/networking/rest/user/16016a880c064ad1ba92115424851462" | ||
displayValue="Sheela Sarva">16016a880c064ad1ba92115424851462</modified_id> | displayValue="Sheela Sarva">16016a880c064ad1ba92115424851462</modified_id> | ||
<email>demo@platform.com</email> | <email>demo@platform.com</email> | ||
<last_name>Platform</last_name> | <last_name>Platform</last_name> | ||
<active>1</active> | <active>1</active> | ||
< | <accessibility_mode>1<accessibility_mode> | ||
<acts_as_delegate>1<acts_as_delegate> | |||
</record> | </record> | ||
Line 123: | Line 166: | ||
<username>myusername</username> | <username>myusername</username> | ||
<title/> | <title/> | ||
<reports_to/> | |||
<reports_to | |||
<zip/> | <zip/> | ||
<employee_number/> | <employee_number/> | ||
Line 132: | Line 174: | ||
<country/> | <country/> | ||
<created_id type="" | <created_id type="" | ||
uri="https://{domain}/networking/rest/user/123223323" | uri="https://{{domain}}/networking/rest/user/123223323" | ||
displayValue="Platform Admin">123223323</created_id> | displayValue="Platform Admin">123223323</created_id> | ||
<time_zone>12</time_zone> | <time_zone>12</time_zone> | ||
<modified_id type="" | <modified_id type="" | ||
uri="https://{domain}/networking/rest/user/123223323" | uri="https://{{domain}}/networking/rest/user/123223323" | ||
displayValue="Platform Admin">123223323</modified_id> | displayValue="Platform Admin">123223323</modified_id> | ||
<email>myusernamecp@gmail.com</email> | <email>myusernamecp@gmail.com</email> | ||
<last_name>Mostly</last_name> | <last_name>Mostly</last_name> | ||
<active>1</active> | <active>1</active> | ||
</record> | </record> | ||
Line 156: | Line 197: | ||
Adds a user record | Adds a user record | ||
;Method:POST | ;Method:POST | ||
;URI:<tt> | ;URI:<tt>{{platformURL}}/rest/user/</tt> | ||
;Request: | ;Request: | ||
:<syntaxhighlight lang="html4strict" enclose="div"> | :<syntaxhighlight lang="html4strict" enclose="div"> | ||
Line 166: | Line 207: | ||
<first_name>John</first_name> | <first_name>John</first_name> | ||
<username>userA@gmail.com</username> | <username>userA@gmail.com</username> | ||
<employee_number/> | |||
<single_sign_on>0</single_sign_on> | <single_sign_on>0</single_sign_on> | ||
< | <enable_mobile>true</enable_mobile> | ||
<fax/> | <fax/> | ||
<country/> | <country/> | ||
Line 179: | Line 221: | ||
<state/> | <state/> | ||
<title/> | <title/> | ||
< | <notify_info>1</notify_info> | ||
<reports_to>151b28b700dc45abbb12b65ea451fc97</reports_to><zip/> | <reports_to>151b28b700dc45abbb12b65ea451fc97</reports_to> | ||
<zip/> | |||
<alias/> | <alias/> | ||
<customer_language>en</customer_language> | <customer_language>en</customer_language> | ||
<team_id>1</team_id> | <team_id>1</team_id> // only required on add | ||
< | <accessProfileId>3</accessProfileId> // only required on add | ||
<accessibility_mode>1<accessibility_mode> | |||
<acts_as_delegate>1<acts_as_delegate> | |||
<application_id>appId</application_id> | |||
<role_ids>roleId1,roleID2</role_ids> | |||
</user> | </user> | ||
</platform> | </platform> | ||
Line 201: | Line 248: | ||
===Update a User Record=== | ===Update a User Record=== | ||
Updates data for | Updates data for a specified User. | ||
;Method:PUT | ;Method:PUT | ||
;URI:<tt> | ;URI:<tt>{{platformURL}}/rest/user/{recordId}</tt> | ||
;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. | ;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. | ||
Line 231: | Line 278: | ||
<zip/> | <zip/> | ||
<alias/> | <alias/> | ||
<customer_language>en</customer_language> | <customer_language>en</customer_language> | ||
<accessibility_mode>1<accessibility_mode> | |||
<acts_as_delegate>1<acts_as_delegate> | |||
<html_signature>test<html_signature> //can update only the record for the logged in user | |||
</user> | </user> | ||
</platform> | </platform> | ||
Line 248: | Line 298: | ||
===Update (Reset) Password for a User=== | ===Update (Reset) Password for a User=== | ||
Change the [[password]] | Change the [[password]] for a new or existing user. | ||
;Method:POST | ;Method:POST | ||
;Example: | ;Example: | ||
;URI:<tt> | ;URI:<tt>{{platformURL}}/rest/user/operation/updatePassword</tt> | ||
;Request: | ;Request: | ||
:<syntaxhighlight lang="html4strict" enclose="div"> | :<syntaxhighlight lang="html4strict" enclose="div"> | ||
Line 286: | Line 336: | ||
Change the [[password]] for the current user. | Change the [[password]] for the current user. | ||
;Method:POST | ;Method:POST | ||
;URI:<tt> | ;URI:<tt>{{platformURL}}/rest/user/operation/changePassword</tt> | ||
;Request: | ;Request: | ||
Line 307: | Line 357: | ||
</platform> | </platform> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
:See also: [[REST API:Error Codes]] | |||
===Deactivate a User Record=== | |||
Makes a User record inactive. | |||
;Method:DELETE | |||
;URI:<tt>{{platformURL}}/rest/user/{recordId}</tt> | |||
;Response: | |||
:<syntaxhighlight lang="html4strict" enclose="div"> | |||
<platform> | |||
<message> | |||
<code>0</code> | |||
<description>Success</description> | |||
</message> | |||
</platform> | |||
</syntaxhighlight> | |||
:See also: [[REST API:Error Codes]] | :See also: [[REST API:Error Codes]] | ||
===Delete a User Record=== | ===Delete a User Record=== | ||
Deletes a User record | Deletes a User record | ||
;Method:DELETE | ;Method:DELETE | ||
;URI:<tt> | ;URI:<tt>{{platformURL}}/rest/user/{recordId}?action=delete-forever </tt> | ||
;Response: | ;Response: | ||
:<syntaxhighlight lang="html4strict" enclose="div"> | :<syntaxhighlight lang="html4strict" enclose="div"> | ||
Line 324: | Line 390: | ||
:See also: [[REST API:Error Codes]] | :See also: [[REST API:Error Codes]] | ||
===Fields=== | ===Fields=== | ||
: | :''Notes:'' | ||
{| border="1" cellpadding="5" cellspacing="0" | :* 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. | |||
:{| border="1" cellpadding="5" cellspacing="0" | |||
! Name!!Type!!Attribute!!Required During Add!!Description!!Additional Information | ! Name!!Type!!Attribute!!Required During Add!!Description!!Additional Information | ||
|- | |- | ||
| id||String||Read Only||||[[Record | | id||String||Read Only||||[[Record Id]]|| | ||
|- | |- | ||
| first_name||String||Editable on Add/Update|||| || | | first_name||String||Editable on Add/Update|||| || | ||
Line 340: | Line 407: | ||
|- | |- | ||
| title||String||Editable on Add/Update|||||| | | title||String||Editable on Add/Update|||||| | ||
|- | |||
| accessibility mode||Boolean||Editable on Add/Update||||Options:<br/> | |||
1 - Enable accessibility mode<br/> | |||
0 - Disable accessibility mode<br/> | |||
|| | |||
|- | |||
| act as delegate||Boolean||Editable on Add/Update||||Options:<br/> | |||
1 - Delegated<br/> | |||
0 - Not delegated<br/> | |||
|| When delegation is enabled, logged in user can act on behalf of another user | |||
|- | |||
| html signature||String||Editable on Update|||| | |||
|| You are not allowed to edit signatures of other users. You are authorized to edit only your signature. You cannot fetch html_signature through Dynamic search API | |||
|- | |- | ||
| time_zone||Integer||Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]]||||''See:'' [[Time Zone Codes]] | | time_zone||Integer||Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]]||||''See:'' [[Time Zone Codes]] | ||
|- | |- | ||
| date_format||String||Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]]||||''See:'' [[Date | | date_format||String||Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]]||||''See:'' [[Date#Date/Time Formats|Date/Time Formats]] | ||
|- | |- | ||
| reports_to||String||Editable on Add/Update|||||| | | reports_to||String||Editable on Add/Update|| || User's manager/supervisor || | ||
|- | |- | ||
| employee_number||||Editable on Add/Update|||||| | | employee_number||||Editable on Add/Update|||||| | ||
Line 351: | Line 431: | ||
| language||String||Editable on Add/Update||align="center"|[[File:Checkmark.gif|link=]]||||Two letter language code that is available to tenant (ex: 'en', 'es', 'hi') | | language||String||Editable on Add/Update||align="center"|[[File:Checkmark.gif|link=]]||||Two letter language code that is available to tenant (ex: 'en', 'es', 'hi') | ||
|- | |- | ||
| email||String||Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]]|||| | | email||String||Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]] || || | ||
|- | |||
| username||String||Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]] || || | |||
|- | |- | ||
| | | site_name||String||Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]] || Optional. | ||
| When the name of a [[Site]] is specified, it designates the user as a ''site user'', rather than a platform user. | |||
|- | |- | ||
| password||String|| | | password||String||Writable on Add Only|| ||Password used to login | ||
| | | | ||
*Password is ''optional'' when creating a new user | |||
*Password is ''optional'' when creating a new user | : If not provided, a temporary password is generated and sent to the user/tenant via email | ||
:If | : ''Learn more: [[Manage_Email_Templates#User|Manage Email Templates - Forgot Reset Password Email]]'' | ||
:''Learn more: [[Manage_Email_Templates#User|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 | |||
|- | |||
| security_question||String||Editable on Add/Update|| || This question confirms the identity of the user who has forgotten the password.||security_question parameter values are: | |||
:1. In what city were you born? >> 1 | |||
:2. What is your first pet's name? >> 2 | |||
:3. What was your first teacher's name? >> 3 | |||
:4. Write my own security question >> 4 | |||
|- | |||
| custom_security_question||String||Editable on Add/Update|| || This question confirms the identity of the user who has forgotten the password. || If the custom_security_question and security_answer parameters are provided while creating a user through REST API call, then the value for security_question must be '4'. | |||
|- | |||
| security_answer||String||Editable on Add/Update|| || The expected answer.||If the custom_security_question and security_answer parameters are provided while creating a user through REST API call, then the value for security_question must be '4'. | |||
|- | |- | ||
| active||Boolean||Editable on Add/Update|||||| | | active||Boolean||Editable on Add/Update|| || || | ||
|- | |- | ||
| single_sign_on||Boolean||Editable on Add/Update|||||| | | single_sign_on||Boolean||Editable on Add/Update|||||| | ||
|- | |- | ||
| team_id ||Integer||align="center"| | | sso_type||Integer||Read Only||||Type of single sign on:<br/> | ||
1 - Delegated<br/> Authentication<br/> | |||
2 - SAML<br/> | |||
|| See: [[Single Sign On]] | |||
|- | |||
| federation_id||String||Read Only|| || || Used in [[Single_Sign_On#SAML|SAML]] authentication, if SAML is enabled | |||
|- | |||
| user_id_type ||Number||Editable on Add/Update||||1: User ID<br>2:Federated ID || Used in [[Single_Sign_On#SAML|SAML]] authentication, if SAML is enabled | |||
|- | |||
| enable_mobile ||Boolean||Editable on Add/Update|| || Allow mobile access to the platform || | |||
|- | |||
| team_id ||Integer||align="center"|Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]]|||| | |||
|- | |- | ||
| | | accessProfileId ||Integer||align="center"|Editable on Add/Update|| align="center"|[[File:Checkmark.gif|link=]]|||| | ||
|- | |- | ||
| phone||String||Editable on Add/Update|||||| | | phone||String||Editable on Add/Update|||||| | ||
Line 386: | Line 497: | ||
| country||String||Editable on Add/Update|||||| | | country||String||Editable on Add/Update|||||| | ||
|- | |- | ||
| | | notify_info||Boolean||Editable on Add/Update|| | ||
|Send the Welcome email message | |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. | |When enabled, a notification email is sent (containing the [[username]], welcome and login information) when a new user is added. | ||
Line 394: | Line 505: | ||
This value is not stored in the database, and is not returned by a GET. | This value is not stored in the database, and is not returned by a GET. | ||
|- | |- | ||
| | | base_currency ||String||Editable on Add/Update|||| The currency format displayed to the user, and used for data entry || | ||
|- | |- | ||
| force_password_change_on_login||Boolean||Editable on Add/Update|| | | force_password_change_on_login||Boolean||Editable on Add/Update|| | ||
Line 401: | Line 512: | ||
Default is 1 (new user is forced to change password on first login) | Default is 1 (new user is forced to change password on first login) | ||
<span id="force_security_question"></span> | |||
|- | |||
| force_security_question_change_on_login||Boolean||Editable 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 ||Date||Read Only||||Date and time of last login|| [[UTC Format]] | | last_login ||Date||Read Only||||Date and time of last login|| [[UTC Format]] | ||
Line 417: | Line 534: | ||
|- | |- | ||
| modified_id||Lookup||Read Only|||||| | | modified_id||Lookup||Read Only|||||| | ||
|- | |- | ||
| community_user_id||String||Read Only||||User's ID in the community|| | | community_user_id||String||Read Only||||User's ID in the community|| | ||
Line 426: | Line 541: | ||
| user_type||String||Read Only||||User type: Platform user (P) or Site User (S) | | user_type||String||Read Only||||User type: Platform user (P) or Site User (S) | ||
| | | | ||
*Platform Users are licensed [[Users]] who have a [[Login]] (to a [[Tenant]], which is provided by an [[ISV | *Platform Users are licensed [[Users]] who have a [[Login]] (to a [[Tenant]], which is provided by an [[ISV]] | ||
*Platform Users can be automatically included as Site Users (''Learn More: [[ | *Platform Users can be automatically included as Site Users (''Learn More: [[Community Tenant#Configure a Community Tenant|Configure a Community Tenant]]'') | ||
*Site Users are registered through a [[Sites|Site]] | *Site Users are registered through a [[Sites|Site]] | ||
|- | |- | ||
| alias||String||Editable on Add/Update||||User's alias in the community|| | | alias||String||Editable on Add/Update||||User's alias in the community|| | ||
|- | |||
| description ||String||Editable on Add/Update|||| User's self-description ||rowspan="5"| | |||
|- | |||
| photo_id ||image||Editable on Add/Update|||| ID of the User's picture.<br>Access: REST [[REST_API:document Resource|document Resource]]. | |||
|- | |- | ||
| | | thumbnail_photo_id ||image||Editable on Add/Update|| || ID of the thumbnail image.<br>Access: REST [[REST_API:document Resource|document Resource]]. | ||
|- | |||
| status ||String||Editable on Add/Update||||User's status | |||
|| | |- | ||
| date_status_updated ||date||Editable on Add/Update||||Last date and time user's status was changed | |||
|- | |- | ||
| tenant_id||String||Read Only|| || || | | tenant_id||String||Read Only|| || || | ||
Line 445: | Line 566: | ||
| customerId||String||Read Only||||Customer ID||The ID of the tenant where the user is logged in: | | customerId||String||Read Only||||Customer ID||The 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 host tenant ID, when logged in as a user for a normal (non-community) tenant. | ||
* The ID of | * The ID of the community tenant, when logged in as a community user. | ||
|- | |||
| flag_logged_in ||Boolean||Read only|||| True if the user is logged in || | |||
|- | |||
| custom field(s)||||||||[[User Fields]]||User can add fields of various type, including text, date, time, etc. | |||
|- | |||
| colspan="6" bgcolor="lightblue" style="height:7px" | <!-- SPACER ROW --> | |||
|- | |||
| colspan="6"| '''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. || | |||
|} | |} | ||
<noinclude> | |||
[[Category:REST API|user Resource]] | [[Category:REST API|user Resource]] | ||
</noinclude> |
Latest revision as of 09:54, 8 March 2023
Performs actions on User records via the REST API
Access Permissions
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://{yourDomain}/networking/rest/user/isSessionValid
- Response
- :<syntaxhighlight lang="xml" enclose="div">
<platform>
<user> <is_session_valid>true</is_session_valid> </user>
<message>
0
<description>Success</description>
</message>
</platform> </syntaxhighlight>
- See also: REST API:Error Codes
Get Information about the Logged-In User
Gets information about the logged in user.
- Method
- GET
- URI
- https://{yourDomain}/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://{yourDomain}/networking/rest/user/{user_id}
- Response
- <syntaxhighlight lang="html4strict" enclose="div">
<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> <accessibility_mode>1<accessibility_mode> <acts_as_delegate>1<acts_as_delegate> <html_signature>test<html_signature> <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://{yourDomain}/networking/rest/user/1524089492" displayValue="Peter Parker">1424089492</created_id> <date_created>2010-11-12T13:14:15Z</date_created> <modified_id type="" uri="https://{yourDomain}/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>
<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://{yourDomain}/rest/user/123qwe456rty" displayValue="John Smith">123qwe456rty</reports_to> </user>
<message>
0
<description>Success</description>
</message>
</platform> </syntaxhighlight>
- 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://{yourDomain}/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
- {fieldname} specifies an individual field (e.g. name)
- (Use the REST API:field Resource to get a complete list of fields.)
- For a Composite Object, specify {alias}.{fieldname} to select a related-record field, where the alias is defined in the Object Relationships.
- For a Database View, specify {alias}.{fieldname}, where the object alias is defined in the Database View.
- alias.* specifies all fields in the aliased object.
- filter - Filtering criteria to filter the records
- For more examples, see Filter Expressions in REST APIs and the REST API Examples.)
- 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:
- <syntaxhighlight lang="xml" enclose="div">
<platform>
<status>
<packageDeploy>
...
</packageDeploy>
</status>
<message>
0
<description>Success</description>
</message>
<totalRecordCount>N</totalRecordCount>
</platform> </syntaxhighlight>
- 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)
- sortBy - Field name for primary sort
- For more information, see: Specifying Query Parameters in REST APIs
- Response
- <syntaxhighlight lang="html4strict" enclose="div">
<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://{yourDomain}/networking/rest/user/5" displayValue="Platform Admin">5</created_id>
<time_zone>12</time_zone> <modified_id type="" uri="https://{yourDomain}/networking/rest/user/16016a880c064ad1ba92115424851462"
displayValue="Sheela Sarva">16016a880c064ad1ba92115424851462</modified_id>
<email>demo@platform.com</email> <last_name>Platform</last_name> <active>1</active> <accessibility_mode>1<accessibility_mode> <acts_as_delegate>1<acts_as_delegate> </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://{yourDomain}/networking/rest/user/123223323" displayValue="Platform Admin">123223323</created_id>
<time_zone>12</time_zone> <modified_id type=""
uri="https://{yourDomain}/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>
0
<description>Success</description>
</message>
<recordCount>2</recordCount>
</platform> </syntaxhighlight>
- See also: REST API:Error Codes
Add a User Record
Adds a user record
- Method
- POST
- URI
- https://{yourDomain}/networking/rest/user/
- Request
- <syntaxhighlight lang="html4strict" enclose="div">
<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 <accessibility_mode>1<accessibility_mode> <acts_as_delegate>1<acts_as_delegate> <application_id>appId</application_id> <role_ids>roleId1,roleID2</role_ids> </user>
</platform> </syntaxhighlight>
- Response
- <syntaxhighlight lang="html4strict" enclose="div">
<platform>
<message>
0
<description>Success</description>
<id>1818437421</id> // id of the user that was added
</message>
</platform> </syntaxhighlight>
- See also: REST API:Error Codes
Update a User Record
Updates data for a specified User.
- Method
- PUT
- URI
- https://{yourDomain}/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.
- <syntaxhighlight lang="html4strict" enclose="div">
<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> <accessibility_mode>1<accessibility_mode> <acts_as_delegate>1<acts_as_delegate> <html_signature>test<html_signature> //can update only the record for the logged in user </user>
</platform> </syntaxhighlight>
- Response
- <syntaxhighlight lang="html4strict" enclose="div">
<platform>
<message>
0
<description>Success</description>
<id>1818437421</id> // id of the user that was updated
</message>
</platform> </syntaxhighlight>
- See also: REST API:Error Codes
Update (Reset) Password for a User
Change the password for a new or existing user.
- Method
- POST
- Example
- URI
- https://{yourDomain}/networking/rest/user/operation/updatePassword
- Request
- <syntaxhighlight lang="html4strict" enclose="div">
<platform>
<user> <id>da80488c7e8d4f5a83c66a3bb2590295</id> <password>abc</password> <longjump_reset_user>1</longjump_reset_user> <skip_email>1</skip_email> </user>
</platform> </syntaxhighlight>
- 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.
- 0 = Send the Reset Password Email Message notification. (default)
- 1 = No message is sent.
- Response
- <syntaxhighlight lang="html4strict" enclose="div">
<platform>
<message>
0
<description>Success</description>
</message>
</platform> </syntaxhighlight>
- See also: REST API:Error Codes
Change Password for the Current User
Change the password for the current user.
- Method
- POST
- URI
- https://{yourDomain}/networking/rest/user/operation/changePassword
- Request
- <syntaxhighlight lang="html4strict" enclose="div">
<platform>
<user> <old_password>world44</old_password> <password>pass123</password> </user>
</platform> </syntaxhighlight>
- Response
- <syntaxhighlight lang="html4strict" enclose="div">
<platform>
<message>
0
<description>Success</description>
</message>
</platform> </syntaxhighlight>
- See also: REST API:Error Codes
Deactivate a User Record
Makes a User record inactive.
- Method
- DELETE
- URI
- https://{yourDomain}/networking/rest/user/{recordId}
- Response
- <syntaxhighlight lang="html4strict" enclose="div">
<platform>
<message>
0
<description>Success</description>
</message>
</platform> </syntaxhighlight>
- See also: REST API:Error Codes
Delete a User Record
Deletes a User record
- Method
- DELETE
- URI
- https://{yourDomain}/networking/rest/user/{recordId}?action=delete-forever
- Response
- <syntaxhighlight lang="html4strict" enclose="div">
<platform>
<message>
0
<description>Success</description>
</message>
</platform> </syntaxhighlight>
- 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.
Name Type Attribute Required During Add Description Additional Information id String Read Only Record Id first_name String Editable on Add/Update last_name String Editable on Add/Update company String Editable on Add/Update title String Editable on Add/Update accessibility mode Boolean Editable on Add/Update Options:
1 - Enable accessibility mode
0 - Disable accessibility mode
act as delegate Boolean Editable on Add/Update Options:
1 - Delegated
0 - Not delegated
When delegation is enabled, logged in user can act on behalf of another user html signature String Editable on Update You are not allowed to edit signatures of other users. You are authorized to edit only your signature. You cannot fetch html_signature through Dynamic search API time_zone Integer Editable on Add/Update See: Time Zone Codes date_format String Editable on Add/Update See: Date/Time Formats reports_to String Editable on Add/Update User's manager/supervisor employee_number Editable on Add/Update language String Editable on Add/Update Two letter language code that is available to tenant (ex: 'en', 'es', 'hi') email String Editable on Add/Update username String Editable on Add/Update site_name String Editable 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. password String Writable on Add Only Password used to 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
security_question String Editable on Add/Update This question confirms the identity of the user who has forgotten the password. security_question parameter values are: - 1. In what city were you born? >> 1
- 2. What is your first pet's name? >> 2
- 3. What was your first teacher's name? >> 3
- 4. Write my own security question >> 4
custom_security_question String Editable on Add/Update This question confirms the identity of the user who has forgotten the password. If the custom_security_question and security_answer parameters are provided while creating a user through REST API call, then the value for security_question must be '4'. security_answer String Editable on Add/Update The expected answer. If the custom_security_question and security_answer parameters are provided while creating a user through REST API call, then the value for security_question must be '4'. active Boolean Editable on Add/Update single_sign_on Boolean Editable on Add/Update sso_type Integer Read Only Type of single sign on:
1 - Delegated
Authentication
2 - SAML
See: Single Sign On federation_id String Read Only Used in SAML authentication, if SAML is enabled user_id_type Number Editable on Add/Update 1: User ID
2:Federated IDUsed in SAML authentication, if SAML is enabled enable_mobile Boolean Editable on Add/Update Allow mobile access to the platform
team_id Integer Editable on Add/Update accessProfileId Integer Editable on Add/Update phone String Editable on Add/Update mobile String Editable on Add/Update fax String Editable on Add/Update street String Editable on Add/Update city String Editable on Add/Update state String Editable on Add/Update zip String Editable on Add/Update country String Editable on Add/Update notify_info Boolean Editable 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 String Editable on Add/Update The currency format displayed to the user, and used for data entry force_password_change_on_login Boolean Editable 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_login Boolean Editable 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 Date Read Only Date and time of last login UTC Format date_last_password_change date Read Only Date and time of last password change UTC Format customer_language String Read Only Default Language, specified in My Information full_name String Read Only Full name of the user date_created Date Read Only UTC Format created_id Lookup Read Only date_modified Date Read Only UTC Format modified_id Lookup Read Only community_user_id String Read Only User's ID in the community auto_generated_community_user_record Boolean Read Only <true> for the initial admin user and any other user IDs automatically generated for the community user_type String Read Only User type: Platform user (P) or Site User (S) alias String Editable on Add/Update User's alias in the community description String Editable on Add/Update User's self-description photo_id image Editable on Add/Update ID of the User's picture.
Access: REST document Resource.thumbnail_photo_id image Editable on Add/Update ID of the thumbnail image.
Access: REST document Resource.status String Editable on Add/Update User's status date_status_updated date Editable on Add/Update Last date and time user's status was changed tenant_id String Read 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_id String Read Only customerId String Read Only Customer ID The 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 Boolean Read only True if the user is logged in custom field(s) User Fields User can add fields of various type, including text, date, time, etc. 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.