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 .xml suffix or ?format=xml

HTTP + XML

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

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

<ProductClientGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <Filters xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints">
    <Filter>
      <AndOr>And</AndOr>
      <FieldName>String</FieldName>
      <Group>Undefined</Group>
      <SearchOperator>Undefined</SearchOperator>
      <SearchValue>String</SearchValue>
    </Filter>
  </Filters>
  <ReturnTopNRecords xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints">0</ReturnTopNRecords>
  <APIKEY>String</APIKEY>
</ProductClientGet>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ProductClientGetResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvProductClient xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:mvProductClient i:nil="true" />
  </mvProductClient>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
      </d2p1:ResponseError>
    </d2p1:Errors>
  </ResponseStatus>
  <InternalErrorCode>String</InternalErrorCode>
</ProductClientGetResponse>