Not logged in - Login
< back

API Post Item

"description":"shell casing",
       "name":"Oscar Meyer",
       "nameLC":"oscar meyer",
       "displayedName":"Meyer, Oscar (N/A)",
       "defaultAddress":", , , , ",

For the above, we will first need to get the following:
- Category Id
- Recovered By Id - this will be a user ID
- Storage Location Id
- custody reason Id
- people can have multiple persons - each one will have their own document (a
document is { })

I will send the above APIs in separate emails for organization


The following API endpoint will bring back all the item categories:

The results will be an array of all item categories:

[ { "id": 138, "name": "Accessory", "organizations": [], "categoryForms": null }, { "id": 31, "name": "Alcohol", "organizations": [], "categoryForms": null }, { "id": 2, "name": "Ammunition", "organizations": [], "categoryForms": null }, { "id": 143, "name": "Apple Watch", "organizations": [], "categoryForms": null }, .........

This Id will be used to populate the CategoryId field for an item entry


The person recovered By Field will be populated with a user from the org. The first step would be to search for the user. We can do a search using the /api/users/typeahead endpoint


This search will bring back the following:

[ { "id": 1, "text": "Jack 3176D103FF Sparrow (" }, { "id": 17663, "text": "Mike Singleton (" }, { "id": 17664, "text": "Victor Frankenstein (" } ]

For the Recovered By field we only need the Id of a person, so this search is sufficient


Here is the endpoint for getting all the custody reasons

This will bring back an array with all of the custody reasons. For the item entry - we will just need the Id of the custody reason.

[ { "id": 40, "name": "50 B", "organizations": [] }, { "id": 30, "name": "Approved to Destroy", "organizations": [] }, { "id": 29, "name": "Approved to Release", "organizations": [] }, { "id": 7, "name": "Asset", "organizations": [] }, { "id": 42, "name": "Business Continuity", "organizations": [] },


In order to add a person to the Item Belongs To Field, the case must have a person attached to it.

To get the people that have been added to a case, we can use this endpoint:

The number, 2933619, is the case Id that we wish to add an item into.

The result is an array of person documents:

[ { "personId": 1634853, "person": { "id": 1634853, "guid": "eaa90160-ac7f-45c7-9c93-f93b7318b2ad", "organizationId": 1, "userId": null, "createDateTime": "2018-02-26T15:18:08.032Z", "updatedDateTime": null, "isDeleted": null, "businessName": "", "businessNameLC": "", "name": "Oscar Meyer", "nameLC": "oscar meyer", "firstName": "Oscar", "firstNameLC": "oscar", "middleName": "", "middleNameLC": null, "lastName": "Meyer", "lastNameLC": "meyer", "alias": "", "aliasLC": "", "driverLicence": "", "mobilePhone": "", "otherPhone": "", "email": "", "dob": null, "raceId": 1, "race": "Unknown", "genderId": 1, "gender": "Unknown", "deceased": false, "juvenile": false, "active": true, "personTypeId": null, "formData": [], "formDataAmount": 0, "notes": [], "notesAmount": 0, "media": [], "mediaAmount": 0, "rootMediaFolderId": 123589, "displayedName": null, "defaultAddress": ", , , , ", "isForbidden": false }, "personType": { "id": 2, "name": "Victim", "active": true, "organizations": null }, "typeId": 2 } ]

This document would be used to populate the people array in the add item request.


The last piece of information for a "basic" item entry to a case is the location ID.

The endpoint to receive a full list of an org's locations is :

This will return an array of all the org locations

[ { "discrepancyReportSummaries": [], "id": 1, "name": "root", "active": true, "barcode": "d56225a3-2f27-4735-96b2-fa1d8c08b64a", "officeId": 1, "office": null, "items": [], "barcodes": null, "groups": [ { "users": null, "userOfficePermissions": [], "locations": [], "tasks": null, "id": 68, "name": "Power User", "description": "Power Users (All except Admin)", "organizationId": 1, "organization": null } ], "parentId": 33, "parent": null, "hasChildren": true, "level": 3, "fullPath": null, "canStoreHere": true }, { "discrepancyReportSummaries": [], "id": 5, "name": "Room 1", "active": true, "barcode": "de70ff27-b93a-e511-a0e6-06e9f5d49c4d", "officeId": 1, "office": null, "items": [], "barcodes": null, "groups": [], "parentId": 1, "parent": null, "hasChildren": true, "level": 4, "fullPath": null, "canStoreHere": false }, { "discrepancyReportSummaries": [], "id": 6, "name": "Room 3", "active": true, "barcode": "df70ff27-b93a-e511-a0e6-06e9f5d49c4d", "officeId": 1, "office": null, "items": [], "barcodes": null, "groups": [], "parentId": 1, "parent": null, "hasChildren": false, "level": 4, "fullPath": null, "canStoreHere": false }, .......

For an item entry, the only data necessary is the LocationId. Note that the user must have permission to store an item in the location.

Also, an optional parameter for this request is a count of items stored in the location: