Not logged in - Login
< back

API Transaction Searches

Transaction Searches - Disposals

There are 5 types of transactions that can be searched in the system:

1.) Check Ins
2.) Check Outs
3.) Transfers
4.) Moves
5.) Disposals

SEARCH BASICS

  • All searches are done as POST requests to the API.
  • Search parameters are sent in the body of a request in a JSON format.
  • All search request bodies must contain a "StaticFields" array, an "OfficeIds" array, and also paging parameters properties "PageSize" and "PageNumber".
  • "OfficeIds" must be included in the request and allows a search to filter by Office.
  • As options, the request can also include "orderBy" which will be a field name and "orderByAsc" which can be either true or false.

SEARCH CRITERIA

The body of a search request must include a search criteria. These criteria Ids are used in the "searchCriteria" property of the request body. The criteria are different depending on the field. For easier reference, the search criteria can be broken down into the following groups:

TEXT FIELDS

Text Fields can be searched with the following criteria:

- Equals, Not Equals, Starts With, Text Search
These criteria are represented as follows:
Equals:
{
"id": 0,
},
Not Equals
{
"id": 1,
},
Contains
{
"id": 4,
},

DATE FIELDS

Date Fields can be searched with the following criteria:
( Note - X is number of days)
- Before, After, Between, Exactly, Newer than X, Older than X, Between X and Y, Current Week, Last Week, Month To Date, Last Month, Year To Date, Last Year
These criteria are represented as follows:
Before
{
"id": 6,
},
After
{
"id": 7,
},
Between
{
"id": 8,
},
Exactly
{
"id": 13,
},
Newer Than
{
"id": 12,
},
Older Than
{
"id": 11,
},
Between X and Y
{
"id": 18,
},
Current Week
{
"id": 19,
},
LastWeek
{
"id": 20,
},
Month To Date
{
"id": 21,
},
Last Month
{
"id": 22,
},
Year To Date
{
"id": 23,
},
Last Year
{
"id": 24,
}

DROPDOWN FIELDS

Dropdown fields can be searched with the following criteria:
- Equals, Not Equals, Select All
These criteria are represented as follows
Equals
{
"id": 0,
},
Not Equals
{
"id": 1,
},
Select All is the default and does not need to be specified in the search request body.

BOOLEAN FIELDS

Boolean fields (true or false) can be searched with the following criteria:
- Equals, Not Equals
These criteria are represented as follows:
Equals
{
"id": 0,
},
Not Equals
{
"id": 1,
},

TYPE AHEAD FIELDS

Type ahead fields use a boolean style search to match ids returned in text searches :
- Equals, Not Equals
The "model" value for these searches is the id returned in the typeahead search, for example a user id when searching for a user in the system.

These criteria are represented as follows:
Equals
{
"id": 0,
},
Not Equals
{
"id": 1,
},

Field Types

Field Types are specified using Ids, and are included in the body as "typeId"
These are the field types and their Ids:

  • TEXTFIELD: 0,
  • TEXTAREA: 1,
  • DATE: 2,
  • DROPDOWN: 3,
  • BOOLEAN: 4,
  • TYPEAHEAD: 5,
  • LOCATION: 6,
  • MULTIPLECHECKBOX: 7,
  • NUMBER: 8

Search Criteria Types

Search Criteria Types are specified using Ids, and are included in the body as "searchCriteriasType"
These are the search criteria types and their Ids:

  • boolean: 1,
  • date: 2,
  • default: 3,
  • number : 4,
  • equals: 5,
  • contains: 6

Dispsosals

The following fields can be searched for disposals:
Note the field name in parentheses - this will be used in our search request body

TEXTFIELD SEARCHES

  • Notes

Notes is the only field which can be searched using a text search.
We are searching the notes field where the name contains "august".
This value is added in the "model" property of the request body

  • Note that for "searchCriteria" we need to only provide the criteria id
  • Also note the "typeId" property is the field type as outlined above.
  • Further, note that we are also providing an officeId. This must be an office, or array of offices, within your organization.

Here is our POST body:

POST https://securelb.trackerproducts.com/api/disposals/search

{
"tags": [],
"IsSearchingInSublocations": false,
"DynamicFields": [],
"StaticFields": [
{
"name": "ITEMS.VIEW.NOTES",
"typeId": 0,
"fieldName": "Notes",
"searchCriterias": [],
"searchCriteria": 4,
"model": "august"
},
{
"name": "SEARCH.OFFICE_SELECTION",
"typeId": 7,
"fieldName": "OfficeSelection",
"searchCriteriasType": 5,
"dropdownEntities": {
"entity": "offices"
},
"searchCriterias": [],
"selectedOffices": [],
"model": [],
"searchCriteria": 0
}
],
"officeIds": [
1
],
"orderBy": "Date",
"orderByAsc": false,
"PageSize": 25,
"PageNumber": 1 }

Which returns the following result:


{
"count": 1,
"data": [
{
"id": 35261,
"notes": "August Auction",
"date": "2018-08-29T20:03:26.04358+00:00",
"methodId": 4,
"disposedById": 1,
"itemsCount": 1,
"officeId": 1,
"isForbidden": false
}
]
}

DATE SEARCHES

The following date search is available for disposals: (field name is in parentheses)
  • Disposal Date (disposalDate) Here is an example of a Disposal Date field search
  • We are searching a disposal date between the dates 08/01/2018 and 08/29/2018.
    The "typeId" is now changed to the value corresponding to field type date
    Note that "model" is the start date of the search and "toDate" is the to date.
    Also, dates can be searched with just day, month, and year or can be a full date with time.
    So, the "model" below could also be "2018-08-01T04:00:00.000Z"

Here is our POST body:

POST https://securelb.trackerproducts.com/api/disposals/search

{
"tags": [

],
"IsSearchingInSublocations": false,
"DynamicFields": [

],
"StaticFields": [
{
"name": "DISPOSAL.DISPOSE_DATE",
"typeId": 2,
"fieldName": "Date",
"searchCriteriasType": 2,
"searchCriterias": [],
"searchCriteria": 8,
"toDate": "2018-08-29T04:00:00.000Z",
"model": "2018-08-01T04:00:00.000Z"
},
{
"name": "SEARCH.OFFICE_SELECTION",
"typeId": 7,
"fieldName": "OfficeSelection",
"searchCriteriasType": 5,
"dropdownEntities": {
"entity": "offices"
},
"searchCriterias": [],
"selectedOffices": [],
"model": [],
"searchCriteria": 0
}
],
"officeIds": [
1
],
"orderBy": "Date",
"orderByAsc": false,
"PageSize": 25,
"peopleIds": [

],
"PageNumber": 1
}

This search yields the following result:


{
"count": 2,
"data": [
{
"id": 35261,
"notes": "August Auction",
"date": "2018-08-29T20:03:26.04358+00:00",
"methodId": 4,
"disposedById": 1,
"itemsCount": 1,
"officeId": 1,
"isForbidden": false
},
{
"id": 35260,
"notes": "this a test",
"date": "2018-08-29T19:15:09.1236372+00:00",
"methodId": 4,
"disposedById": 1,
"itemsCount": 1,
"officeId": 1,
"isForbidden": false
}
]
}