REST API:userTeam Resource

From AgileApps Support Wiki
Revision as of 22:04, 26 July 2011 by imported>Aeric (Text replace - 'Record Identifier' to 'Record Id')

Performs actions on records in the User/Team join table via the REST API.

Thumbsup.gif

Tip: You can avoid processing join tables by working with Composite Objects.

Access Permissions

Lock-tiny.gif

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

Get a User Team Record

Identifies and retrieves a single User Team record

Method
GET
URI
http://host/networking/rest/userTeam/{recordId}
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <userTeam>
       <id>568445387</id>
       <user_id type="USER" 
         uri="https://{domain}/networking/rest/user/16016a880c064ad1ba92115424851462" 
         displayValue="A. User">16016a880c064ad1ba92115424851462</user_id>
       <team_id type="TEAM" 
         uri="https://{domain}/networking/rest/team/888961917" 
         displayValue="Child Team">888961917</team_id>
       <role_id type="ROLE" 
         uri="https://{domain}/networking/rest/role/1" 
         displayValue="System Administrator">1</role_id>
       <flag_primary>true</flag_primary>
       <comments>Add During User Addition</comments>
       <date_created>2010-11-12T13:14:15Z</date_created>
       <created_id type="USER" 
         uri="https://{domain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</created_id>
       <date_modified>2010-11-12T13:14:15Z</date_modified>
       <modified_id type="USER" 
         uri="https://{domain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</modified_id>
   </userTeam>
   <message>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Dynamic Search

Provides a dynamic search based on fields, number of records, offset, sort column, sort order or criteria

Method
GET
URI
https://{domain}/networking/rest/userTeam?{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>1010</id>
       <created_id type="" 
         uri="https://{domain}/networking/rest/user/3" 
         displayValue="System">3</created_id>
       <flag_primary>1</flag_primary>
       <modified_id type="" 
         uri="https://{domain}/networking/rest/user/3" 
         displayValue="System">3</modified_id>
       <role_id type="" 
         uri="https://{domain}/networking/rest/role/1" 
         displayValue="System Administrator">1</role_id>
       <date_modified>2010-11-12T13:14:15Z</date_modified>
       <object_id>USER_TEAM</object_id>
       <user_id type="" 
         uri="https://{domain}/networking/rest/user/1" 
         displayValue=" Self Service Portal">1</user_id>
       <date_created>2010-11-12T13:14:15Z</date_created>
       <team_id type="" 
         uri="https://{domain}/networking/rest/team/1" 
         displayValue="LongJump Team">1</team_id>
   </record>
   <record>
       <id>1634932137</id>
       <created_id type="" 
         uri="https://{domain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</created_id>
       <flag_primary>1</flag_primary>
       <modified_id type="" 
         uri="https://{domain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</modified_id>
       <role_id type="" 
         uri="https://{domain}/networking/rest/role/1" 
         displayValue="System Administrator">1</role_id>
       <date_modified>2010-11-12T13:14:15Z</date_modified>
       <object_id>USER_TEAM</object_id>
       <user_id type="" 
         uri="https://{domain}/networking/rest/user/1396457456" 
         displayValue="Support Agent">1396457456</user_id>
       <date_created>2010-11-12T13:14:15Z</date_created>
       <team_id type="" 
         uri="https://{domain}/networking/rest/team/1" 
         displayValue="LongJump Team">1</team_id>
   </record>
   <record>
       <id>10163086</id>
       <created_id type="" 
         uri="https://{domain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</created_id>
       <flag_primary>1</flag_primary>
       <modified_id type="" 
         uri="https://{domain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</modified_id>
       <role_id type="" 
         uri="https://{domain}/networking/rest/role/1" 
         displayValue="System Administrator">1</role_id>
       <date_modified>2010-11-12T13:14:15Z</date_modified>
       <object_id>USER_TEAM</object_id>
       <user_id type="" 
         uri="https://{domain}/networking/rest/user/4" 
         displayValue="Open Ownership">4</user_id>
       <date_created>2010-11-12T13:14:15Z</date_created>
       <team_id type="" 
         uri="https://{domain}/networking/rest/team/888961917" 
         displayValue="Child TEam">888961917</team_id>
   </record>
   <message>
       0
       <description>Success</description>
   </message>
   <recordCount>3</recordCount>

</platform> </syntaxhighlight>

Add a User Team Record

Adds a User Team record

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

<platform>

   <userTeam>
       <user_id>16016a880c064ad1ba92115424851462</user_id>
       <team_id>123123</team_id>
       <role_id>2</role_id>
       <flag_primary>true</flag_primary>
       <comments>Team Manager Role for Team A</comments>        
   </userTeam>    

</platform> </syntaxhighlight>

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

<platform>

   <message>
       0
       <description>Success</description>
       <id>18184374</id>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Update a User Team Record

Updates a User Team record

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

<platform>

   <userTeam>
       <team_id>12312345</team_id>
       <role_id>3</role_id>
       <flag_primary>false</flag_primary>
       <comments>Team Manager Role for Team A</comments>        
   </userTeam>    

</platform> </syntaxhighlight>

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

<platform>

   <message>
       0
       <description>Success</description>
       <id>18184374</id>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Delete a User Team Record

Updates a User Team record

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

<platform>

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

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Fields

Name Type Attribute Required During Add Description Additional Information
id Integer Read Only Record Id
user_id Lookup Writable on Add only Checkmark.gif User ID
team_id Lookup Editable on Add/Update Checkmark.gif Team ID
role_id Lookup Editable on Add/Update Checkmark.gif Role ID
flag_primary Boolean Editable on Add/Update Flag Team as Primary Team
comments String Editable on Add/Update Checkmark.gif
date_created Date Read Only UTC Format
created_id Lookup Read Only User ID
date_modified Date Read Only Date the record was last modified UTC Format
modified_id Lookup Read Only User ID