GET api/Search/Units?SearchPhrase={SearchPhrase}&UserGroupId={UserGroupId}&MaxDepth={MaxDepth}&TypeFilter={TypeFilter}&StateFilter={StateFilter}&Sort={Sort}&SortDescending={SortDescending}&Page={Page}&PageSize={PageSize}

Returns all trackers matching the specified search parameters

Request Information

URI Parameters

NameDescriptionTypeAdditional information
SearchPhrase

Search units that matches this phrase. Leave null or blank to search in all your units.

string

Max length: 1000

UserGroupId

(optional) Limit search to this usergroup and child groups. Default is null and will search all your groups.

integer32

Null values possible.

MaxDepth

(Optional) If not null, will only search this many layers down the group hierarchy - else will search all child groups. Default is null. To only search the group specified with UserGroupId parameter without searching in childgroups, set this to 0.

integer32

Null values possible.

Range: inclusive between 0 and 2147483647

TypeFilter

(optional) The unit type to filter by. This is a flag enum, and can be combined to search for units that satisfy ANY of the flags in the query. NOTE: Querying with null or 0 will be interpreted as Default. This will include all types (ie. not filtered by type).

UnitSearchTypeFlagsEnum

Null values possible.

Range: inclusive between 0 and 7

StateFilter

(optional) The unit state to filter by. This is a flag enum, and can be combined to search for units that satisfy ANY of the flags in the query. NOTE: Querying with null or 0 will be interpreted as Default. This will include all states (ie. not filtered by current state).

UnitSearchCurrentStateFlagsEnum

Null values possible.

Range: inclusive between 0 and 63

Sort

(optional) The parameter to sort by. default is 2 (SerialNumber).

UnitSearchSortEnum

Null values possible.

Range: inclusive between 1 and 12

SortDescending

(optional) if true, will sort in descending order of the Sort parameter. default is false.

boolean

None.

Page

(optional) The page of results to take. Default is 1.

integer32

Null values possible.

Range: inclusive between 1 and 2147483647

PageSize

(optional) Results pr page. Default is 1000.

integer32

Null values possible.

Range: inclusive between 1 and 2147483647

Body Parameters

None.

Response Information

Resource Description

Returns all trackers matching the specified search parameters

UnitSearchResult
NameDescriptionTypeAdditional information
SearchResults

Collection of UnitSearchResultModel

None.

Page

integer32

Range: inclusive between 1 and 2147483647

PageSize

integer32

Range: inclusive between 1 and 2147483647

TotalResults

integer32

None.

Pages

integer32

None.

Response Formats

application/json, text/json

Sample:
{
  "SearchResults": [
    {
      "UnitTypeFlags": 0,
      "StateFlags": 0,
      "IsStandard": true,
      "BLEAvailable": true,
      "IsS1": true,
      "ReadyForActivation": true,
      "Active": true,
      "NoCommunication": true,
      "LowBattery": true,
      "NeedsInspection": true,
      "HasRecentAlarm": true,
      "SerialNumber": "sample string 10",
      "UserGroupId": 11,
      "ReferenceId": "sample string 12",
      "Name": "sample string 13",
      "ItemDescription": "sample string 14",
      "LastModified": "2024-05-19T15:32:10.2172317+00:00"
    },
    {
      "UnitTypeFlags": 0,
      "StateFlags": 0,
      "IsStandard": true,
      "BLEAvailable": true,
      "IsS1": true,
      "ReadyForActivation": true,
      "Active": true,
      "NoCommunication": true,
      "LowBattery": true,
      "NeedsInspection": true,
      "HasRecentAlarm": true,
      "SerialNumber": "sample string 10",
      "UserGroupId": 11,
      "ReferenceId": "sample string 12",
      "Name": "sample string 13",
      "ItemDescription": "sample string 14",
      "LastModified": "2024-05-19T15:32:10.2172317+00:00"
    }
  ],
  "Page": 1,
  "PageSize": 2,
  "TotalResults": 3,
  "Pages": 4
}

application/xml, text/xml

Sample:
<UnitSearchResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebAPI.Models">
  <Page>1</Page>
  <PageSize>2</PageSize>
  <Pages>4</Pages>
  <SearchResults>
    <UnitSearchResultModel>
      <ItemDescription>sample string 14</ItemDescription>
      <LastModified>2024-05-19T15:32:10.2172317+00:00</LastModified>
      <Name>sample string 13</Name>
      <ReferenceId>sample string 12</ReferenceId>
      <SerialNumber>sample string 10</SerialNumber>
      <UserGroupId>11</UserGroupId>
      <Active>true</Active>
      <BLEAvailable>true</BLEAvailable>
      <HasRecentAlarm>true</HasRecentAlarm>
      <IsS1>true</IsS1>
      <IsStandard>true</IsStandard>
      <LowBattery>true</LowBattery>
      <NeedsInspection>true</NeedsInspection>
      <NoCommunication>true</NoCommunication>
      <ReadyForActivation>true</ReadyForActivation>
      <StateFlags>Default</StateFlags>
      <UnitTypeFlags>Default</UnitTypeFlags>
    </UnitSearchResultModel>
    <UnitSearchResultModel>
      <ItemDescription>sample string 14</ItemDescription>
      <LastModified>2024-05-19T15:32:10.2172317+00:00</LastModified>
      <Name>sample string 13</Name>
      <ReferenceId>sample string 12</ReferenceId>
      <SerialNumber>sample string 10</SerialNumber>
      <UserGroupId>11</UserGroupId>
      <Active>true</Active>
      <BLEAvailable>true</BLEAvailable>
      <HasRecentAlarm>true</HasRecentAlarm>
      <IsS1>true</IsS1>
      <IsStandard>true</IsStandard>
      <LowBattery>true</LowBattery>
      <NeedsInspection>true</NeedsInspection>
      <NoCommunication>true</NoCommunication>
      <ReadyForActivation>true</ReadyForActivation>
      <StateFlags>Default</StateFlags>
      <UnitTypeFlags>Default</UnitTypeFlags>
    </UnitSearchResultModel>
  </SearchResults>
  <TotalResults>3</TotalResults>
</UnitSearchResult>