Select (Table) Method

This method allows you to construct a query to obtain records from the table.

Parameters

table
the singular name of the table or its alias as returned by the Describe (Database) method. Please note that this parameter is embedded into the URL before the method name.
column
the name or an alias of the column to query can appear multiple times. If omitted or star (*) is specified, API returns the data for all updateable columns. You can combine star with other column names.
filter
optional, allows you to specify filtering criteria in syntax described in Formula Language Reference.
sort
the name or an alias of the column to sort by can appear multiple times. Sort order can be specified by appending //ASC or //DESC to a column name, ascending order is the default
top
optional, a number of records to return in a range 1…500. Default is 500.
skip
number of records to skip before returning the result. This parameter can be used to organize paginated output, for example: skip=0&top=200 (page 1), skip=200&top=200 (page 2), etc.

Request

GET https://www.teamdesk.net/secure/api/v2/{appid}/{table}/select.{json|xml}?parameters

Query updatable columns from first 500 records in a Test table

GET https://www.teamdesk.net/secure/api/v2/21995/Test/select.json

Query Text, Date columns from records 5-10 in a Test table, sort by Date descending

GET https://www.teamdesk.net/secure/api/v2/21995/Test/select.json?column=Text&column=Date&sort=Date//DESC&skip=5&top=5

Query all updateable columns plus Date Modified column

GET https://www.teamdesk.net/secure/api/v2/21995/Test/select.json?column=*&column=Date%20Modified

Response (JSON)

The data is returned as the array of JavaScript objects. Each object’s field corresponds to a column queried.

 [

  {
    "@row.id": 12,// internal row ID
    "@row.allow": "Edit, Delete",// comma separated allowed actions
    "Id": "60",// autonumber is string
    "Text": "Text",// text is string
    "Multiline": "Multi\r\nText",// line separators are encoded appropriately
    "Checkbox": true, // checkbox is either true or false
    "Date": "2014-11-18T00:00:00+00:00",// date is UTC midnight
    "Time": "0001-01-01T17:26:00+00:00",// time is in 1/1/0001 UTC
    "Number": 1234567,// number is ...well, number
    "Email": "kir@skyeytech.com",
    "Phone": "+12345678",
    "URL": "http://www.teamdesk.net",
    "User": "test user <test@test.com>",// name \<email>
    "Duration": 86400,// number of seconds
    "Timestamp": "2014-11-18T17:26:00-06:00", // in a local user's timezone
  }
  // , {...}
]

Response (XML)

Top level element is named <Response> and contains a set of <row> elements.

<!-- URL to the row schema is reported for conforming XML readers but not required -->
<Response>
    <row id="12" allow="Edit Delete">
        <Id>60</Id>
        <Text>Text</Text>
        <Multiline>
                 Multiline
                 Text
        </Multiline>
        <Checkbox>true</Checkbox>
        <!-- yyyy-mm-dd -->
        <Date>2014-11-18</Date>
        <!-- hh:mm:ss -->
        <Time>17:26:00</Time>
        <Number>1234567.000000</Number>
        <Email>kir@skyeytech.com</Email>
        <Phone>+12345678</Phone>
        <URL>http://www.teamdesk.net</URL>
        <User>test user &lt;test@test.com &gt;</User>
        <!-- PTsecondsS -->
        <Duration>PT86400S</Duration>
        <!-- yyyy-mm-ddThh:mm:ss+/-ZZ:ZZ -->
        <Timestamp>2014-11-18T17:26:00+02:00</Timestamp>
        <!-- Null value -->
        <Test_Null i:nil="true"/>
  </row>
  <!-- more rows -->
</Response>

Also, XML output can be used to create dynamic read-only link between the data in TeamDesk and Excel. Try Excel’s Data tab, Get External Data ribbon, From Other Sources dropdown, From XML Data Import menu and paste URL as the File Name.