Back to Service

Method Details for GetDepartmentsShortList.

Gets a list of departments

Definition

TimeLog.TLP.WebAppCode.Service.GetDepartmentsShortList(System.String,System.String,System.String)

Parameters

  • siteCode String Unique identification for your TimeLog account
  • apiID String The API ID
  • apiPassword String The API password

Returns

A list of department objects in XML format

Result Example

<?xml version="1.0" encoding="utf-8"?>
<tlp:Departments  
	xmlns:tlp="http://www.timelog.com/XML/Schema/tlp/v4_4" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.timelog.com/XML/Schema/tlp/v4_4 http://www.timelog.com/api/xsd/DepartmentsShortList.xsd" >
	<tlp:Department ID="5">
		<tlp:Name>Sales</tlp:Name>
	</tlp:Department>
	<tlp:Department ID="26">
		<tlp:Name>Administration</tlp:Name>
		<tlp:ParentID>5</tlp:ParentID>
	</tlp:Department>
	<tlp:Department ID="24">
		<tlp:Name>Marketing</tlp:Name>
		<tlp:ParentID>5</tlp:ParentID>
	</tlp:Department>
  <tlp:Department ID="25">
    <tlp:Name>Research and Development</tlp:Name>
    <tlp:ParentID>5</tlp:ParentID>
  </tlp:Department>
</tlp:Departments>

Result Schema

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:tlp="http://www.timelog.com/XML/Schema/tlp/v4_4"
            targetNamespace="http://www.timelog.com/XML/Schema/tlp/v4_4"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">
  <xsd:element name="Departments">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Department" type="tlp:DepartmentShort_Type" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
    </xsd:complexType>
    <xsd:key name="Department_Key">
      <xsd:selector xpath=".//tlp:Department" />
      <xsd:field xpath="@ID" />
    </xsd:key>
  </xsd:element>

  <xsd:complexType name="DepartmentShort_Type">
    <xsd:sequence>
      <xsd:element name="Name" type="xsd:string" />
      <xsd:element name="ParentID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="ID" type="xsd:positiveInteger" use="required"></xsd:attribute>
  </xsd:complexType>

</xsd:schema>

Download the XSD