Buckets
Reminder: if you are using an app/client ID in sandbox, you must use sandbox.motar.io as the endpoint for your requests. Requests to api.motar.io with a sandbox client ID will fail!
Get Bucket
GET
https://api.motar.io/app/v1/bucket
Retrieves a data bucket. An app can have a number of buckets limited to its storage. Buckets can be read and updated by an arbitrary list of users.
Query Parameters
id
string
Bucket ID to read.
key
string
Location in bucket to read, using dot object notation.
Headers
Authorization
string
Auth token generated when the user logged in.
Create Bucket
PUT
https://api.motar.io/app/v1/bucket
Creates a data bucket.
Headers
Authorization
string
Auth token generated when the user logged in.
Request Body
public
boolean
Whether or not this bucket is public within your app space.
data
object
A JSON-valid object or data type to initialize this bucket with.
users
array
A list of user IDs who will have access to this bucket. The creating user is automatically added to the list. This parameter can alternatively be supplied as a comma-separated list rather than an array.
id
string
A unique ID to name this bucket, generated by your app. To read the bucket you must keep track of this ID.
Update Bucket
POST
https://api.motar.io/app/v1/bucket
Updates a data bucket. A user must be in the users list of the bucket to perform this operation.
Headers
Authorization
string
Auth token generated when the user logged in.
Request Body
id
string
Bucket ID to update.
key
string
Location in the bucket's data to update, in dot object notation.
value
object
Value to insert into the bucket at the location specified by the "key" parameter. Can be any valid JSON data.
Delete Bucket
DELETE
https://api.motar.io/app/v1/bucket
Deletes a data bucket. A user must be in the users list of the bucket to perform this operation.
Headers
Authorization
string
Auth token generated when the user logged in.
Request Body
id
string
ID of the bucket to delete.
Add user to Bucket
POST
https://api.motar.io/app/v1/bucket/user
Add's a user to a bucket's access list, giving the user access to the bucket. Only users who already in a bucket's access list can use this method.
Headers
Authorization
string
Auth token generated when the user logged in.
Request Body
userId
string
User ID belonging to the user you wish to add to the bucket's access control list.
id
string
ID of the bucket you wish to modify.
Remove a User From a Bucket
POST
https://api.motar.io/app/v1/bucket/user/remove
Removes a user from a bucket's access list. The user will no longer be able to access the bucket.
Headers
Authorization
string
Auth token generated when the user logged in.
Request Body
userId
string
User ID belonging to the user when you wish to remove from the bucket's access list.
id
string
ID of the bucket you wish to modify.
Last updated