Asset Type Scheme REST Services

Listing all asset type schemes

MethodGET
URL/rest/jip-api/1.0/schema/objectSchemas.json
Sample Response
{
  "success" : true,
  "errorCode" : null,
  "errorMessage" : null,
  "data" : [ {
    "created" : 1587720396812,
    "createdBy" : "system",
    "updated" : 1587720396812,
    "updatedBy" : "system",
    "id" : 1,
    "schemaName" : "Default Asset Scheme",
    "key" : null,
    "description" : "Auto generated default Asset Types Scheme (system)",
    "forms" : [ ]
  }, {
    "created" : 1587725435018,
    "createdBy" : "admin",
    "updated" : 1587727019075,
    "updatedBy" : "admin",
    "id" : 2,
    "schemaName" : "Snapbytes Inventory",
    "key" : null,
    "description" : null,
    "forms" : [ {
      "id" : 11,
      "formName" : "Server",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    }, {
      "id" : 10,
      "formName" : "Pen",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    }, {
      "id" : 7,
      "formName" : "Employee",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    }, {
      "id" : 6,
      "formName" : "Chair",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    }, {
      "id" : 5,
      "formName" : "Desk",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    }, {
      "id" : 4,
      "formName" : "Monitor",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    }, {
      "id" : 3,
      "formName" : "Keyboard",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    }, {
      "id" : 2,
      "formName" : "Mouse",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    }, {
      "id" : 1,
      "formName" : "Computer",
      "sortOrder" : 0,
      "objectSchemaId" : 2,
      "objectSchemaName" : "Snapbytes Inventory",
      "cloneFromId" : null
    } ]
  } ],
  "pagingInfo" : null
}

Create asset type scheme

Info

  • While creating and updating asset type schemes with REST API's, "schemaName" variable must be defined in request body. Otherwise you will not be able to create or update asset type schemes.
  • Variables which is not defined in request body will be considered as null.
MethodPOST
URL/rest/jip-api/1.0/schema/objectSchema.json
Request Body
{
  "schemaName": "Example asset type scheme",
  "description": "This is an example asset type scheme"
}
Sample Response
{
  "success" : true,
  "errorCode" : null,
  "errorMessage" : null,
  "data" : {
    "created" : 1589374230209,
    "createdBy" : "admin",
    "updated" : 1589374230209,
    "updatedBy" : "admin",
    "id" : 3,
    "schemaName" : "Example asset type scheme",
    "key" : null,
    "description" : "This is an example asset type scheme",
    "forms" : [ ]
  },
  "pagingInfo" : null
}
Failure Message
{
  "success": false,
  "errorCode": "EntityExistsException",
  "errorMessage": "Example asset type scheme",
  "data": null,
  "pagingInfo": null
}

Update asset type scheme

MethodPOST
URL/rest/jip-api/1.0/schema/objectSchema.json
Request Body
{
  "id": 3,
  "schemaName": "Example asset type scheme edit",
  "key": null,
  "description": "This is an example asset type scheme",
  "forms": []
}
Sample Response
{
  "success": true,
  "errorCode": null,
  "errorMessage": null,
  "data": {
    "created": 1589374230209,
    "createdBy": "admin",
    "updated": 1589374439770,
    "updatedBy": "admin",
    "id": 3,
    "schemaName": "Example asset type scheme edit",
    "key": null,
    "description": "This is an example asset type scheme",
    "forms": []
  },
  "pagingInfo": null
}
Failure Message
{
  "success": false,
  "errorCode": "EntityExistsException",
  "errorMessage": "Example asset type scheme edit",
  "data": null,
  "pagingInfo": null
}

Delete asset type scheme

MethodDELETE
URL/rest/jip-api/1.0/schema/objectSchema/[assetTypeId].json
Sample Response
{
  "success" : true,
  "errorCode" : null,
  "errorMessage" : null,
  "data" : "",
  "pagingInfo" : null
}
Failure Message
{
  "success": false,
  "errorCode": "EntityNotFoundException",
  "errorMessage": "55",
  "data": null,
  "pagingInfo": null
}