Retrieving a full Evidence Tree for use with a custom UI or application

By utilising the evidence endpoint, it is possible to retrieve the full evidence tree behind a decision (a result of a query). The tree can be navigated by making additional requests to the evidence endpoint using factIDs returned in previous responses. Therefore, in order to retrieve the whole tree, you should expect to make a set of recursive requests.

Here is an example:

  1. By using the factID found in the result object of a Rainbird query, an initial request can be made to the evidence endpoint.

  2. The response will contain the information about the fact which the factID represents.

  3. If the source of this fact was a rule, the response object will contain a rule object. Within the rule object, a conditions array will contain information about how each condition was satisfied.

  4. Loop through each condition.

  5. If the condition contains subject, relationship and object properties, it will also contain a factID property. In order to follow this branch of the Evidence Tree, you should now make an additional request to the evidence endpoint using the condition's factID and continue to step 2. If the condition doesn't contain a factID property, you are at the end of this branch.

This endpoint is optionally secured with a key, which can be configured via the Rainbird Studio. This key must then be provided in the x-evidence-key header to access evidence.

Last updated