Property Selection
Selecting context response properties using the API is accomplished using paths, include and expand query arguments.
paths
string[]
An array of properties to which the response should be limited.
include
string[]
An array of properties marked as optional that should be included in the response.
expand
string[]
An array of expandable reference that should be expanded in the response.
You can specify any of the above query arguments multiple times. For example, if you need to expand multiple properties, you can do so with the following query string.
Examples
The example below shows:
A reference automatically expanded by selecting a path in the referenced context (creator.name.first).
A response limited to the paths specified by the paths[] query arguments.
An explicit reference expansion using expand[]=account.
An optional path included with include[]=connections.
An implicitly included optional path through the use of paths[]=posts;
Another example would be to automatically expand into the account reference and limit the properties to first name of the referenced account. The account name may not be accessible to the caller, but the Patient File account property reference has an ACL that allows the name to be read by caller with a Connection to the patient file:
Expand Account Reference
Limiting Response Properties
Clients can shrink responses by limiting the properties returned by an API request using the paths
query argument. Sub paths
must be in dot syntax (eg. name.first
) and must exist in the object definition.
Object responses always include the
_id
andobject
properties.Selecting an optional property using
paths
automatically includes it.Selecting a path in a reference is possible (eg
creator.name.first
), automatically expanding the referenced context.
Expanding References
References marked as expandable can be expanded into full objects. This can result in less API calls when the client wants to access information in the referenced object.
Depending on the reference property definition, using expand[]
may limit the resulting expansion to a set of paths, may grant greater context access than the caller would normally have or allow greater access to a set of properties.
For more information about configuration options, see the section about References.
Optional Properties
Some object properties are marked as optional. Typically, these are non-critical properties that would be expensive to include
in every set of responses. For example, the connections and posts properties of objects are optional so wouldn't be
included in the result of a call to GET /patientfiles
. To retrieve properties marked as optional, use the include[]
query argument.
When using paths[]
, included optional properties will be part of the response.
List Property Selections
Properties that return a list of contexts, such as posts and connections can have selection arguments passed by prefixing them with the property name. For example:
Last updated