Difference between revisions of "REST API:userTeam Resource"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
 
(6 intermediate revisions by the same user not shown)
Line 3: Line 3:
    
    
===Access Permissions===
===Access Permissions===
{{permissions|Access Control/User Management|use the userTeam Resource in the [[REST API]]}}
{{PermissionRef|User Management|use the userTeam Resource in the [[REST API]]}}


===Get a User Team Record===
===Get a User Team Record===
Identifies and retrieves a single User Team record  
Identifies and retrieves a single User Team record  
;Method:GET
;Method:GET
;URI:<tt><nowiki>http://host/networking/rest/userTeam/{recordId}</nowiki></tt>
;URI:<tt>{{platformURL}}/rest/userTeam/{recordId}</tt>
;Response:
;Response:
:<syntaxhighlight lang="xml" enclose="div">
:<syntaxhighlight lang="xml" enclose="div">
Line 15: Line 15:
         <id>568445387</id>
         <id>568445387</id>
         <user_id type="USER"  
         <user_id type="USER"  
           uri="https://{domain}/networking/rest/user/16016a880c064ad1ba92115424851462"  
           uri="https://{{domain}}/networking/rest/user/16016a880c064ad1ba92115424851462"  
           displayValue="A. User">16016a880c064ad1ba92115424851462</user_id>
           displayValue="A. User">16016a880c064ad1ba92115424851462</user_id>
         <team_id type="TEAM"  
         <team_id type="TEAM"  
           uri="https://{domain}/networking/rest/team/888961917"  
           uri="https://{{domain}}/networking/rest/team/888961917"  
           displayValue="Child Team">888961917</team_id>
           displayValue="Child Team">888961917</team_id>
         <role_id type="ROLE"  
         <role_id type="ROLE"  
           uri="https://{domain}/networking/rest/role/1"  
           uri="https://{{domain}}/networking/rest/role/1"  
           displayValue="System Administrator">1</role_id>
           displayValue="System Administrator">1</role_id>
         <flag_primary>true</flag_primary>
         <flag_primary>true</flag_primary>
Line 27: Line 27:
         <date_created>2010-11-12T13:14:15Z</date_created>
         <date_created>2010-11-12T13:14:15Z</date_created>
         <created_id type="USER"  
         <created_id type="USER"  
           uri="https://{domain}/networking/rest/user/1424089492"  
           uri="https://{{domain}}/networking/rest/user/1424089492"  
           displayValue="Admin LongJump">1424089492</created_id>
           displayValue="Admin LongJump">1424089492</created_id>
         <date_modified>2010-11-12T13:14:15Z</date_modified>
         <date_modified>2010-11-12T13:14:15Z</date_modified>
         <modified_id type="USER"  
         <modified_id type="USER"  
           uri="https://{domain}/networking/rest/user/1424089492"  
           uri="https://{{domain}}/networking/rest/user/1424089492"  
           displayValue="Admin LongJump">1424089492</modified_id>
           displayValue="Admin LongJump">1424089492</modified_id>
     </userTeam>
     </userTeam>
Line 49: Line 49:
;Method:GET
;Method:GET


;URI:<tt><nowiki>https://{domain}/networking/rest/userTeam?{query_parameters}</nowiki></tt>
;URI:<tt>{{platformURL}}/rest/userTeam?{query_parameters}</tt>


:;Sample Search:
:;Sample Search:
::<tt><nowiki>?fieldList=* & filter=name contains 'smith' & sortby='id'</nowiki></tt>
::<tt><nowiki>?fieldList=*&filter=flag_primary equals '1' & sortby='id'</nowiki></tt>
:: (Field names are in the [[#Fields|Fields]] section.)
:: (Field names are in the [[#Fields|Fields]] section.)


Line 63: Line 63:
         <id>1010</id>
         <id>1010</id>
         <created_id type=""  
         <created_id type=""  
           uri="https://{domain}/networking/rest/user/3"  
           uri="https://{{domain}}/networking/rest/user/3"  
           displayValue="System">3</created_id>
           displayValue="System">3</created_id>
         <flag_primary>1</flag_primary>
         <flag_primary>1</flag_primary>
         <modified_id type=""  
         <modified_id type=""  
           uri="https://{domain}/networking/rest/user/3"  
           uri="https://{{domain}}/networking/rest/user/3"  
           displayValue="System">3</modified_id>
           displayValue="System">3</modified_id>
         <role_id type=""  
         <role_id type=""  
           uri="https://{domain}/networking/rest/role/1"  
           uri="https://{{domain}}/networking/rest/role/1"  
           displayValue="System Administrator">1</role_id>
           displayValue="System Administrator">1</role_id>
         <date_modified>2010-11-12T13:14:15Z</date_modified>
         <date_modified>2010-11-12T13:14:15Z</date_modified>
         <object_id>USER_TEAM</object_id>
         <object_id>USER_TEAM</object_id>
         <user_id type=""  
         <user_id type=""  
           uri="https://{domain}/networking/rest/user/1"  
           uri="https://{{domain}}/networking/rest/user/1"  
           displayValue=" Self Service Portal">1</user_id>
           displayValue=" Self Service Portal">1</user_id>
         <date_created>2010-11-12T13:14:15Z</date_created>
         <date_created>2010-11-12T13:14:15Z</date_created>
         <team_id type=""  
         <team_id type=""  
           uri="https://{domain}/networking/rest/team/1"  
           uri="https://{{domain}}/networking/rest/team/1"  
           displayValue="LongJump Team">1</team_id>
           displayValue="LongJump Team">1</team_id>
     </record>
     </record>
Line 86: Line 86:
         <id>1634932137</id>
         <id>1634932137</id>
         <created_id type=""  
         <created_id type=""  
           uri="https://{domain}/networking/rest/user/1424089492"  
           uri="https://{{domain}}/networking/rest/user/1424089492"  
           displayValue="Admin LongJump">1424089492</created_id>
           displayValue="Admin LongJump">1424089492</created_id>
         <flag_primary>1</flag_primary>
         <flag_primary>1</flag_primary>
         <modified_id type=""  
         <modified_id type=""  
           uri="https://{domain}/networking/rest/user/1424089492"  
           uri="https://{{domain}}/networking/rest/user/1424089492"  
           displayValue="Admin LongJump">1424089492</modified_id>
           displayValue="Admin LongJump">1424089492</modified_id>
         <role_id type=""  
         <role_id type=""  
           uri="https://{domain}/networking/rest/role/1"  
           uri="https://{{domain}}/networking/rest/role/1"  
           displayValue="System Administrator">1</role_id>
           displayValue="System Administrator">1</role_id>
         <date_modified>2010-11-12T13:14:15Z</date_modified>
         <date_modified>2010-11-12T13:14:15Z</date_modified>
         <object_id>USER_TEAM</object_id>
         <object_id>USER_TEAM</object_id>
         <user_id type=""  
         <user_id type=""  
           uri="https://{domain}/networking/rest/user/1396457456"  
           uri="https://{{domain}}/networking/rest/user/1396457456"  
           displayValue="Support Agent">1396457456</user_id>
           displayValue="Support Agent">1396457456</user_id>
         <date_created>2010-11-12T13:14:15Z</date_created>
         <date_created>2010-11-12T13:14:15Z</date_created>
         <team_id type=""  
         <team_id type=""  
           uri="https://{domain}/networking/rest/team/1"  
           uri="https://{{domain}}/networking/rest/team/1"  
           displayValue="LongJump Team">1</team_id>
           displayValue="LongJump Team">1</team_id>
     </record>
     </record>
Line 109: Line 109:
         <id>10163086</id>
         <id>10163086</id>
         <created_id type=""  
         <created_id type=""  
           uri="https://{domain}/networking/rest/user/1424089492"  
           uri="https://{{domain}}/networking/rest/user/1424089492"  
           displayValue="Admin LongJump">1424089492</created_id>
           displayValue="Admin LongJump">1424089492</created_id>
         <flag_primary>1</flag_primary>
         <flag_primary>1</flag_primary>
         <modified_id type=""  
         <modified_id type=""  
           uri="https://{domain}/networking/rest/user/1424089492"  
           uri="https://{{domain}}/networking/rest/user/1424089492"  
           displayValue="Admin LongJump">1424089492</modified_id>
           displayValue="Admin LongJump">1424089492</modified_id>
         <role_id type=""  
         <role_id type=""  
           uri="https://{domain}/networking/rest/role/1"  
           uri="https://{{domain}}/networking/rest/role/1"  
           displayValue="System Administrator">1</role_id>
           displayValue="System Administrator">1</role_id>
         <date_modified>2010-11-12T13:14:15Z</date_modified>
         <date_modified>2010-11-12T13:14:15Z</date_modified>
         <object_id>USER_TEAM</object_id>
         <object_id>USER_TEAM</object_id>
         <user_id type=""  
         <user_id type=""  
           uri="https://{domain}/networking/rest/user/4"  
           uri="https://{{domain}}/networking/rest/user/4"  
           displayValue="Open Ownership">4</user_id>
           displayValue="Open Ownership">4</user_id>
         <date_created>2010-11-12T13:14:15Z</date_created>
         <date_created>2010-11-12T13:14:15Z</date_created>
         <team_id type=""  
         <team_id type=""  
           uri="https://{domain}/networking/rest/team/888961917"  
           uri="https://{{domain}}/networking/rest/team/888961917"  
           displayValue="Child TEam">888961917</team_id>
           displayValue="Child Team">888961917</team_id>
     </record>
     </record>


Line 140: Line 140:
Adds a User Team record
Adds a User Team record
;Method:POST
;Method:POST
;URI:<tt><nowiki>https://{domain}/networking/rest/userTeam/</nowiki></tt>
;URI:<tt>{{platformURL}}/rest/userTeam/</tt>


;Request:
;Request:
Line 148: Line 148:
         <user_id>16016a880c064ad1ba92115424851462</user_id>
         <user_id>16016a880c064ad1ba92115424851462</user_id>
         <team_id>123123</team_id>
         <team_id>123123</team_id>
        <role_id>2</role_id>
         <flag_primary>true</flag_primary>
         <flag_primary>true</flag_primary>
         <comments>Team Manager Role for Team A</comments>         
         <comments>Team Manager Role for Team A</comments>         
Line 172: Line 171:


;Method:PUT
;Method:PUT
;URI:<tt><nowiki>https://{domain}/networking/rest/userTeam/{recordId}</nowiki></tt>
;URI:<tt>{{platformURL}}/rest/userTeam/{recordId}</tt>


;Request:
;Request:
Line 179: Line 178:
     <userTeam>
     <userTeam>
         <team_id>12312345</team_id>
         <team_id>12312345</team_id>
        <role_id>3</role_id>
         <flag_primary>false</flag_primary>
         <flag_primary>false</flag_primary>
         <comments>Team Manager Role for Team A</comments>         
         <comments>Team Manager Role for Team A</comments>         
Line 202: Line 200:
Updates a User Team record
Updates a User Team record
;Method:DELETE
;Method:DELETE
;URI:<tt><nowiki>https://{domain}/networking/rest/userTeam/{recordId}</nowiki></tt>
;URI:<tt>{{platformURL}}/rest/userTeam/{recordId}</tt>


;Response:
;Response:
Line 232: Line 230:
|team_id||Lookup||align="center"|Editable on Add/Update||align="center"|[[File:Checkmark.gif|link=]]|| || [[REST API:team Resource|Team]] ID  
|team_id||Lookup||align="center"|Editable on Add/Update||align="center"|[[File:Checkmark.gif|link=]]|| || [[REST API:team Resource|Team]] ID  
|-
|-
|role_id||Lookup||align="center"|Editable on Add/Update||align="center"|[[File:Checkmark.gif|link=]]|| || [[REST API:role Resource|Role]] ID   
|role_id||Lookup|| align="center"|Read Only ||align="center"|[[File:Checkmark.gif|link=]]|| || [[REST API:role Resource|Role]] ID   
|-
|-
|flag_primary||Boolean||align="center"|Editable on Add/Update|| ||Flag Team as Primary Team||
|flag_primary||Boolean||align="center"|Editable on Add/Update|| ||Flag Team as Primary Team||

Latest revision as of 06:16, 10 May 2017

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 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
https://{yourDomain}/networking/rest/userTeam/{recordId}
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <userTeam>
       <id>568445387</id>
       <user_id type="USER" 
         uri="https://{yourDomain}/networking/rest/user/16016a880c064ad1ba92115424851462" 
         displayValue="A. User">16016a880c064ad1ba92115424851462</user_id>
       <team_id type="TEAM" 
         uri="https://{yourDomain}/networking/rest/team/888961917" 
         displayValue="Child Team">888961917</team_id>
       <role_id type="ROLE" 
         uri="https://{yourDomain}/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://{yourDomain}/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://{yourDomain}/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://{yourDomain}/networking/rest/userTeam?{query_parameters}
Sample Search
?fieldList=*&filter=flag_primary equals '1' & 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://{yourDomain}/networking/rest/user/3" 
         displayValue="System">3</created_id>
       <flag_primary>1</flag_primary>
       <modified_id type="" 
         uri="https://{yourDomain}/networking/rest/user/3" 
         displayValue="System">3</modified_id>
       <role_id type="" 
         uri="https://{yourDomain}/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://{yourDomain}/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://{yourDomain}/networking/rest/team/1" 
         displayValue="LongJump Team">1</team_id>
   </record>
   <record>
       <id>1634932137</id>
       <created_id type="" 
         uri="https://{yourDomain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</created_id>
       <flag_primary>1</flag_primary>
       <modified_id type="" 
         uri="https://{yourDomain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</modified_id>
       <role_id type="" 
         uri="https://{yourDomain}/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://{yourDomain}/networking/rest/user/1396457456" 
         displayValue="Support Agent">1396457456</user_id>
       <date_created>2010-11-12T13:14:15Z</date_created>
       <team_id type="" 
         uri="https://{yourDomain}/networking/rest/team/1" 
         displayValue="LongJump Team">1</team_id>
   </record>
   <record>
       <id>10163086</id>
       <created_id type="" 
         uri="https://{yourDomain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</created_id>
       <flag_primary>1</flag_primary>
       <modified_id type="" 
         uri="https://{yourDomain}/networking/rest/user/1424089492" 
         displayValue="Admin LongJump">1424089492</modified_id>
       <role_id type="" 
         uri="https://{yourDomain}/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://{yourDomain}/networking/rest/user/4" 
         displayValue="Open Ownership">4</user_id>
       <date_created>2010-11-12T13:14:15Z</date_created>
       <team_id type="" 
         uri="https://{yourDomain}/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://{yourDomain}/networking/rest/userTeam/
Request
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <userTeam>
       <user_id>16016a880c064ad1ba92115424851462</user_id>
       <team_id>123123</team_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://{yourDomain}/networking/rest/userTeam/{recordId}
Request
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <userTeam>
       <team_id>12312345</team_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://{yourDomain}/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 Read Only 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