REST API - pagedcandidates

The table summarizes the REST API - pagedcandidates.

Request

Format
GET <baseurl>/directory/pagedcandidates/<containerid>/<page-size>
Path parameters
  • containerid: identifies the LDAP container from which the candidates are to be listed.
  • page-size: limits the number of candidate resources 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
  • include=string (optional, default=ALL): determines what entries should be included in the response. Can be:
    • EXISTING: include only entries from which a resource has already been created.
    • NON-EXISTING: include only entries from which no resource has yet been created.
    • ALL: include both existing and non-existing candidate resources. This is the default.
    • INVALID : include only the "invalid" resources. These are typically "missing" resources, which means that the resource’s DN in the LDAP source has changed and no longer matches the DN that had previously been retrieved for the resource from the LDAP source. (Note that if you request invalid resources using this option, the results will not be paged, that is, all invalid resources are returned. This is because invalid resources are actually held on the BPM node, not in LDAP.)
  • 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.

Response

JSON Returns a JSON representation of the content of the listCandidateResourcesResponse 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 candidate resources. 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 listCandidateResourcesResponse element (from the DirectoryService schema).

Same bookmark and estimated-size values as described above.

Example - First Request

Request
POST <baseurl>/directory/pagedcandidates/2/10
Response
{
  "xml-fragment": {
    "-container-id": "2",
    "-include": "ALL",
    "-estimated-size": "0",
    "-bookmark": "nkNjTg==",
    "candidate": [
      {
        "-name": "Aaron Cresswell",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=acresswell, OU=employees, O=goCarInsuranceHeadOffice"
      },
      {
        "-name": "Aaron Downes",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=adownes, OU=employees, O=goCarInsuranceHeadOffice"
      },
      {
        "-name": "Aaron Hardy",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=ahardy, OU=employees, O=goCarInsuranceHeadOffice"
      },
    .
    .
    .
{
        "-name": "Adie Moses",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=amoses, OU=employees, O=goCarInsuranceHeadOffice"
      },
      {
        "-name": "Adnan Ahmed",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=aahmed, OU=employees, O=goCarInsuranceHeadOffice"
      }
    ]
  }
}

Example - Subsequent Request

Request
POST <baseurl>/directory/pagedcandidates/2/10?bookmark=nkNjTg==
Response
{
  "xml-fragment": {
    "-container-id": "2",
    "-include": "ALL",
    "-estimated-size": "0",
    "-bookmark": "nkNjTg==",
    "candidate": [
      {
        "-name": "Adrian Leijer",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=aleijer, OU=employees, O=goCarInsuranceHeadOffice"
      },
      {
        "-name": "Aidy Boothroyd",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=aboothroyd, OU=employees, O=goCarInsuranceHeadOffice"
      },
      {
        "-name": "Akpo Sodje",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=asodje, OU=employees, O=goCarInsuranceHeadOffice"
      },
    .
    .
    .
{
        "-name": "Alan Jones",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=ajones, OU=employees, O=goCarInsuranceHeadOffice"
      },
      {
        "-name": "Alan Mcneill",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=amcneill, OU=employees, O=goCarInsuranceHeadOffice"
      },
      {
        "-name": "Alan Miller",
        "-ldap-alias": "deLdap5",
        "-ldap-dn": "UID=amiller, OU=employees, O=goCarInsuranceHeadOffice"
      }
    ]
  }
}