GET POST | /WeightUnit/WeightUnitGet | Gets information on existing weight units | Uses your API Key and some Filters in an array format and returns the search results using given filters.
Optionally, you can use ReturnTopNRecords to limit the number of the results to the specified number (omit, or add ReturnTopNRecords = -1 to get all the available results). The ReturnTopNRecords chooses the top records in a WeightUnitID descending order.
A. Get all the existing weight units (as mvWeightUnit objects).
Value: {}
Response: {
"mvWeightUnits": [
{
"WeightUnitID": 3,
"WeightUnitAbbrev": "lb",
"WeightUnitName": "Pound(s)",
"WeightUnitConversionToGrams": 453.592370000
},
{
"WeightUnitID": 2,
"WeightUnitAbbrev": "oz",
"WeightUnitName": "Ounce(s)",
"WeightUnitConversionToGrams": 28.349523125
},
{
"WeightUnitID": 1,
"WeightUnitAbbrev": "g",
"WeightUnitName": "Gram(s)",
"WeightUnitConversionToGrams": 1.000000000
}
],
"ResponseStatus": {
"ErrorCode": "0"
}
}
B.
Returns the first mvWeightUnit object with a WeightUnitName that contains "ou" with an abbreviation which contains the letter "b".
We can add two Filters by using the AndOr operator as shown below:
Value: {
"Filters": [
{
"FieldName": "WeightUnitName",
"SearchOperator": "Contains",
"SearchValue": "ou"
},
{
"AndOr": "And",
"FieldName": "WeightUnitAbbrev",
"SearchOperator": "Contains",
"SearchValue": "b"
}
],
"ReturnTopNRecords": 1
}
Response: {
"mvWeightUnits": [
{
"WeightUnitID": 11,
"WeightUnitAbbrev": "lb",
"WeightUnitName": "Pound(s)",
"WeightUnitConversionToGrams": 453.592370000
}
],
"ResponseStatus": {
"ErrorCode": "0"
}
}
|
---|