Collections

The Collection object#

{
"@context": {...},
"@id": "ChTOSFASLKdVOraA",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"label": "Contacts",
"@type": "Collection",
"parents": ["/xbDnos4GHeCO7YnUN8vJ"],
"itemsType": "Person",
"icon": "\ud83e\udd91",
}

Properties#

PropertyTypeInfoDescription
@contextobjectOptionalJSON-LD context information.
@idstringOptionalUnique identifier for the object
createdAtstringOptionalTimestamp of object creation, expressed according to ISO 8601.
updatedAtstringRead onlyTimestamp of object last update, expressed according to ISO 8601.
labelstringMandatoryName of the Collection.
@typestringMandatoryValue is "Collection"
parentslist of stringsMandatoryCollection URI for nested collections or Workspace URI for root collections.
itemsTypestringMandatoryDataType for the items. Must be a valid Class from the json-ld Datablist vocabulary.
iconstringOptionalEmoji Character

Any extra field will return a bad request error.

Create a collection#

POST https://data.datablist.com/:workspace_id/collections
{
"@type": "Collection",
"label": "My collection",
"itemsType": "People",
"parents": ["/:workspace_id"]
}

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).

On success, returns a HTTP code 201 with {"@id": "COLLECTION_ID"} and the resource URI in the Location header.

Retrieve a collection#

GET https://data.datablist.com/:workspace_id/collections/:collection_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",
"label": "Contacts",
"@type": "Collection",
"parents": ["/xbDnos4GHeCO7YnUN8vJ"],
"itemsType": "Person",
"icon": "\ud83e\udd91"
}

Update a collection#

Partial#

PATCH https://data.datablist.com/:workspace_id/collections/:collection_id
{
"label": "Updated Contacts"
}

On success, returns an empty HTTP 204 No Content.

Full update#

PUT https://data.datablist.com/:workspace_id/collections/:collection_id
{
"@id": "ChTOSFASLKdVOraA",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"label": "Updated Contacts",
"@type": "Collection",
"parents": ["/xbDnos4GHeCO7YnUN8vJ"],
"itemsType": "Person",
"icon": "\ud83e\udd91",
}

On success, returns an empty HTTP 204 No Content.

List all collections#

GET https://data.datablist.com/:workspace_id/collections

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",
"label": "Contacts",
"@type": "Collection",
"parents": ["/xbDnos4GHeCO7YnUN8vJ"],
"itemsType": "Person",
"icon": "\ud83e\udd91"
},{
"@id": "SDFSAODFASFD",
"createdAt": "2021-01-08T10:24:26.612030+00:00",
"updatedAt": "2021-02-15T15:48:18.007428+00:00",
"label": "Invoices",
"@type": "Collection",
"parents": ["/xbDnos4GHeCO7YnUN8vJ"],
"itemsType": "Invoice",
"icon": "\ud83d\uddc2"
}]
}

Delete a collection#

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

On success, returns an empty HTTP 204 No Content.