Get object
ENDPOINT
/api/v0-object/ref/[ref]?sources=[sources]
(GET)When generating URLs, [ref]
is the ref of a store object.
Request
In addition to the ref of the store object, the URL must contain a sources
parameter. This may be:
sources=NONE |
No additional sources, just the object information. |
sources=ALL |
All available sources. It is not recommended you use this, except for manually exploring the API. |
sources=s1,s2,... |
Specify the required sources as a comma separated list. |
Response
See the Introduction for the generic response format.
property kind
This request can respond with following kinds, in addition to the generic kinds (see Introduction):
Kind | Meaning |
haplo:api-v0:object:serialised |
The request was successful and a serialised object has been returned |
haplo:api-v0:object:no-such-object |
No object could be found with the requested ref or the user does not have permission to read it. Returns with HTTP status 400 |
haplo:api-v0:object:sources-not-specified |
The sources parameter was not specified. Returns with HTTP status 400 |
haplo:api-v0:object:bad-query |
The object store query was invalid. Returns with HTTP status 400 and more information in the message |
property object
The object in the standard JSON serialisation format, if the response is of kind haplo:api-v0:object:serialised
.
Example
GET /api/v0-object/ref/83w92?sources=std:workunit,std:workflow
{ "success": true, "kind": "haplo:api-v0:object:serialised", "object": { "kind": "haplo:object:0", "sources": [ "std:workunit", "std:workflow" ], "ref": "83w92", "url": "https://app.example.org/83w92/nice-book", "recordVersion": 2, "title": "Nice book", "labels": [ { "ref": "1x7z", "title": "Common" } ], "deleted": false, "creationDate": "2020-01-14T17:05:18Z", "lastModificationDate": "2020-01-14T17:05:18Z", "type": { "code": "std:type:book", "name": "Book", "rootCode": "std:type:book", "annotations": [] }, "attributes": { "dc:attribute:type": [ { "type": "link", "ref": "1zq4", "code": "std:type:book", "title": "Book" } ], "dc:attribute:title": [ { "type": "text", "value": "Nice book" } ], // ... }, "workflows": [ { "workType": "example:book-review", "createdAt": "2020-01-14T17:05:18.341Z", "openedAt": "2020-01-14T17:05:18Z", "deadline": null, "closed": true, "data": {}, "tags": {}, "state": "finished", "url": "https://app.example.org/83w92/nice-book" } ] } }