Add filters and sorts

Many actions in the API allow you to add a filter to return only certain response elements or a sort to display response elements in a certain order.

A filter is a special parameter that starts with the keyword filter, followed by an optional modifier, then a field name and a value. These are all examples of filters:

These are just a few filter types, and you can find more in filter-definition. Check an action in the reference (at Action reference) to see whether its response can be filtered. In general, if an action allows filters, you can use them on any response element or attribute.

A sort is another special parameter that starts with the keyword sort (or sort1 or sort2), followed by a field name and then one of the keywords asc or desc, for example:

These are just a few sort examples. You can test sorts in the browser or see sort-definition for more.

Make a call with a filter and sort

  1. Call principal-list again, displaying only groups and sorting them alphabetically by name:
    https://example.com/api/xml?action=principal-list&filter-type=group
        &sort-name=asc
    
  2. To tighten the response, choose a group from the list and filter on its name:
    https://example.com/api/xml?action=principal-list&filter-name=developers
    

    This time, only one group is returned:

    <?xml version="1.0" encoding="utf-8" ?> 
    <results>
        <status code="ok" /> 
        <principal-list>
            <principal principal-id="2007105030" account-id="624520" 
                        type="group" has-children="true" is-primary="false" 
                        is-hidden="false">
                <name>developers</name> 
                <login>developers</login> 
            </principal>
        </principal-list>
    </results>
    


Take a survey


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/breeze/6/xml_api/01_usin7.htm