REST API:role Resource

From AgileApps Support Wiki
Revision as of 19:16, 1 July 2011 by imported>Aeric

Performs actions on Role records via the REST API

Requirements

You need to understand Global vs. Individual Role Assignments

Access Permissions

Lock-tiny.gif

Users that have the Access Control/User Management permission can use the role Resource in the REST API 

Get a Role Record

Identifies and retrieves a single Role record

Method
GET
URI
https://{domain}/networking/rest/role/{recordId}
Response
<syntaxhighlight lang="xml" enclose="div">

<platform> <role>

   <id>1</id>
   <name>System Administrator</name>
   <description>System Generated Role</description>
   <ip_addr_range/>
   <date_created>2010-11-12T13:14:15Z</date_created>
   <created_id type="USER" 
     uri="https://{domain}/networking/rest/user/3" 
     displayValue=" System">3</created_id>
   <date_modified>2010-11-12T13:14:15Z</date_modified>
   <modified_id type="USER" 
     uri="https://{domain}/networking/rest/user/3" 
     displayValue=" System">3</modified_id>
   <users>
     <id>479771292</id>
     <user_id type="USER" 
       uri="https://{domain}/networking/rest/user/1424089492" 
       displayValue="Dev User">1424089492</user_id>
     <team_id type="TEAM" 
       uri="https://{domain}/networking/rest/team/1" 
       displayValue="Dev Team">1</team_id>
   </users>
   <users>
     <id>568445387</id>
     <user_id type="USER" 
       uri="https://{domain}/networking/rest/user/16016a880c064ad1ba92115424851462" 
       displayValue="QA User">16016a880c064ad1ba92115424851462</user_id>
     <team_id type="TEAM" 
       uri="https://{domain}/networking/rest/team/888961917" 
       displayValue="QA Team">888961917</team_id>
   </users>
   <globally_manage_permission>
       <team_level_global_record_access_permission>
           <view_capability>true</view_capability>
           <update_capability>true</update_capability>
           <delete_capability>true</delete_capability>
       </team_level_global_record_access_permission>
   
       <self_record_global_access_permission>
           <create_capability>true</create_capability>
           <owner_delete_capability>true</owner_delete_capability>
       </self_record_global_access_permission>
   
       <other_global_access_permission>
           <view_web_tabs>true</view_web_tabs>
           <administrative_areas>true</administrative_areas>
       </other_global_access_permission>
   </globally_manage_permission>
   
   <individually_manage_permission>    
       <team_level_record_access_permission>
           <object_id type="ObjectA" uri="" displayValue="ObjectA">ObjectA</object_id>
           <view_capability>true</view_capability>
           <update_capability>true</update_capability>
           <delete_capability>true</delete_capability>
       </team_level_record_access_permission>        
       <self_record_access_permission>
           <object_id type="ObjectA" uri="" displayValue="ObjectA">ObjectA</object_id>
           <create_capability>true</create_capability>
           <owner_delete_capability>true</owner_delete_capability>
       </self_record_access_permission>        
       <web_tabs_access_permission>
           <object_id type="ObjectC" 
             uri="" 
             displayValue="ObjectC">1555611998yui319155269</object_id>
           <create_capability>true</create_capability>
       </web_tabs_access_permission>
       <administrative_permission>
           <user_management>true</user_management>
           <team_record_change_ownership>true</team_record_change_ownership>
           <self_record_change_ownership>false</self_record_change_ownership>
           <personalize_user_interface>false</personalize_user_interface>
           <create_delete_view_report>false</create_delete_view_report>
           <export_view_report>false</export_view_report>
           <view_report_visible_to_other>false</view_report_visible_to_other>
           <manage_global_view_report>true</manage_global_view_report>
           <print_view_report>true</print_view_report>
           <manage_templates>false</manage_templates>
           <lead_case_assignment_policy>true</lead_case_assignment_policy>
           <override_product_pricing>false</override_product_pricing>
           <manage_self_service_portal>false</manage_self_service_portal>
           <manage_product_and_price_book>true</manage_product_and_price_book>
           <access_mass_data_operation>true</access_mass_data_operation>
           <import_export_data>true</import_export_data>
           <manage_audit_log>true</manage_audit_log>
           <manage_recycle_bin>false</manage_recycle_bin>
           <manage_tags>true</manage_tags>
           <customize_objects>true</customize_objects>
           <manage_application>true</manage_application>
           <manage_develop_features>false</manage_develop_features>
           <manage_translation_workbench>false</manage_translation_workbench>
           <manage_tenant_and_company_capabilities>true</manage_tenant_and_company_capabilities>
           <manage_discussion_category>true</manage_discussion_category>
           <proxy_login_access>true</proxy_login_access>
           <proxy_login_configuration>false</proxy_login_configuration>
           <customer_support_login>true</customer_support_login>
           <versioning>false</versioning>
       </administrative_permission>
   </individually_manage_permission>

</role>

<message>

   0
   <description>Success</description>

</message> </platform> </syntaxhighlight>

See also: REST API:Error Codes

Dynamic Search

Search for Role records, specifying the fields to retrieve, number of records, offset, sort column, sort order, criteria

Method
GET
URI
https://{domain}/networking/rest/role/{recordId}?{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
  • 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)
For more information, see: Specifying Query Parameters in REST APIs
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <record>
       <id>1</id>
       <created_id type="" 
         uri="https://{domain}/networking/rest/user/3" 
         displayValue=" System">3</created_id>
       <modified_id type="" 
         uri="https://{domain}/networking/rest/user/3" 
         displayValue=" System">3</modified_id>
       <date_modified>2010-11-12T13:14:15Z</date_modified>
       <object_id>ROLE</object_id>
       <name>System Administrator</name>
       <date_created>2010-11-12T13:14:15Z</date_created>
   </record>
   <record>
       <id>2</id>
       <created_id type="" 
         uri="https://{domain}/networking/rest/user/3" 
         displayValue=" System">3</created_id>
       <modified_id type="" 
         uri="https://{domain}/networking/rest/user/3" 
         displayValue=" System">3</modified_id>
       <date_modified>2010-11-12T13:14:15Z</date_modified>
       <object_id>ROLE</object_id>
       <name>Sales Manager</name>
       <date_created>2010-11-12T13:14:15Z</date_created>
   </record>
   <record>
       <id>3</id>
       <created_id type="" 
         uri="https://{domain}/networking/rest/user/3" 
         displayValue=" System">3</created_id>
       <modified_id type="" 
         uri="https://{domain}/networking/rest/user/3" 
         displayValue=" System">3</modified_id>
       <date_modified>2010-11-12T13:14:15Z</date_modified>
       <object_id>ROLE</object_id>
       <name>Sales Rep</name>
       <date_created>2010-11-12T13:14:15Z</date_created>
   </record>
   <message>
       0
       <description>Success</description>
   </message>
   <recordCount>3</recordCount>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Add a Role Record

Add a Role record

Method
POST
URI
https://{domain}/networking/rest/role
Request
<syntaxhighlight lang="xml" enclose="div">

<platform> <role>

   <name>Manager</name>    
   
   <globally_manage_permission>
       <team_level_global_record_access_permission>
           <view_capability>true</view_capability>            
       </team_level_global_record_access_permission>
   
       <self_record_global_access_permission>
           <create_capability>true</create_capability>
           <owner_delete_capability>true</owner_delete_capability>
       </self_record_global_access_permission>
   
       <other_global_access_permission>
           <view_web_tabs>true</view_web_tabs>            
       </other_global_access_permission>
   </globally_manage_permission>
   
   <individually_manage_permission>
   
       <team_level_record_access_permission>
           <object_id type="ObjectA" 
             uri="" 
             displayValue="ObjectA">ObjectA</object_id>
           <view_capability>true</view_capability>
           <update_capability>true</update_capability>
           <delete_capability>true</delete_capability>
       </team_level_record_access_permission>
       
       <self_record_access_permission>
           <object_id type="ObjectB" 
             uri="" 
             displayValue="ObjectB">ObjectB</object_id>
           <create_capability>true</create_capability>
           <owner_delete_capability>true</owner_delete_capability>
       </self_record_access_permission>
       <web_tabs_access_permission>
           <object_id type="ObjectC" 
             uri="" 
             displayValue="ObjectC">1555611998yui319155269</object_id>
           <create_capability>true</create_capability>
       </web_tabs_access_permission>
       <administrative_permission>
           <user_management>true</user_management>
           <team_record_change_ownership>true</team_record_change_ownership>
           <self_record_change_ownership>false</self_record_change_ownership>
           <personalize_user_interface>false</personalize_user_interface>        
           <manage_translation_workbench>false</manage_translation_workbench>            
       </administrative_permission>
   </individually_manage_permission>

</role> </platform> </syntaxhighlight>

Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>
       <id>1818437421</id>      // id of the role that is just been added
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Update a Role Record

Update a Role record

Method
PUT
URI
https://{domain}/networking/rest/role/{recordId}
Request
<syntaxhighlight lang="xml" enclose="div">

<platform> <role>

   <name>Team Member</name>    
   
   <globally_manage_permission>
       <team_level_global_record_access_permission>
           <view_capability>true</view_capability>            
       </team_level_global_record_access_permission>
   
       <self_record_global_access_permission>
           <create_capability>true</create_capability>
           <owner_delete_capability>false</owner_delete_capability>
       </self_record_global_access_permission>
   
       <other_global_access_permission>
           <view_web_tabs>false</view_web_tabs>            
       </other_global_access_permission>
   </globally_manage_permission>
   
   <individually_manage_permission>
       <team_level_record_access_permission>
           <object_id type="ObjectA" uri="" displayValue="ObjectA">ObjectA</object_id>
           <view_capability>true</view_capability>
           <update_capability>true</update_capability>
           <delete_capability>false</delete_capability>
       </team_level_record_access_permission>    
       <web_tabs_access_permission>
           <object_id type="ObjectB" 
             uri="" 
             displayValue="ObjectB">1555611998yui319155269</object_id>
           <create_capability>true</create_capability>
       </web_tabs_access_permission>
       <administrative_permission>
           <user_management>true</user_management>
           <team_record_change_ownership>true</team_record_change_ownership>
           <self_record_change_ownership>true</self_record_change_ownership>
           <personalize_user_interface>false</personalize_user_interface>        
           <manage_translation_workbench>false</manage_translation_workbench>            
       </administrative_permission>
   </individually_manage_permission>

</role> </platform> </syntaxhighlight>

Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>
       <id>1818437421</id>      // ID of the role that has been updated
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Delete a Role Record

Delete a Role record

Method
DELETE
URI
https://{domain}/networking/rest/role/{recordId}
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>        
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes


Fields

Field Name Type Attribute Required During Add Description Additional Information
id Integer Read Only Record Identifier
name String Editable on Add/Update Checkmark.gif Role Name
description String Editable on Add/Update Role description
ip_addr_range Role Based IP Login Restriction
date_created Date Read Only UTC Format
created_id Lookup Read Only User ID
date_modified Date Read Only UTC Format
modified_id Lookup Read Only User ID


Users Tag
Tag Field Type Attribute Required During Add Description Additional Information
users Tag Read Only Users attached to this Role
id String Read Only Record Identifier
user_id Lookup Read Only User ID
team_id Lookup Read Only Team ID


Permission Hierarchy

Use these groups of tags and fields in Response transactions.

Tag Permission Tag / Flag Type Attribute Required During Add Description Additional Information
globally_manage_permission Tag Manage permissions globally
team_level_global_record_access_permission Tag Globally enabled/disabled view, update and delete record permissions for all the objects belongs to user's team
view_capability Boolean Editable on Add/Update View
update_capability Boolean Editable on Add/Update Update
delete_capability Boolean Editable on Add/Update Delete
self_record_global_access_permission Tag Globally enabled/disabled create and self delete record permissions for all the objects belongs to user
create_capability Boolean Editable on Add/Update
owner_delete_capability Boolean Editable on Add/Update
other_global_access_permission Tag Globally enabled/disabled permissions for tab access and admin permissions
view_web_tabs Boolean Editable on Add/Update Web Tabs permissions
administrative_areas Boolean Editable on Add/Update
individually_manage_permission Tag Manage Permissions Individually
team_level_record_access_permission Tag Individually enabled/disabled (view, update and delete record) permissions for all the of the objects belongs to user's team
object_id lookup Editable on Add/Update
view_capability Boolean Editable on Add/Update View
update_capability Boolean Editable on Add/Update Update
delete_capability Boolean Editable on Add/Update Delete
self_record_access_permission Tag Individually enabled/disabled (create and self delete record) permissions for all the objects belongs to user
object_id lookup Editable on Add/Update
create_capability Boolean Editable on Add/Update
owner_delete_capability Boolean Editable on Add/Update
web_tabs_access_permission Tag Individually enabled/disabled create permission for all the web tabs
object_id lookup Editable on Add/Update
create_capability Boolean Editable on Add/Update
administrative_permission Tag Set of individually enabled/disabled Administrative Permissions
user_management Boolean Editable on Add/Update Access Control/User Management
team_record_change_ownership Boolean Editable on Add/Update Change Ownership of my Team’s Records
self_record_change_ownership Boolean Editable on Add/Update Change Ownership of Self Owned Records
personalize_user_interface Boolean Editable on Add/Update Personalize User Interface
create_delete_view_report Boolean Editable on Add/Update Create/Delete Views/Reports/Homepages
export_view_report Boolean Editable on Add/Update Export Views and Reports
view_report_visible_to_other Boolean Editable on Add/Update Make Views/Reports Visible to Others
manage_global_view_report Boolean Editable on Add/Update Manage Global Views/Reports
print_view_report Boolean Editable on Add/Update Print Views and Reports
manage_templates Boolean Editable on Add/Update
lead_case_assignment_policy Boolean Editable on Add/Update Lead and Case Assignment Policies
override_product_pricing Boolean Editable on Add/Update
manage_product_and_price_book Boolean Editable on Add/Update Manage Product and Price Book
access_mass_data_operation Boolean Editable on Add/Update Access Mass Data Operations
import_export_data Boolean Editable on Add/Update Import and Export Data
manage_audit_log Boolean Editable on Add/Update Manage Audit Log
manage_recycle_bin Boolean Editable on Add/Update Manage Recycle Bin
manage_tags Boolean Editable on Add/Update Manage Tags
customize_objects Boolean Editable on Add/Update Customize Objects
manage_application Boolean Editable on Add/Update Manage Applications
manage_package Boolean Editable on Add/Update Manage Packages
manage_develop_features Boolean Editable on Add/Update Manage Develop Features
manage_translation_workbench Boolean Editable on Add/Update Manage Translation Workbench
manage_tenant_and_company_capabilities Boolean Editable on Add/Update Manage Tenants and Company Capabilities
manage_discussion_category Boolean Editable on Add/Update Manage Discussion Categories
proxy_login_access Boolean Editable on Add/Update Proxy Login Access
proxy_login_configuration Boolean Editable on Add/Update
customer_support_login Boolean Editable on Add/Update Customer Support Login
versioning Boolean Editable on Add/Update Administer Versioning