Examples

PATCH /api/v2/locker-items/3
{
  "data": {
    "id": "3",
    "type": "locker-items",
    "attributes": {
      "access-level": "private",
      "title": "a new title",
      "custom-keywords": [],
      "note": "my locker note",
      "item-type": "note",
      "reference": null,
      "created-at": "2017-08-29 10:52:25 +0800",
      "updated-at": "2017-08-29 10:52:25 +0800"
    },
    "relationships": {
      "entities": {
        "data": [
          {
            "type": "entities",
            "id": "485"
          }
        ]
      }
    }
  }
}
200
{
  "data": {
    "id": "3",
    "type": "locker-items",
    "links": {
      "self": "http://test.host/api/v2/locker-items/3"
    },
    "attributes": {
      "access-level": "private",
      "title": "a new title",
      "custom-keywords": [],
      "note": "my locker note",
      "item-type": "note",
      "reference": null,
      "created-at": "2017-08-29T10:52:25.000+08:00",
      "updated-at": "2017-08-29T10:52:25.000+08:00"
    },
    "relationships": {
      "asset": {
        "links": {
          "self": "http://test.host/api/v2/locker-items/3/relationships/asset",
          "related": "http://test.host/api/v2/locker-items/3/asset"
        }
      },
      "entities": {
        "links": {
          "self": "http://test.host/api/v2/locker-items/3/relationships/entities",
          "related": "http://test.host/api/v2/locker-items/3/entities"
        }
      }
    }
  }
}

Params

Param name Description
id
required

locker item ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.

data
required

locker item information

Validations:

  • Must be a Hash

data[type]
optional

Validations:

data[attributes]
optional

Validations:

  • Must be a Hash

data[attributes][title]
optional , nil allowed

Title of the file

Validations:

  • Must be a String

data[attributes][source]
optional

the file in data URL format

Validations:

  • Must be a String

data[attributes][source-file-name]
optional

Validations:

  • Must be a String

data[attributes][source-file-size]
optional , nil allowed

Validations:

  • Must be a String

data[relationships]
optional

Validations:

  • Must be a Hash

data[relationships][asset]
optional

Validations:

  • Must be a Hash

data[relationships][asset][data]
optional

Validations:

  • Must be a Hash

data[relationships][asset][data][type]
optional

asset type: which can be `insight_document`, `image`

Validations:

  • Must be a String

data[relationships][asset][data][id]
optional

asset ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.