创建集合
在 KVNode 中创建一个新的集合。
身份验证
需要内部身份验证。通过 X-Glue-Authentication 头部或 apikey 和 secret 头部传递凭据。
请求体
1{
2 "name": "users"
3}
请求示例
1curl -X POST "https://api.hola.cloud/v1/collections" \
2 -H "X-Glue-Authentication: YOUR_AUTH_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "name": "users"
6 }'
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json
1 {
2 "ok": true,
3 "collection": "users"
4}
错误代码
| 状态 | 代码 | 描述 |
|---|---|---|
| 400 | invalid_json | 缺少或无效的集合名称 |
| 403 | forbidden | Missing authentication headers |
| 409 | conflict | 集合已存在 |
| 500 | internal_error | 服务器内部错误 |
评论