Examples

POST /api/v2/locker-items
{
  "data": {
    "type": "locker-items",
    "attributes": {
      "access-level": "private",
      "title": "My locker title",
      "custom-keywords": [
        "some",
        "keywords"
      ],
      "note": "my locker note",
      "item-type": "note",
      "reference": null,
      "created-at": null,
      "updated-at": null
    },
    "relationships": {
      "asset": {
        "data": {
          "type": "images",
          "id": "7"
        }
      },
      "entities": {
        "data": [
          {
            "type": "entities",
            "id": "492"
          }
        ]
      }
    }
  }
}
201
{
  "data": {
    "id": "10",
    "type": "locker-items",
    "links": {
      "self": "http://test.host/api/v2/locker-items/10"
    },
    "attributes": {
      "access-level": "private",
      "title": "My locker title",
      "custom-keywords": [
        "some",
        "keywords"
      ],
      "note": "my locker note",
      "item-type": "note",
      "reference": null,
      "created-at": "2017-08-29T10:52:28.507+08:00",
      "updated-at": "2017-08-29T10:52:28.507+08:00"
    },
    "relationships": {
      "asset": {
        "links": {
          "self": "http://test.host/api/v2/locker-items/10/relationships/asset",
          "related": "http://test.host/api/v2/locker-items/10/asset"
        }
      },
      "entities": {
        "links": {
          "self": "http://test.host/api/v2/locker-items/10/relationships/entities",
          "related": "http://test.host/api/v2/locker-items/10/entities"
        }
      }
    }
  }
}

Params

Param name Description
data
required

locker item information

Validations:

  • Must be a Hash

data[type]
required

Validations:

data[attributes]
required

Validations:

  • Must be a Hash

data[attributes][title]
optional , nil allowed

Title of the file

Validations:

  • Must be a String

data[attributes][source]
required

the file in data URL format

Validations:

  • Must be a String

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

Validations:

  • Must be a String

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

Validations:

  • Must be a String

data[relationships]
required

Validations:

  • Must be a Hash

data[relationships][asset]
required

Validations:

  • Must be a Hash

data[relationships][asset][data]
required

Validations:

  • Must be a Hash

data[relationships][asset][data][type]
required

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

Validations:

  • Must be a String

data[relationships][asset][data][id]
required

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.