-
Notifications
You must be signed in to change notification settings - Fork 84
Protocol Database
-
id
(string)The database identifier.
The database identifier uniquely identify a database in the container. Database identifier starting with the underscore character (
_
) is reserved by the system and cannot be created by the client. -
visibility
(string)Specify how this database is visible to other users in the container.
One of the following:
-
public
: public databaseVisible to all users in the container.
-
private
: private databaseVisible only to the current user.
-
shared
: shared database(TBD) Visible to some users. / Content subject to access control.
-
Fetch database information.
-
access_token
(string, required) -
ids
(array of strings, required)The identifiers of the database to fetch information for.
-
result
(array of objects)Database objects of the specified database identifiers.
curl -X POST -H "Content-Type: application/json" \
-d @- https://example.com/api/v1/databases <<EOF
{
"action": "database:fetch",
"access_token": "ACCESS_TOKEN"
"ids": ["DATABASE_ID1", "_public"]
}
EOF
{
"result": [
{
"id": "DATABASE_ID1",
"visibility": "private"
},
{
"id": "_public",
"visibility": "public"
}
]
}
Create a new database.
-
access_token
(string, required) -
database
(object, required)The database object to be created in the container.
-
result
(object)Database object created.
curl -X POST -H "Content-Type: application/json" \
-d @- https://example.com/api/v1 <<EOF
{
"action": "database:save",
"access_token": "ACCESS_TOKEN"
"database": {
"id": "EMwmzumyOTVp",
"visibility": "private"
}
}
EOF
{
"result": {
"id": "EMwmzumyOTVp",
"visibility": "private"
}
}