Megaventory API v2017a

<back to all web services

DashboardBoxGet

The following routes are available for this service:
GET POST/DashboardBox/DashboardBoxGetGets Dashboard boxesUses your API key and some Filters in an array format and returns the search results using the given filters. Optionally, you can use ReturnTopNRecords to limit the number of the results to the specifed number (omit, or add ReturnTopNRecords = -1 to get all the available results). The ReturnTopNRecords chooses the top records in a DashboardBoxID in a descending order.

Examples:



A.


Return the first Dashboard box of the Sales Orders

Value:

 {
  "Filters": [
    {
      "FieldName": "DashboardBoxGridType",
      "SearchOperator": "Equals",
      "SearchValue": "sales_orders"
    }
  ],
  "ReturnTopNRecords": "1"
}

Response:

{
  "mvDashboardBoxes": [
    {
      "DashboardBoxID": 4572,
      "DashboardBoxTitle": "Main Warehouse Only",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "sell",
      "DashboardBoxGridType": "sales_orders"
    }
  ],
  "ResponseStatus": {
    "ErrorCode": "0"
  }
}

B.


Return all the Dashboard boxes belonging to Sales Orders or Purchase Orders. ReturnTopNRecords = -1 may be omitted in this case.

Value:

{
    "Filters": [
        {
            "FieldName": "DashboardBoxGridType",
            "SearchOperator": "Equals",
            "SearchValue": "sales_orders"
        },
        {
            "AndOr": "Or",
            "FieldName": "DashboardBoxGridType",
            "SearchOperator": "Equals",
            "SearchValue": "purchase_orders"
        }
    ],
    "ReturnTopNRecords": "-1"
}

Response:

{
  "mvDashboardBoxes": [
    {
      "DashboardBoxID": 4572,
      "DashboardBoxTitle": "Main Warehouse Only",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "sell",
      "DashboardBoxGridType": "sales_orders"
    },
    {
      "DashboardBoxID": 4569,
      "DashboardBoxTitle": "Only Shipped",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "sell",
      "DashboardBoxGridType": "sales_orders"
    },
    {
      "DashboardBoxID": 4559,
      "DashboardBoxTitle": "POs due Next 30d",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "purchase",
      "DashboardBoxGridType": "purchase_orders"
    },
    {
      "DashboardBoxID": 4540,
      "DashboardBoxTitle": "POs to receive today/tomorrow",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "purchase",
      "DashboardBoxGridType": "purchase_orders"
    },
    {
      "DashboardBoxID": 4538,
      "DashboardBoxTitle": "Need to be packed",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "sell",
      "DashboardBoxGridType": "sales_orders"
    },
    {
      "DashboardBoxID": 4535,
      "DashboardBoxTitle": "Expensive SOs to GO",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "sell",
      "DashboardBoxGridType": "sales_orders"
    },
    {
      "DashboardBoxID": 4534,
      "DashboardBoxTitle": "not completed",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "sell",
      "DashboardBoxGridType": "sales_orders"
    },
    {
      "DashboardBoxID": 4531,
      "DashboardBoxTitle": "POs to approve",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "purchase",
      "DashboardBoxGridType": "purchase_orders"
    },
    {
      "DashboardBoxID": 4530,
      "DashboardBoxTitle": "POs exp. next week",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "purchase",
      "DashboardBoxGridType": "purchase_orders"
    },
    {
      "DashboardBoxID": 4529,
      "DashboardBoxTitle": "POs exp. today",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "purchase",
      "DashboardBoxGridType": "purchase_orders"
    },
    {
      "DashboardBoxID": 4528,
      "DashboardBoxTitle": "Approved POs",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "purchase",
      "DashboardBoxGridType": "purchase_orders"
    },
    {
      "DashboardBoxID": 4526,
      "DashboardBoxTitle": "Approved Sales Orders",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "sell",
      "DashboardBoxGridType": "sales_orders"
    },
    {
      "DashboardBoxID": 3499,
      "DashboardBoxTitle": "All SOs",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "sell",
      "DashboardBoxGridType": "sales_orders"
    },
    {
      "DashboardBoxID": 2496,
      "DashboardBoxTitle": "All Purchase Orders",
      "DashboardBoxDescription": "",
      "DashboardBoxType": "purchase",
      "DashboardBoxGridType": "purchase_orders"
    }
  ],
  "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/DashboardBoxGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/xml
Content-Length: length

<DashboardBoxGet 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>
</DashboardBoxGet>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DashboardBoxGetResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvDashboardBoxes xmlns:d2p1="http://schemas.datacontract.org/2004/07/Megaventory.Models" i:nil="true" />
  <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>
</DashboardBoxGetResponse>