Retrieve a Single Object

Retrieving a Single Object

This function allows you to retrieve a single object of the given type and with the given ID.

Relative URLHTTP Request Method

/api/v4/backend-deployment-id/objects/model/object-id.json

GET

  • Replace model with the type of object that you wish to retrieve (as defined in your app's Data Model) for example person, job or asset.

  • Replace object-id with the ID of the specific object.

  • Replace format with the response data format (json or xml), or leave it out.

Parameters

This function does not take any parameters.

Response

The response includes the single object requested. The format of the object is the same as for Retrieving all Objects.

Example

BASE-URL

The below examples contain a BASE-URL placeholder. Please refer to the HTTP Endpoints section to get the base URL relevant to your deployment.

Sample request:

GET BASE-URL/api/v4/533bda53027894f69b001055/objects/task/c3d59ff0-ba4a-11e3-a567-001e6733fe3c.json

Sample response:

json
{
    "id": "c3d59ff0-ba4a-11e3-a567-001e6733fe3c",
    "type": "task",
    "updated_at": "2015-02-05T08:17:58Z",
    "display": "Buy Groceries",
    "name": "Buy Groceries",
    "instructions": "Not too much",
    "status": {
      "key": 1,
      "display": "rubyClosed"
    },
    "category_id": "71fafc16-ba4f-11e3-8de0-001e6733fe3c"
}

You can optionally retrieve related objects that the object belongs-to in one operation.

Parameters

Specify the relationship names for the related objects you want to retrieve as a comma-separated list in a parameter named embed.

Example

BASE-URL

The below examples contain a BASE-URL placeholder. Please refer to the HTTP Endpoints section to get the base URL relevant to your deployment.

Let's say our Data Model allows for task objects that belong to category objects, so that each category has many tasks. When we're retrieving a task, we can embed the related category that it belongs to as follows:

Sample request:

GET BASE-URL/api/v4/533bda53027894f69b001055/objects/task/c3d59ff0-ba4a-11e3-a567-001e6733fe3c.json?embed=category

The response features the task object with the category object that it belongs to embedded inside it:

json
{
    "id": "c3d59ff0-ba4a-11e3-a567-001e6733fe3c",
    "type": "task",
    "updated_at": "2015-02-05T08:17:58Z",
    "display": "Buy Groceries",
    "name": "Buy Groceries",
    "instructions": "Not too much",
    "status": {
         "key": 1,
         "display": "Closed"
    },
    "category_id": "71fafc16-ba4f-11e3-8de0-001e6733fe3c",
    "category": {
        "id": "71fafc16-ba4f-11e3-8de0-001e6733fe3c",
        "type": "category",
        "updated_at": "2015-02-05T08:18:09Z",
        "display": "Household",
        "name": "Household"
    }
}

Last updated