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

NameTypeDescription

id

string

Bucket ID to read.

key

string

Location in bucket to read, using dot object notation.

Headers

NameTypeDescription

Authorization

string

Auth token generated when the user logged in.

{ users: 
   [ 'd9e00e9233bff892e132567041538aa329b9ab02c90645997f33bff38d7a985c64659448951a85696182dc0cd674d23841ddb3673b7c153307e98be288b9c0da2efadf2d1ec162ad9de0c17a2a5d469509$421af977a0f83ab840d6a7f206d6fa3f',
     'd9e00e9233bff892e132567041538aa329b9ab02c906459e7f33bff38d7a985c64659448951a85696182dc0cd674d23841ddb3673b7c153307e98be288b9c0da2efadf2d1ec162ad9de0c17a2a5d469509$421af977a0f83ab840d6a7f206d6fa3f' ],
  public: false,
  data: 
   { key: 'value!',
     array: [ 'one', 'two', 'three' ],
     deeply: {nested: {value: 0}},
  createdDate: '2019-01-31T18:01:40.186Z',
  id: '@saved-bucket' }

Create Bucket

PUT https://api.motar.io/app/v1/bucket

Creates a data bucket.

Headers

NameTypeDescription

Authorization

string

Auth token generated when the user logged in.

Request Body

NameTypeDescription

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.

{ users: 
   [ 'e1cb649fd5d9e7d25cb08e23c52ebae9493453e56ac0aca31bfd36073ebb0c40f14a9e00edb5a333e0be0121f500516cd4be06a33ca103fc2b115f1b25b9f08bb23372ad53275c6f5f39e1939f96869609$001dadc846013a3d6b76fb36fdef88ce',
     'e1cb649fd5d9e7d25cb08e23c52ebae9493453e56ac0aff51bfd36073ebb0c40f14a9e00edb5a333e0be0121f500516cd4be06a33ca103fc2b115f1b25b9f08bb23372ad53275c6f5f39e1939f96869609$001dadc846013a3d6b76fb36fdef88ce' ],
  public: false,
  data: { new: 'value' },
  createdDate: '2019-01-31T18:09:55.789Z',
  id: 'new-bucket' }

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

NameTypeDescription

Authorization

string

Auth token generated when the user logged in.

Request Body

NameTypeDescription

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.

{ users: 
   [ '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4f57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef',
     '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4e57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef' ],
  public: false,
  data: {
    key: 'new value!',
    array: [ 'one', 'two', 'three' ]}
  }
}

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

NameTypeDescription

Authorization

string

Auth token generated when the user logged in.

Request Body

NameTypeDescription

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

NameTypeDescription

Authorization

string

Auth token generated when the user logged in.

Request Body

NameTypeDescription

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.

{ users: 
   [ '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4f57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef',
     '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4e57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef' ],
  public: false,
  data: {
    key: 'new value!',
    array: [ 'one', 'two', 'three' ]}
  }
}

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

NameTypeDescription

Authorization

string

Auth token generated when the user logged in.

Request Body

NameTypeDescription

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.

{ users: 
   [ '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4f57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef',
     '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4e57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef' ],
  public: false,
  data: {
    key: 'new value!',
    array: [ 'one', 'two', 'three' ]}
  }
}

Last updated