View.GetItems
  • 14 May 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

View.GetItems

  • Dark
    Light
  • PDF

Article summary

Description

Returns items from a view.

URL parameters

URL parameter ordering

The URL parameters below are listed in the order they should be entered in the API URL.

NameRequiredTypeDescription
ViewIDTruenumericUnique identifier of the view.
CollectionIDFalsenumericUnique identifier of the collection.
REQUIRED if the view is a shared view in an agent group.
ItemStatusIncludeColumnFalsebooleanYes, NoYes to include the column in the data file. Default is No. See additional options below.
PageNumberFalsenumericPage number you want returned.
PageItemCountFalsenumericNumbers of items to show per page.
ViewParameter.JobIDFalsestringThe JobID that you want the items pulled from.
ViewParameter.<ParameterName>FalsestringUsed for dynamic view criteria. E.g. criterion:
Name Equals %NameValue% can be set with
ViewParameter.NameValue=Michael.

Optional parameters for ItemStatusInclude

NameRequiredTypeDescription
ItemStatusIncludeAddedFalsebooleanYes, No. Include added items.
ItemStatusIncludeChangedFalsebooleanYes, No. Include changed items.
ItemStatusIncludeUnchangedFalsebooleanYes, No. Include unchanged items.
ItemStatusIncludeDeletedFalsebooleanYes, No. Include deleted items.
ItemStatusRangeStartFalsebooleanyyyy-MM-dd HH:mm:ss – The beginning date to calculate the items that should be included with the view.
ItemStatusRangeEndFalsebooleanyyyy-MM-dd HH:mm:ss – The ending date to calculate the items that should be included with the view.
ItemStatusIncludeChangeMarkupFalsebooleanYes, No. Include a column with the changed markup.
Note

These item status filtering options have no effect unless ItemStatusIncludeColumn is true. See the Additional Information section below for usage.

Responses

NameTypeDescription
ResultstringSuccess if the operation was successful.
PageItemCountnumericItems per page.
PageNumbernumericPage number.
PageCountnumericTotal number of pages in the view.
ItemItemFields and values for items in the view.
Note

A maximum of 1,000 items will be returned even if the specified PageItemCount parameter is greater than 1000.

Sample request

curl -X GET 'https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=View.GetItems&ViewID=1022&ViewParameter.JobID=04E2DA-DF22-4239-A343-DE685AF54EC6&PageNumber=1&PageItemCount=20&ViewParameter.Name=Michael'

Sample responses

XML

<?xml version="1.0" encoding="utf-8" ?>
<ViewGetItemsResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Result>Success</Result>
	<PageItemCount>2</PageItemCount>
	<PageNumber>2</PageNumber>
	<PageCount>106</PageCount>
	<ItemList>
		<Item>
			<ItemID>1092</ItemID>
			<Year>2000</Year>
			<Make>BMW</Make>
			<Model>328CI</Model>
			<Price>$7490</Price>
			<Telephone>4049141131</Telephone>
			<AreaCode>404</AreaCode>
			<Source>A1Cars</Source>
		</Item>
		<Item>
			<ItemID>1103</ItemID>
			<Year>2003</Year>
			<Make>BMW</Make>
			<Model>525i</Model>
			<Price>$14850</Price>
			<Telephone>8606342015</Telephone>
			<AreaCode>860</AreaCode>
			<Source>A1Cars</Source>
		</Item>
	</ItemList>
</ViewGetItemsResponse>

JSON (add &ResponseFormat=JSON)

{
    "PageItemCount": 2,
    "PageNumber": 1,
    "PageCount": 25,
    "Item": [
        {
            "ItemID": 1001,
            "State": "Alabama",
            "Initial": "AL"
        },
        {
            "ItemID": 1002,
            "State": "Alaska",
            "Initial": "AK"
        }
    ],
    "JsonResult": {
        "Command": "View.GetItems",
        "AutoLoggedIn": false,
        "WebConsoleKey": "",
        "Result": "Success",
        "ErrorCode": "",
        "ErrorDescription": "",
        "ErrorList": [],
        "ExecutionTime": {
            "Ticks": 0,
            "Days": 0,
            "Hours": 0,
            "Milliseconds": 0,
            "Minutes": 0,
            "Seconds": 0,
            "TotalDays": 0,
            "TotalHours": 0,
            "TotalMilliseconds": 0,
            "TotalMinutes": 0,
            "TotalSeconds": 0
        }
    }
}

Additional Information

ItemStatusInclude options

  • If any item status filtering options are set to true, the results will only include items with those statuses.
  • If no item status filtering option is set to true, and any are set to false, the results will include items with all statuses not set to false.
  • Finally, if no item status filtering options are set at all, the results will include items with statuses of Added, Changed, and UnChanged, but not Deleted.

ItemStatusRange options

  • If the ItemStatusRangeStart and ItemStatusRangeEnd values are not provided, the system uses the start and end times of the supplied JobID.
  • If no JobID is supplied, the system will get this range from the most recently created job for this Agent.

Was this article helpful?