Other Useful API Tricks

Linking a New Evaluation to an Existing Entity

curl -X POST https://sandbox.alloy.co/v1/evaluations \
  -H "Content-Type: application/json" \
  -u workflow_token:workflow_secret \
  -H "Alloy-Entity-Token: E-lCJeGUO7NGLC52BisUJP" \
  -d $'{
    "name_first": "John",
    ...
  }'

Passing an entity token in the header of a request will link any new evaluation to that existing entity. An example of this in action can be seen to the right.

Refreshing the cache

curl -X POST https://sandbox.alloy.co/v1/evaluations \
  -H "Alloy-Refresh-Cache: true" \
  ...

All requests try to use cached service output as much as possible. If the input to an upstream service is exactly the same as we have seen in the past and the configurations for that service are also the same, we will get the result out of the cache if possible. To override this functionality, just pass Alloy-Refresh-Cache: true as a header for each request and the cache will be bypassed.

Bypassing automatic formatting

curl -X POST https://sandbox.alloy.co/v1/evaluations \
  -H "Alloy-Bypass-Formatter: true" \
  ...

All request attributes are formatted to make matching easier across services. Sometimes this results in unexpected or unwanted behavior. For instance, the address may be legitimate, but our formatter does not recognize it and changes it to a similar address. In this case, you can bypass the formatter by specifying a header in the request.

Specifying an application version

curl -X POST https://sandbox.alloy.co/v1/evaluations \
  -H "Alloy-Application-Version: 108" \
  ...

By default the API uses the "pinned" application version from the dashboard. This can be overridden however by passing the Alloy-Application-Version header with the version ID of the desired application version.


Did this page help you?