Megaventory API v2017a

<back to all web services

ProductClientGet

The following routes are available for this service:
GET POST/ProductClient/ProductClientGetGets information on existing product-client relationshipsUses 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 ProductID descending order.

Examples:



A.

Return all the product clients that are linked to product with "ProductID = 1". The results are returned as mvProductClient objects.
We can add one Filter as shown below:

Value:

  {
   "Filters": [
      {
         "FieldName": "ProductID",
         "SearchOperator": "Equals",
         "SearchValue": "1"
      }
   ]
} 

Response:

 {
   "mvProductClient": [
      {
         "ProductID": 1,
         "ProductClientID": 1,
         "ProductClientPrice": 0,
         "ProductClientSKU": "",
         "ProductClientDescription": ""
      },
      {
         "ProductID": 1,
         "ProductClientID": 2,
         "ProductClientPrice": 0,
         "ProductClientSKU": "",
         "ProductClientDescription": ""
      }
   ],
   "ResponseStatus": {
      "ErrorCode": "0"
   }
}

To override the Content-type in your clients HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /json/reply/ProductClientGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/json
Content-Length: length

{"Filters":[{"AndOr":"And","Group":"Undefined","FieldName":"String","SearchOperator":"Undefined","SearchValue":"String"}],"ReturnTopNRecords":0,"APIKEY":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"mvProductClient":[{}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"InternalErrorCode":"String"}