GET /api/v2/locker-items
List of current account Locker Items


GET /api/v2/locker-items/:id
Show an Locker Item

Examples

GET /api/v2/locker-items/4
200
{
  "data": {
    "id": "4",
    "type": "locker-items",
    "links": {
      "self": "http://test.host/api/v2/locker-items/4"
    },
    "attributes": {
      "access-level": "private",
      "title": "My locker title",
      "custom-keywords": [],
      "note": "my locker note",
      "item-type": "note",
      "reference": null,
      "created-at": "2017-08-29T10:52:25.804+08:00",
      "updated-at": "2017-08-29T10:52:25.804+08:00"
    },
    "relationships": {
      "asset": {
        "links": {
          "self": "http://test.host/api/v2/locker-items/4/relationships/asset",
          "related": "http://test.host/api/v2/locker-items/4/asset"
        }
      },
      "entities": {
        "links": {
          "self": "http://test.host/api/v2/locker-items/4/relationships/entities",
          "related": "http://test.host/api/v2/locker-items/4/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.


POST /api/v2/locker-items
Create locker item

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.


PATCH /apiv2/locker-items/:id
Update a locker item

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.


DELETE /apiv2/locker-items/:id
Delete a locker item

Examples

DELETE /api/v2/locker-items/1
204
{}

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.