REST API - pagedquery

The table summarizes the REST API - pagedquery.

Request

Format
POST <baseurl>/directory/pagedquery/<ldapalias>/<page-size>
Path parameters
  • ldapalias: the alias of the LDAP shared resource on which the paged query is executed. LDAP connection shared resources are named with the prefix ldap/de/ in order to indicate that they are intended for Directory Engine use. The alias given here is that name without the ldap/de/ prefix. Can be obtained from a previous call to listLdapConnections.
  • page-size: limits the number of DNs returned to the number specified.

    Note - The LDAP server may impose its own page-size limit. If you specify a number in this parameter that is larger than a size limit specified on the LDAP server (which is commonly 1000), the LDAP server limit takes precedence.

Query parameters
  • basedn=string (optional): the base Distinguished Name (DN) to which the query is restricted. This is relative to, and in addition to, any base DN specified in the LDAP connection shared resource's URL.
  • bookmark: this parameter is not passed in the first call to get paged results; it is obtained from the response to the first call, then passed in subsequent calls to get additional pages of results.
  • scope: (optional) Restricts the depth to which the LDAP query search is applied to the LDAP directory structure. The valid values are:
    • ONELEVEL - Only the elements directly within the Base DN are searched.
    • SUBTREE - (default) The elements directly within, and below, the Base DN are searched.
Body ldap-query: the query to be executed.

Response

JSON Returns a JSON representation of the content of the executeLdapQueryResponse element.
  • bookmark: value is returned in the response. The bookmark value is passed in subsequent calls to get the next page of results. If the bookmark returns empty in the response, it means the end of the result set has been reached.
  • estimated-size: the estimated number of DNs that satisfy the query. Also note that this is not supported by all LDAP servers (the Apache LDAP server does not support it); when not supported, it returns 0.
XML Returns the content of the executeLdapQueryResponse element (from the DirectoryService schema).

Same bookmark and estimated-size values as described above.

Example - First Request

Request
POST <baseurl>/directory/pagedquery/deLdap5/10
Request body
(objectClass=organizationalPerson)
Response
{
  "xml-fragment": {
    "-ldap-alias": "deLdap5",
    "-ldap-query": "(objectClass=organizationalPerson)",
    "-search-scope": "SUBTREE",
    "-estimated-size": "0",
    "-bookmark": "ggzgZQ==",
    "ldap-entry": [
      { "-ldap-dn": "UID=acresswell, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=adownes, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=ahardy, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=ahughes, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=arooney, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=asmith, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=awatts, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=awilson, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=amoses, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=aahmed, OU=employees, O=goCarInsuranceHeadOffice" }
    ]
  }
}

Example - Subsequent Request

Request
POST <baseurl>/directory/pagedquery/deLdap5/10?bookmark=ggzgZQ==
Request body
(objectClass=organizationalPerson)
Response
{
  "xml-fragment": {
    "-ldap-alias": "deLdap5",
    "-ldap-query": "(objectClass=organizationalPerson)",
    "-search-scope": "SUBTREE",
    "-estimated-size": "0",
    "-bookmark": "ggzgZQ==",
    "ldap-entry": [
      { "-ldap-dn": "UID=aleijer, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=aboothroyd, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=asodje, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=abrown, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=acrawford, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=agoodall, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=agowling, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=ajones, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=amcneill, OU=employees, O=goCarInsuranceHeadOffice" },
      { "-ldap-dn": "UID=amiller, OU=employees, O=goCarInsuranceHeadOffice" }
    ]
  }
}