Valuekeep Developers - Web API Reference

Framework | Unit

Service to manage entities of type 'Unit'.

Overview


URL api/{tenantKey}/{orgKey}/corePatterns/units
Methods Supported GET, POST, PUT, DELETE

All Operations

This service includes the following operations:

All Resources

This service uses the following resources:

GET Operations

GET Units (odata)

Returns a page of the list of all the entity records available.

The following elements are optional:

opts (ODataQueryOptions) OData query option.

Response:

When successful, the response body contains the list of records available. See UnitResource.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

GET /corePatterns/units/odata

GET Unit by identifier

Returns the entity record that matches the specified identifier.

The following elements are required:

id (string) The record identifier.

Response:

When successful, the response body contains the entity record. See UnitResource.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

GET /corePatterns/units/{id}

GET Unit by key

Returns the entity record that matches the specified key.

The following elements are required:

unitKey (string) The key for the unit.

Response:

When successful, the response body contains the entity record. See UnitResource.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

GET /corePatterns/units/{unitKey}

POST Operations

POST Units

Creates a new entity record.

The following elements are required:

unitResource (ApiUnitResource) The request body should contain the entity record that should be created.
See ApiUnitResource.

Response:

When successful, the response body contains the new entity record identifier. The resource header location property contains the URL for the new entity record. See ApiUnitResource.

Response status codes:

201 Created. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

POST /corePatterns/units

PUT Operations

PUT Set BaseUnit Unit

Updates the value of attribute 'BaseUnit' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/baseUnit

PUT Set ConversionFactor Unit

Updates the value of attribute 'ConversionFactor' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (decimal) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/conversionFactor

PUT Set Description Unit

Updates the value of attribute 'Description' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/description

PUT Set Dimension Unit

Updates the value of attribute 'Dimension' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/dimension

PUT Set IsActive Unit

Updates the value of attribute 'IsActive' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (bool) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

PUT /corePatterns/units/{unitKey}/isActive

PUT Set IsDimensionBaseUnit Unit

Updates the value of attribute 'IsDimensionBaseUnit' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (bool) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/isDimensionBaseUnit

PUT Set PrecisionDigits Unit

Updates the value of attribute 'PrecisionDigits' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (int) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/precisionDigits

PUT Set Symbol Unit

Updates the value of attribute 'Symbol' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/symbol

PUT Set UnecerEc20Code Unit

Updates the value of attribute 'UnecerEc20Code' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/unecerEc20Code

PUT Set UnitKey Unit

Updates the value of attribute 'UnitKey' in the specified entity record.

The following elements are required:

unitKey (string) The key for the unit.
value (string) The request body should contain the new value for the attribute.

Response:

When successful, the response body is empty.

Response status codes:

200 OK. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.

Resource URL:

PUT /corePatterns/units/{unitKey}/unitKey

DELETE Operations

DELETE Unit by identifier

Deletes the entity record that matches the specified identifier.

The following elements are required:

id (string) The record identifier.

Response:

When successful, the response body is empty.

Response status codes:

204 Deleted. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

DELETE /corePatterns/units/{id}

DELETE Unit by key

Deletes the entity record that matches the specified key.

The following elements are required:

unitKey (string) The key for the unit.

Response:

When successful, the response body is empty.

Response status codes:

204 Deleted. The operation was completed successfully.
400 BadRequest. The request parameters are invalid.
404 NotFound. The specified record does not exist.

Resource URL:

DELETE /corePatterns/units/{unitKey}

Resources


ApiUnitResource

The following elements are required:

unitKey (string) The key for the unit.
precisionDigits (int) The precision digits.
conversionFactor (decimal) The conversion factor.
dimension (string) The unit’s dimension.
isDimensionBaseUnit (bool) Dimension Base Unit.

The following elements are optional:

description (string) The unit’s description.
symbol (string) The unit’s symbol.
baseUnit (string) The base unit.
unecerEc20Code (string) Unecer Ec20.


UnitResource

The following elements are required:

unitKey (string) The key for the unit.
precisionDigits (int) The precision digits.
conversionFactor (decimal) The conversion factor.
dimension (string) The unit’s dimension.
(fk) Allowed value: the natural key of a record of type UnitDimension. These records are accessibly through the UnitDimensions service.
isDimensionBaseUnit (bool) Dimension Base Unit.

The following elements are optional:

description (string) The unit’s description.
symbol (string) The unit’s symbol.
baseUnit (string) The base unit.
(fk) Allowed value: the natural key of a record of type Unit. These records are accessibly through the Units service.
unecerEc20Code (string) Unecer Ec20.