Items

The Item object#

Item structure depends on the itemsType and properties defined for the collection. A collection set with an itemsType to Contact will store "@type": "Contact" items.

{
"@context": {...},
"@id": "ChTOSFASLKdVOraA",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"@type": "{{itemType}}",
...
}

Properties#

PropertyTypeDescription
@contextobjectOptional
@idstringUnique identifier for the object
@typestringValue comes from collection itemsType property
createdAtstringTimestamp of object creation, expressed according to ISO 8601.
updatedAtstringTimestamp of object last update, expressed according to ISO 8601.

Example#

A collection with 2 properties with key: firstName and lastName will have items with the structure below:

Item Object
{
"@context": {...},
"@id": "ChTOSFASLKdVOraA",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"@type": "Person",
"firstName": "John",
"lastName": "Malkovich",
}

Create an item#

POST https://data.datablist.com/:workspace_id/collections/:collection_id/items
{
"@type": "{{itemType}}",
...
}

The createdAt and @id value can be set on a POST request. If not provided, will be auto generated. If an object already exist with the same @id, an error will be raise (http_status 400 and IntegrityError code).

Retrieve an item#

GET https://data.datablist.com/:workspace_id/collections/:collection_id/items/:item_id

Response - HTTP 200
{
"@context": {...},
"@id": "ChTOSFASLKdVOraA",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"@type": "{{itemType}}",
...
}

Update an item#

Partial#

PATCH https://data.datablist.com/:workspace_id/collections/:collection_id/items/:item_id
{
"a_property": "Updated value"
}

On success, returns an empty HTTP 204 No Content.

Full update#

PUT https://data.datablist.com/:workspace_id/collections/:collection_id/items/:item_id
{
"@id": "ChTOSFASLKdVOraA",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"@type": "itemType",
...
}

On success, returns an empty HTTP 204 No Content.

List all items#

GET https://data.datablist.com/:workspace_id/collections/:collecton_id/items?count=10

To paginate:

GET https://data.datablist.com/:workspace_id/collections/:collecton_id/items?count=10&start_after_document_id=XX

info

There is no pagination by default. A call without the count parameter will return all the items in the collection. To paginate your items, use count and the start_after_document_id GET parameters.

Response - HTTP 200
{
"@context": {...},
"data": [{
"@id": "ChTOSFASLKdVOraA",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"@type": "{{itemType}}",
...
},{
"@id": "SDFSAODFASFD",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"@type": "{{itemType}}",
...
}]
}

Delete an item#

DELETE https://data.datablist.com/:workspace_id/collections/:collection_id/items/:item_id

On success, returns an empty HTTP 204 No Content.

Bulk create items#

POST https://data.datablist.com/:workspace_id/collections/:collection_id/items/bulk
[{
"@type": "{{itemType}}",
...
},{
"@type": "{{itemType}}",
...
}]

The createdAt and @id value can be set. If not provided, will be auto generated. If an object already exist with the same @id, an error will be raise (http_status 400 and IntegrityError code). On success, return a 201 response with a listing of created @ids

{
"@context": {...},
"data":[{
"@id": "ChTOSFASLKdVOraA"
},{
"@id": "SDFSAODFASFD"
}]
}

Bulk operations work like a transaction. Any error during the creation lead to no item being created.

Bulk update items#

Bulk update operations take a list of ["item_id", {...}] tuples.

Bulk partial update#

PATCH https://data.datablist.com/:workspace_id/collections/:collection_id/items/bulk
[
["ChTOSFASLKdVOraA", {
"a_property": "Updated value"
}],
["SDFSAODFASFD", {
"a_property": "Another value"
}]
]

Bulk operations work like a transaction. Any error during the update leads to no item being updated.

info

If one of the item ids provided doesn't exist, the request will be cancelled.

Bulk full update#

PUT https://data.datablist.com/:workspace_id/collections/:collection_id/items/bulk
[
["ChTOSFASLKdVOraA", {
"@type": "{{itemType}}",
...
}],
["SDFSAODFASFD", {
"@type": "{{itemType}}",
...
}]
]

Bulk operations work like a transaction. Any error during the update leads to no item being updated.

info

If one of the item ids provided doesn't exist, the request will be cancelled.

Bulk delete items#

DELETE https://data.datablist.com/:workspace_id/collections/:collection_id/items/bulk
[
"ChTOSFASLKdVOraA",
"SDFSAODFASFD"
]

Bulk operations work like a transaction. Any error during the update leads to no item being deleted.

info

If one of the item ids provided doesn't exist, the request will be cancelled.