Object Details

All object types can store additional data in a "details" field using JSON format. The top level element must be an object or an array. Unlike properties, values stored in JSON aren't limited to strings and won't be included in search queries over objects (except for links). The details field commonly stores data necessary for an object to conform to a specific type or convention. You can store any arbitrary JSON except for specific reserved terms. You can use the getDetails call to access an object's details content.

Linking

The details field supports "links" that reference other objects. For example, a file can include an "index" field that links to its corresponding index file. Links use this JSON format:

{"$dnanexus_link": "<class>-<xxxx>"}

Links become active when both objects exist in the same project. If you have a file with a link to an index, but the index doesn't exist in your project, the link won't work. However, if you later clone the index file into your project, the link becomes functional. You can also use links to reference objects in public datasets.

To find an object's links:

API method: /class-xxxx/setDetails

Specification

Re-sets the content of the object's details.

Inputs

  • Any conformant JSON, which is defined as a JSON object or array per RFC4627. This will be the new content.

Outputs

  • id string ID of the manipulated object

Errors

  • ResourceNotFound (the specified object in the URL does not exist)

  • InvalidInput (the string "$dnanexus_link" was found as a key but is not the single key in a hash or has a value which is not a string)

  • PermissionDenied (UPLOAD access required for the project in which the object was created)

  • InvalidState (the object is not in the "open" state)

API method: /class-xxxx/getDetails

Specification

Retrieves the content of the object's details.

Inputs

  • project string (optional) ID of a project that the getDetails call will be scoped to. If the object cannot be found in that project a ResourceNotFound error will be returned.

Outputs

  • The contents of the object's details

Errors

  • ResourceNotFound (the specified object in the URL does not exist)

  • PermissionDenied (VIEW access required)

Last updated

Was this helpful?