REST API - findByExample

The table summarizes the REST API - findByExample.

Request

Format
POST <baseurl>/globaldata/model/<caseType>/<version>/findbyexample
Path parameters
  • caseType: The case type is the fully qualified name of the case class. For example, com.example.gddemo.Customer. You can obtain this by running getCaseClassInfo.
  • version: The version of the case model. For example, 2 or 2.0.0.
Query parameters
  • start=integer (optional). Position in the case reference list from which to start this page. (The list is zero-based. To start at the first item, specify 0.)
  • count=integer (optional). Number of case references to include in the response. Specifying -1 returns all case references. If this parameter is used, the response also includes a hasMoreResults attribute to indicate if there are more case references than are shown in the response.
Body casePayload: Contains the parameters in the caseDataType element (from the BusinessDataServices schema).

This contains the searchable case attributes of the case data whose case references you want to find. Your request must be constructed to match the structure of the case data defined in your business object model. See Obtaining Information From TIBCO Business Studio.

Response

JSON Returns a JSON representation of the contents of a SearchResults element.
XML Returns the contents of a SearchResults element (from the BusinessDataServices schema).

Example

Request
POST <baseurl>/globaldata/model/com.example.hastings.Order/1/findbyexample?count=2
Body
<xml-fragment>
  <casePayload>
    <![CDATA[
    <hastings:OrderElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hastings="http://example.com/hastings" xsi:type="hastings:Order">
        <orderDate>2015-10-01Z</orderDate>
    </hastings:OrderElement>
    ]]>
  </casePayload>
</xml-fragment>
Response
{
  "xml-fragment": {
    "caseReference": [
      "BDS-1-com.example.hastings.Order-19-0",
      "BDS-1-com.example.hastings.Order-22-0"
    ],
    "hasMoreResults": "true"
  }
}