Boxes
Introduction#
A box is a space where the end-identity can share securely the data with some other identity or themself.
It is the base for data exchange, data access management...
Boxes#
Creating a Box#
Request#
Cookies:
accesstoken(opaque token) (ACR >= 1): no identity check, just a valid token is required.tokentype: must bebearer
Headers:
X-CSRF-Token: a token to prevent from CSRF attacks.
JSON Body:
titleis a free text required that is meant to describe the box purpose.owner_org_idis an optional uuid corresponding to the organization owning the box (default is self org).datatag_idis an optional uuid corresponding to a datatag representing the data type shipped through this box.owner_org_idmust also bit set.datatag_subjectis an optional identifier to define the data subject of this box.public_keyandinvitation_share_hashmust be in unpadded url-safe base64. If the public key is forcom.misakey.aes-rsa-encalgorithm, it must be prefixed withcom.misakey.aes-rsa-enc:.key_shareis optional but will be soon mandatory. See box keys shares documentation about how to build itinvitation_datais optional but must be used if thedatatag_subjecthas an account. It contains the encrypted crypto action to directly invite the user (see theextrafield in the access events section)
When a box is created, it already contains a first event
of type create that contains most of the information about the creation of the box.
Note that the access mode of a box is limited by default. A state.access_mode event must be created to switch it to public, see the related event type documentation.
Response#
_
JSON Body:
The most important part is the id field
which must be used to interact with the box.
Getting a Box#
Request#
Cookies:
accesstoken(opaque token) (ACR >= 1): no identity check, just a valid token is required.tokentype: must bebearer
Headers:
X-CSRF-Token: a token to prevent from CSRF attacks.
Path Parameters:
id(uuid string): the box id wished to be retrieved.
Response#
Code:
JSON Body:
Notable error reponses#
**I - The identity has no access to the box
The reason of the forbidden is explained is a reason field that have only 2 possible fixed values. Only the get box endpoint is ensured to return this error in the current state of the API.
JSON Body:
Getting public info about a box#
This endpoint does not need any valid token, but it needs a valid invitation_share_hash
corresponding to the box to get.
Request#
Path Parameters:
id(uuid string): the box id wished to be retrieved.
Query Parameters:
invitation_share_hash(string) (unpadded url-safe base64): a hash of the other share.
Response#
Code:
JSON Body:
Delete a box#
Reset the new events count for an identity#
The list of boxes return many information for each boxes, including a numerical field events_count telling how many event have occured since the connected identity's last visit.
This endpoint allows to reset the new events count of a box for a given identity.
It is a kind of an acknowledgement and it must be used when the identity want to mark the box as "read".
Request#
Path Parameter:
id(string) (uuid): the box id to mark as "read"
JSON Body:
where identity_id is the identity of the requester who wants to acknowledge.
Cookies:
accesstoken(opaque token) (ACR >= 1): a valid access token corresponding to the identity of the bodytokentype: must bebearer
Headers:
X-CSRF-Token: a token to prevent from CSRF attacks.
Response#
Code:
Accesses#
Access defines who has access to a box considering some rules.
Add or remove accesses#
⚠️ Only box admins can add or remove accesses.
To add or remove accesses in a given box, please refer to:
Listing accesses for a given box#
Listing accesses allows admins to see the current state of the box reachability.
Request#
Path Parameter:
id(string) (uuid): the box id to list accesses on.
Cookies:
accesstoken(opaque token) (ACR >= 2): the access token should belongs the a box admin.tokentype: must bebearer
Headers:
X-CSRF-Token: a token to prevent from CSRF attacks.
Response#
Only the current valid accesses are returned.
Membership#
Add or remove membership#
To add or remove membership for a couple <box, identity>, please refer to:
List boxes for the current identity#
Request#
Users are able to list boxes they have an access to.
The returned list is automatically computed from the server according to the authorization provided by the received bearer token.
Cookies:
accesstoken(opaque token) (ACR >= 1): a valid token.tokentype: must bebearer.
Headers:
X-CSRF-Token: a token to prevent from CSRF attacks.
Query Parameters:
owner_org_id(uuid) (default: hosting-org): the organization id owning the box.datatag_id(optional) (uuid): the datatag id corresponding to the data type.""for boxes with no datatag. Empty parameter for all boxes.datatag_ids: (optional) (comma-separated list of strings, uuid) ids of datatag you want to retrieve.""for boxes with no datatag. Default: all. Example: datatag_ids=7523588e-9c3d-4c9d-83b7-d98663bf1215,d9c01c3e-955a-4e98-b9f7-2610cc857108,"".- Pagination (more info) with default limit set to 10.
Response#
Code:
A list of event is returned.
Count boxes for the current identity#
Request#
This request allows to retrieval of information about accessible boxes list.
Today only the total count of boxes is returned as an response header.
Cookies:
accesstoken(opaque token) (ACR >= 1): a valid token.tokentype: must bebearer
Headers:
X-CSRF-Token: a token to prevent from CSRF attacks.
Query Parameters:
owner_org_id(uuid) (default: hosting-org): the organization id owning the box.datatag_id(uuid): the datatag id corresponding to the data type.""for boxes with no datatag. Empty parameter for all boxes.datatag_ids: (optional) (comma-separated list of strings, uuid) ids of datatag you want to retrieve.""for boxes with no datatag. Default: all. Example: datatag_ids=7523588e-9c3d-4c9d-83b7-d98663bf1215,d9c01c3e-955a-4e98-b9f7-2610cc857108,"".
Response#
Code:
Headers:
X-Total-Count(integer): the total count of boxes that the identity can access.
Listing active members of a box#
This endpoint return all identities that have an active membership to the box.
Identities who have left and have been kicked out of the box are not returned.
Request#
Path Parameter:
id(string) (uuid): the box id
Cookies:
accesstoken(opaque token) (ACR >= 1): a valid token.tokentype: must bebearer
Headers:
X-CSRF-Token: a token to prevent from CSRF attacks.
Response#
Code:
A list of senders is returned.