Megaventory API v2017a

<back to all web services

CustomReportGetData

The following routes are available for this service:
GET POST/CustomReport/CustomReportGetDataGets Custom Report DataUses your API key and a CustomReportId to return data based on the Custom Report. If the Custom Report has parameters, you can specify them using the CustomReportParameters object. Optionally, you may use the Page and Limit parameters to control the data you receive. Use Page to specify a subset of data and Limit to set the maximum number of entries (up to 1000) for that subset.

Date1 and Date2 should be in format "yyyy-MM-dd".

Examples:



Return the first three rows of data from a Custom Report with ID 12345, passing parameters for Text1, Date1, and Date2.
Text1 is a string and has a value of 18.
Date1 is a date and has a value of 2025 January 1st.
Date2 is a date and has a value of 2025 May 1st.


Value:

 {
  "CustomReportId": "12345",
  "CustomReportParameters": {
    "Text1": "18",
    "Date1": "2025-01-01",
    "Date2": "2025-05-01"
  },
  "Page": 1,
  "Limit": 3
}

Response:

{
  "Rows": [
    {
      "Index": 0,
      "Data": [
        {
          "ColumnId": "0",
          "ColumnName": "ID",
          "Value": 34168
        },
        {
          "ColumnId": "1",
          "ColumnName": "SKU",
          "Value": "48813623343"
        },
        {
          "ColumnId": "2",
          "ColumnName": "Barcode",
          "Value": "234rdsw388"
        }
      ]
    },
    {
      "Index": 1,
      "Data": [
        {
          "ColumnId": "0",
          "ColumnName": "ID",
          "Value": 34356
        },
        {
          "ColumnId": "1",
          "ColumnName": "SKU",
          "Value": "6564534434"
        },
        {
          "ColumnId": "2",
          "ColumnName": "Barcode",
          "Value": "sdfs56"
        }
      ]
    },
    {
      "Index": 2,
      "Data": [
        {
          "ColumnId": "0",
          "ColumnName": "ID",
          "Value": 34100
        },
        {
          "ColumnId": "1",
          "ColumnName": "SKU",
          "Value": "233324354"
        },
        {
          "ColumnId": "2",
          "ColumnName": "Barcode",
          "Value": "gb65g53"
        }
      ]
    }
  ],
  "ResponseStatus": {
    "ErrorCode": "0"
  }
}

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

HTTP + JSV

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

POST /jsv/reply/CustomReportGetData HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/jsv
Content-Length: length

{
	APIKEY: String,
	CustomReportId: 0,
	CustomReportParameters: 
	{
		Text1: String,
		Text2: String,
		Text3: String,
		Text4: String,
		MultipleValues1: 
		[
			0
		],
		Date1: String,
		Date2: String
	},
	Page: 0,
	Limit: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Rows: 
	[
		{
			Index: 0,
			Data: 
			[
				{
					ColumnId: String,
					ColumnName: String,
					Value: {}
				}
			]
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	}
}