description |
---|
Sets the end-to-end encryption key ID for a room |
URL | Requires Auth | HTTP Method |
---|---|---|
/api/v1/e2e.setRoomKeyID |
Yes |
POST |
Argument | Example | Required | Description |
---|---|---|---|
rid | Qe3Wa3outaDMKzAZC | Required | The Room Id |
keyID | my-UniQu3_ke4_Id | Required | The key you wish to set. |
curl --location --request POST 'http://localhost:3000/api/v1/e2e.setRoomKeyID' \
--header 'X-User-Id: d26x6zSkaPSe5gCyy' \
--header 'X-Auth-Token: Di9OKWzdu7V2vW3lHO0oYLOOr6P2Y0n9zQlx20qn2cU' \
--header 'Content-Type: application/json' \
--data-raw '{
"rid": "wCiXndNp5NqNY3uCc",
"keyID": "my-UniQu3_ke4_Id"
}'
{
"success": true
}
Any of the following errors can occur on the endpoint.
- Authorization: Requires an authentication token for the request to be made.
- No Room Id: Occurs when no
rid
is given. - Invalid Room: Occurs when the given
rid
is invalid. - Key already Exists: Happens when the Room in request already has an E2E key set.
{% tabs %} {% tab title=" Authorization" %}
{
"success": false,
"error": "unauthorized"
}
{% endtab %}
{% tab title="No Room Id" %}
{
"success": false,
"error": "Match error: Expected string, got undefined"
}
{% endtab %}
{% tab title="Invalid Room ID" %}
{
"success": false,
"error": "Invalid room [error-invalid-room]",
"errorType": "error-invalid-room",
"details": {
"method": "canAccessRoom"
}
}
{% endtab %}
{% tab title="Key Already Exists" %}
{
"success": false,
"error": "E2E Key ID already exists [error-room-e2e-key-already-exists]",
"errorType": "error-room-e2e-key-already-exists",
"details": {
"method": "e2e.setRoomKeyID"
}
}
{% endtab %} {% endtabs %}