GET POST | /ProductCategory/ProductCategoryGet | Gets information on existing product categories | 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 DiscountID descending order.
A. Get all the existing product categories (as mvProductCategories objects).
Value: {}
Response: {
"mvProductCategories": [
{
"ProductCategoryID": 14,
"ProductCategoryName": "Double Sided DVDs",
"ProductCategoryDescription": ""
},
{
"ProductCategoryID": 13,
"ProductCategoryName": "Gold Colored Cases",
"ProductCategoryDescription": "DVD/Bluray cases in gold color."
},
{
"ProductCategoryID": 12,
"ProductCategoryName": "DVD bundles",
"ProductCategoryDescription": "DVD bundles"
},
{
"ProductCategoryID": 11,
"ProductCategoryName": "DVDs in Case",
"ProductCategoryDescription": "DVDs in Case"
},
{
"ProductCategoryID": 10,
"ProductCategoryName": "Cases",
"ProductCategoryDescription": "Cases"
},
{
"ProductCategoryID": 9,
"ProductCategoryName": "DVDs",
"ProductCategoryDescription": "DVDs"
}
],
"ResponseStatus": {
"ErrorCode": "0"
}
}
B.
Returns the first mvProductCategory object with a ProductCategoryName that contains "case" with a description which contains the word "DVD".
We can add two Filters by using the AndOr operator as shown below:
Value: {
"Filters": [
{
"FieldName": "ProductCategoryName",
"SearchOperator": "Contains",
"SearchValue": "case"
},
{
"AndOr": "And",
"FieldName": "ProductCategoryDescription",
"SearchOperator": "Contains",
"SearchValue": "DVD"
}
],
"ReturnTopNRecords": 1
}
Response: {
"mvProductCategories": [
{
"ProductCategoryID": 13,
"ProductCategoryName": "Gold Colored Cases",
"ProductCategoryDescription": "DVD/Bluray cases in gold color."
}
],
"ResponseStatus": {
"ErrorCode": "0"
}
}
|
---|