REST API:userTeam Resource

From LongJump Support Wiki
(Redirected from User Team Resource)

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://na.longjump.com/networking/rest/userTeam/{recordId}
Response
<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>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
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://na.longjump.com/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
  • Use the REST API:field Resource to get a complete list of fields
  • Field lists for database views need to specify the object's alias, as well as the field name.
  • filter - Filtering criteria to filter the records
  • pageSize - Number of records to retrieve from the result set in order to make a "page".
  • page - Number of the logical page in a database result set. The first page is page "zero" (0).
Page zero is returned by default, so appending &pageSize=1 to your query returns a single record.
  • getTotalRecordCount returns the number of total records.
    Causes the following structure to be returned, where N is the total number of records:
<platform> 
   ...
   <message>
      <code>0</code>
      <description>Success</description>
   </message>

   <!-- added by the query param -->
   <totalRecordCount>N</totalRecordCount> 
</platform>
  • sortBy - Field name for primary sort
    Ex: &sortBy=name
  • sortOrder - Sort order of the primary field, either "asc" or "desc" (ascending or descending)
    Ex: &sortOrder="desc"
  • sortBy2 - Field name for secondary sort
  • sortOrder2 - Sort order of the second field, either "asc" or "desc" (ascending or descending)
For more information, see: Specifying Query Parameters in REST APIs
Response
<platform>
    <record>
        <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>
        <code>0</code>
        <description>Success</description>
    </message>
    <recordCount>3</recordCount>
</platform>

Add a User Team Record

Adds a User Team record

Method
POST
URI
https://na.longjump.com/networking/rest/userTeam/
Request
<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>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
        <id>18184374</id>
    </message>
</platform>
See also: REST API:Error Codes

Update a User Team Record

Updates a User Team record

Method
PUT
URI
https://na.longjump.com/networking/rest/userTeam/{recordId}
Request
<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>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
        <id>18184374</id>
    </message>
</platform>
See also: REST API:Error Codes

Delete a User Team Record

Updates a User Team record

Method
DELETE
URI
https://na.longjump.com/networking/rest/userTeam/{recordId}
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
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