Document toolboxDocument toolbox

Validation REST API

4.17.0

The Validation Type REST API is used to manage a list of manufacturer's model numbers for an asset. Validation Type provide a method to verify asset model number against a list of model numbers stored locally on the device. The mobile application will validate if model number exists in the list upon editing asset details. 

On this page:

Related pages:

Resource URL Summary

Retrieve the details of a specific Validation Type

GET /seiapi/v3/trans/Validations/${ValidationType}

Insert or Update the details of a specific Validation Type

PUT /seiapi/v3/trans/Validations/${ValidationType}

Update only supplied details of a specific Validation Type

PATCH /seiapi/v3/trans/Validations/${ValidationType}

Delete the details of a specific Validation Type

DELETE /seiapi/v3/trans/Validations/${ValidationType}

API Specific Parameters

ParameterDescription

${ValidationType}

Identifies the unique validation type object.

The valid values for ValidationType are:

  • AssetModelNumExists

HTTP Headers

This API uses the default ServiceMobility HTTP Headers.



API Specifics

Retrieve the details of a specific Validation Type

URL

GET /seiapi/v3/trans/Validations/${ValidationType}

HTTP Request Body

This request does not require a request body.

HTTP Response Body

On success, an HTTP response code of 200 will be returned, and the response body will contain a Validation Type Object. Otherwise, on error, the response body will contain a descriptive reason for the error. 

Insert or Update the details of a specific Validation Type

This REST API will insert the details of a specific Validation Type into the system, if details of a specific Validation Type does not already exist in the system.

If, however, the details of a specific Validation Type does already exist in the system, then this REST API will update (i.e. replace) the already existing Validation Type with the details supplied in the HTTP Request Body.

URL

PUT /seiapi/v3/trans/Validations/${ValidationType}

HTTP Request Body

The HTTP request body must contain a valid Validation Type Object.

HTTP Response

The API returns the standard response object on both success and error.

Update only supplied details of a specific Validation Type

This REST API will update an existing details of a specific Validation Type with the information provided.

Any existing information not specified in the new request will remain unchanged. If an item, in the PATCH request, has the Delete property set to true, then that item will be removed from the Validation Type. 

URL

PATCH /seiapi/v3/trans/Validations/${ValidationType}

API users with clients that do not support the PATCH method may use a POST method with the X-HTTP-Method-Override: PATCH header. See: http://jsonapi.org/recommendations/#patchless-clients

HTTP Request Body

The HTTP request body must contain a valid Validation Type Object.

HTTP Response

The API returns the standard response object on both success and error.

Delete the details of a specific Validation Type

URL

DELETE /seiapi/v3/trans/Validations/${ValidationType}

HTTP Request Body

This request does not require a request body.

HTTP Response

On success an HTTP response code of 200 will be returned. The system will return HTTP response code 410 in case of non-existent Validation Type Object.



PATCH Request Examples

The following examples assume the specified validation type already exist in the system. 

Example 1: Add new Asset Model Numbers

Initial Validation Type Object

{
   "GWH123": {
		"ID": "GWH123"
   }
} 

PATCH Request

{
   "UNK1024": {
		"ID": "UNK1024"
   },
   "GBC21": {
		"ID": "GBC21"
   }
} 

Result

{
   "GWH123": {
		"ID": "GWH123"
   },
   "UNK1024": {
		"ID": "UNK1024"
   },
   "GBC21": {
		"ID": "GBC21"
   }
} 

Example 2: Remove Existing Asset Model Numbers

Initial Validation Type Object

{
   "GWH123": {
		"ID": "GWH123"
   },
   "UNK1024": {
		"ID": "UNK1024"
   },
   "GBC21": {
		"ID": "GBC21"
   }
} 

PATCH Request

{
   "UNK1024": {
		"Delete": true
   }
} 

Result

{
   "GWH123": {
		"ID": "GWH123"
   },
   "GBC21": {
		"ID": "GBC21"
   }
}