top of page

List items

GET /<org_name>/<path>/

The roles and data items in an org are structured similarly to a directory tree, and the client can list those under a directory, using a directory path, which is a path that ends with a “/”.  Unlike UNIX, directories in an org are virtual.  They come to existence along with a role or a data item, and they are gone once there is no role nor data item left within.  Furthermore, reading a directory will list all the descendants, not just the children.  For instance, given a role /my_org/this/is/my_role.role and a data item /my_org/this/is/my_data.data, listing /my_org/ and /my_org/this/is/ both return /my_org/this/is/my_role.role and /my_org/this/is/my_data.data.

Request

Example

GET /<org_name>/<path>/
Host: <service_address>
Authorization: <org_key>

GET /sample_org/nemmies/
Host: beta.useast2.registry.dkplatform.io
Authorization: randomAlphaNumericString

Param
Meaning
Authorization
The credential showing the client's permission for the request. It is the `org_key` of the org.
Host
The service address, such as "useast2.registry.dkplatform.io".
x-dk-org-time
A response header that shows the org_time after the request is executed.
"stats"
A response field showing basic statistics of the queried org or the queried directory.
"files"
A list of items under a directory.
"role_count"
One of the basic stats of a directory.
"data_item_count"
One of the basic stats of a directory.

Response

200 OK

Content-Type: application/json

x-dk-org-time: <u64>

{

"files": [<string>,],

"stats": {

"role_count": <u32>,

"data_item_count": <u32>,

},

}

Success. The list of items is returned along with their basic stats.

400 BAD REQUEST

Wrong format in org name, or path.  Missing Authorization header, or Authorization header is empty.

404 NOT FOUND


There is no such org, or (for confidentiality concern) the authorization token is invalid.

500 INTERNAL SERVER ERROR

An unexpected error happened at the server.


© 2024 by DK Lab.

bottom of page