Skip to main content

Asset Type Management API

Version 1.1 — August 2024

Authentication: All requests require an IdToken from the Login API. See Authentication to obtain one and Errors for authorization errors.

Create Asset Type API​

Create Asset Type API allows to create the Asset Types for which the Assets will be created.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Properties​

PropertyTypeDescriptionRequired
idStringAsset Type unique identifierYes
numberStringAsset Type numberNo
nameStringAsset Type nameNo
descriptionStringAsset Type descriptionNo
quantityIntQuantity if applicableNo
unitStringUnit if applicableNo
imagePathStringPublic image URL for the Asset TypeNo
customPropertiesAWSJSONCustomer specific properties that are applicable for the Asset TypeNo

Headers

Authorization – $idToken

Request Body​

mutation {
createAssetTypes(
input: {
inputList: [
{
id: "AssetType-1"
number: "AssetType-1"
name: "AssetType-1"
description: "test asset type"
quantity: 2
}
]
}
) {
assetTypeIds
}
}

Example Response​

Response contains a list of all the Asset Type Ids.

{
"data": {
"createAssetTypes": {
"assetTypeIds": ["AssetType-1"]
}
}
}

Update Asset Types API​

Update Asset Types API allows to update asset types at the same time.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Properties​

PropertyTypeDescriptionRequired
idStringThe unique id associated with the asset type. Usually referred as asset type number/SKU number of the product. If the asset type number is not unique, the id is usually a combination of multiple properties joined with "-" to make the id unique.Yes
numberStringAsset type numberNo
nameStringOptional property to describe the name of the asset type if there is oneNo
descriptionStringAsset type descriptionNo
quantityIntegerThe expected quantity of the asset typeNo
unitStringUnit of measure of the asset typeNo
imagePathStringImage URL of the asset type that can be used to display on the UINo
customPropertiesAWS/JSONAdditional properties that a customer may want to specify for the asset typeNo

Headers –
Authorization – $idToken

Request Body​

Here is an example for payload for updating 2 asset types:

mutation {
updateAssetTypes(
input: {
inputList: [
{ id: "AssetType-1", number: "AssetType-1-X" }
{ id: "AssetType-2", number: "AssetType-2-X" }
]
}
) {
assetTypeIds
}
}

Status Code - 200

Response Body​

{
"data": {
"updateAssetTypes": {
"assetTypeIds": ["AssetType-1", "AssetType-2"]
}
}
}

Response consists of a list of all asset type ids that were updated.

Errors​

See authorization errors.

Additional Errors​

ErrorError code
Partial Update409

Partial Update (AssetType-2 is updated) but AssetType-3 is not found in the DB (therefore not updated)​

{
"data": {
"updateAssetTypes": {
"assetTypeIds": ["AssetType-2"]
}
},
"errors": [
{
"path": ["updateAssetTypes"],
"data": null,
"errorType": null,
"errorInfo": null,
"locations": [
{
"line": 2,
"column": 5,
"sourceName": null
}
],
"message": "assetTypeId: AssetType-3 not found in DB"
}
]
}

List Asset Types API​

List Asset Types API allows to retrieve all the asset types and view their details.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Input Properties​

PropertyTypeDescriptionRequired
filterStringFilter for propertiesNo
nextTokenStringPagination supportNo

Response Properties​

PropertyTypeDescriptionRequired
assetTypesObjectList of asset types (view table below)Yes
nextTokenStringNext token to retrieve the next pageNo

assetTypes​

PropertyTypeDescriptionRequired
idStringAsset Type identifierYes
nameStringAsset Type NameNo
numberStringAsset Type numberNo
descriptionStringAsset Type descriptionNo
quantityIntegerAsset Type quantityNo
unitStringUnit of measureNo
imagePathStringImage URL of the asset typeNo
customPropertiesAWSJSONOther properties for Asset typesNo

Headers –
Authorization – $idToken

Request Body​

query assetTypes($filter: String, $nextToken: String) {
assetTypes(input: { filter: $filter, nextToken: $nextToken }) {
nextToken
assetTypes {
id
name
number
unit
description
quantity
imagePath
customProperties
}
}
}

Status Code - 200

Errors​

See authorization errors.


List Asset Types at Locations API​

List Asset Types at Location API allows to retrieve all the asset types at the locations and view their statuses. List can be retrieved for any or all locations.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Input Properties​

PropertyTypeDescriptionRequired
filterStringFilter for propertiesNo
nextTokenStringPagination supportNo

Response Properties​

PropertyTypeDescriptionRequired
assetTypesObjectList of assetTypes by location (view table below)Yes
nextTokenStringNext token to retrieve the next pageNo

assetTypes​

PropertyTypeDescriptionRequired
typeObjectAsset Type details (view table below)Yes
missingCountNumberCount of missing assets of that asset type at the locationNo
dueSoonCountNumberCount of assets of that asset type that are due for maintenance soonNo
overdueCountNumberCount of assets of that asset type that are overdue for maintenanceNo
onhandCountNumberOn hand count of assets of that asset type at the locationNo
totalCountNumberTotal number of assets of that asset type at the locationNo
locationObjectLocation details (view table below)No

type​

PropertyTypeDescriptionRequired
idStringAsset Type identifierYes
nameStringAsset Type NameNo
descriptionStringAsset Type descriptionNo
customPropertiesAWSJSONOther properties for Asset typesNo

location​

PropertyTypeDescriptionRequired
idStringLocation identifierYes
nameStringLocation NameNo

Headers

Authorization – $idToken

Request Body​

query assetTypeMetrics($filter: String, $nextToken: String) {
assetTypeMetrics(input: { filter: $filter, nextToken: $nextToken }) {
nextToken
assetTypes {
id
name
missingCount
dueSoonCount
overdueCount
onHandCount
totalCount
location {
id
name
}
type {
id
name
description
customProperties
}
}
}
}
----------------------------------------------------------------------
Filter input
{
"filter": "location.name == \"Location A\""
}

Status Code - 200

Errors​

See authorization errors.


List Asset Types Count at Locations API​

List Asset Types Count at Location API allows to retrieve all the counts of asset types at the locations. List can be retrieved for any or all locations.

Endpoint Details​

  • URL: https://api.xemelgo.com/graphql
  • Method: POST

Input Properties​

PropertyTypeDescriptionRequired
filterStringFilter for propertiesNo
nextTokenStringPagination supportNo

Response Properties​

PropertyTypeDescriptionRequired
assetTypesObjectList of assetTypes by location (view table below)Yes
nextTokenStringNext token to retrieve the next pageNo

assetTypes​

PropertyTypeDescriptionRequired
locationObjectLocation details (view table below)No
totalCountNumberTotal number of assets of that asset type at the locationNo

location​

PropertyTypeDescriptionRequired
idStringLocation identifierYes
nameStringLocation NameNo

Headers

Authorization – $idToken

Request Body​

query assetTypeLocationMetrics($filter: String, $nextToken: String) {
assetTypeLocationMetrics(input: { filter: $filter, nextToken: $nextToken }) {
nextToken
assetTypes {
totalCount
location {
id
name
}
}
}
}
----------------------------------------------------------------------
Filter input
{
"filter": "location.name == \"Location A\""
}

Status Code - 200

Errors​

See authorization errors.