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.
Properties#
| Property | Type | Description |
|---|---|---|
| @context | object | Optional |
| @id | string | Unique identifier for the object |
| @type | string | Value comes from collection itemsType property |
| createdAt | string | Timestamp of object creation, expressed according to ISO 8601. |
| updatedAt | string | Timestamp 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:
Create an item#
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
Update an item#
Partial#
On success, returns an empty HTTP 204 No Content.
Full update#
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.
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#
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
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#
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#
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#
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.