Boxes
#
IntroductionA 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#
RequestCookies:
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:
title
is a free text required that is meant to describe the box purpose.owner_org_id
is an optional uuid corresponding to the organization owning the box (default is self org).datatag_id
is an optional uuid corresponding to a datatag representing the data type shipped through this box.owner_org_id
must also bit set.datatag_subject
is an optional identifier to define the data subject of this box.public_key
andinvitation_share_hash
must be in unpadded url-safe base64. If the public key is forcom.misakey.aes-rsa-enc
algorithm, it must be prefixed withcom.misakey.aes-rsa-enc:
.key_share
is optional but will be soon mandatory. See box keys shares documentation about how to build itinvitation_data
is optional but must be used if thedatatag_subject
has an account. It contains the encrypted crypto action to directly invite the user (see theextra
field 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#
RequestCookies:
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.
#
ResponseCode:
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 boxThis endpoint does not need any valid token, but it needs a valid invitation_share_hash
corresponding to the box to get.
#
RequestPath 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.
#
ResponseCode:
JSON Body:
#
Delete a box#
Reset the new events count for an identityThe 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".
#
RequestPath 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.
#
ResponseCode:
#
AccessesAccess 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 boxListing accesses allows admins to see the current state of the box reachability.
#
RequestPath 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.
#
ResponseOnly the current valid accesses are returned.
#
Membership#
Add or remove membershipTo add or remove membership for a couple <box, identity>, please refer to:
#
List boxes for the current identity#
RequestUsers 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.
#
ResponseCode:
A list of event is returned.
#
Count boxes for the current identity#
RequestThis 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,"".
#
ResponseCode:
Headers:
X-Total-Count
(integer): the total count of boxes that the identity can access.
#
Listing active members of a boxThis 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.
#
RequestPath 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.
#
ResponseCode:
A list of senders is returned.