View.GetCriteria
  • 14 May 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

View.GetCriteria

  • Dark
    Light
  • PDF

Article summary

Description

Returns a list of criteria currently specified on the view.

URL parameters

NameRequiredTypeDescription
ViewIDTruenumericUnique identifier of the view.

Responses

NameTypeDescription
ResultstringSuccess if the operation was successful.
CriteriaCriteriaObject representing the view criteria.

Sample request

curl -X GET 'https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=View.GetCriteria&ViewID=1103'

Sample responses

XML

<?xml version="1.0" encoding="utf-8"?>
<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <CriteriaList>
    <Criteria>
      <FieldID>91729</FieldID>
      <ViewCriteriaID>1381</ViewCriteriaID>
      <ComparisonOrder>1</ComparisonOrder>
      <AndOr />
      <Operator>Equals</Operator>
      <ComparisonValue>Africa</ComparisonValue>
      <Name>Location</Name>
    </Criteria>
    <Criteria>
      <FieldID>91723</FieldID>
      <ViewCriteriaID>1382</ViewCriteriaID>
      <ComparisonOrder>2</ComparisonOrder>
      <AndOr>And</AndOr>
      <Operator>Contains</Operator>
      <ComparisonValue>New</ComparisonValue>
      <Name>Title</Name>
    </Criteria>
  </CriteriaList>
</ApiResponse>

JSON (add &ResponseFormat=JSON)

{
    "Criteria": [
        {
            "FieldID": 91729,
            "ViewCriteriaID": 1381,
            "ComparisonOrder": 1,
            "AndOr": "",
            "Operator": "Equals",
            "ComparisonValue": "Africa",
            "Name": "Location"
        },
        {
            "FieldID": 91723,
            "ViewCriteriaID": 1382,
            "ComparisonOrder": 2,
            "AndOr": "And",
            "Operator": "Contains",
            "ComparisonValue": "New",
            "Name": "Title"
        }
    ],
    "JsonResult": {
        "Command": "View.GetCriteria",
        "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
        }
    }
}

Was this article helpful?

What's Next