Set Key
Sets the value of a key in a collection. The wildcard * in the path is replaced with the key name.
Authentication
Requires internal authentication. Pass credentials via X-Glue-Authentication header, or apikey and secret headers.
Path Parameters
| Parameter |
Type |
Description |
| col |
string |
The name of the collection |
Request Body
| Field |
Type |
Description |
| value |
any |
The JSON value to store |
1{
2 "value": {
3 "name": "Alice",
4 "email": "alice@example.com",
5 "role": "admin"
6 }
7}
Example Request
1curl -X POST "https://api.hola.cloud/v1/collections/users/keys/user:1001" \
2 -H "X-Glue-Authentication: YOUR_AUTH_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "value": {
6 "name": "Alice",
7 "email": "alice@example.com",
8 "role": "admin"
9 }
10 }'
Example Response
1HTTP/1.1 200 OK
2Content-Type: application/json
1{
2 "ok": true,
3 "seq": 1,
4 "version": 1
5}
Error Codes
| Status |
Code |
Description |
| 400 |
invalid_json |
Missing or invalid value |
| 403 |
forbidden |
Missing authentication headers |
| 404 |
missing_collection |
Collection does not exist |
| 502 |
parent_unavailable |
Parent node is not reachable |
| 500 |
internal_error |
Internal server error |
Comments