Instances (Entities)

An instance (entity) is a single member of a collection such as one defect, one application module, and so on.

Overview

An instance (entity) is a single member of a collection such as one defect, one application module, and so on.

The fields of the entity are as defined by the fields metadata REST API for an entity.

Each instance described in the REST API can be accessed directly by ID.

  • A resource instance represents an object on the server side.

  • A resource instance is identified by its unique ID in relevant context.

  • An entity is resource instance.

  • A resource instance is identified using the following syntax:

    <context>/<resource collection>/<resource instance id>

Back to top

URI

An example of a URI of the containing collection with the ID of a defect instance appended:

.../api/shared_spaces/<shared_space_id/workspaces/<workspace_id>/defects/2005

Back to top

Note: For the syntax for specifying parameters in URIs, see Variables and values.

Supported request methods

Instance resources support the following HTTP request methods:

Method

Description

Supports...

GET

Retrieve the data

Read the entity

Supports: field selection

PUT

Update an existing entity

 

DELETE

Delete an existing entity

 

Back to top

Example

The following demonstrates a GET request for a defect resource instance, and the corresponding response:

GET .../api/shared_spaces/<shared_space_id>/workspaces/<workspace_id>/defects/1003

{
    "type": "defect",
    "creation_time": "2014-01-27T13:01:52Z",
    "parent": {
        "type": "work_item_root",
        "id": ​"1002"
    },
    "logical_name": "1nq47mymd4o28sxkyeker7l86",
    "version_stamp": ​1,
    "release": {
        "type": "release",
        "id": ​"1002"
    },
    "description": "<html><body>\ndefect 1\n</body></html>",
    "id": ​"1003",
    "last_modified": "2016-01-27T13:01:52Z",
    "severity": {
        "type": "list_node",
        "id": ​"1073"
    },
    "phase": {
        "type": "phase",
        "id": ​"1015"
    },
    "priority": null,
    "name": "def1",
}

Back to top

Actions on instances

Back to top

See also: