Buckets

get
Get Bucket

https://api.playportal.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.
Request
Response
Request
Headers
Authorization
required
string
Auth token generated when the user logged in.
Query Parameters
key
optional
string
Location in bucket to read, using dot object notation.
id
required
string
Bucket ID to read.
Response
200: OK
{ 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' }
403: Forbidden
Attempted to read a bucket of which the user does not have access to.
{
"message": "User is not in a bucket's user list.",
"number": 4032
}

put
Create Bucket

https://api.playportal.io/app/v1/bucket
Creates a data bucket.
Request
Response
Request
Headers
Authorization
required
string
Auth token generated when the user logged in.
Body Parameters
bucketId
required
string
A unique ID to name this bucket, generated by your app. To read the bucket you must keep track of this ID.
users
required
array
A list of user IDs who will have access to this bucket. The creating user is automatically added to this list. This parameter can alternatively be supplied as a comma-separated list rather than an array.
data
optional
object
A JSON-valid object or data type to initialize this bucket with.
public
optional
boolean
Whether or not this bucket is public within your app space.
Response
200: OK
Bucket created successfully.
{ users:
[ 'e1cb649fd5d9e7d25cb08e23c52ebae9493453e56ac0aca31bfd36073ebb0c40f14a9e00edb5a333e0be0121f500516cd4be06a33ca103fc2b115f1b25b9f08bb23372ad53275c6f5f39e1939f96869609$001dadc846013a3d6b76fb36fdef88ce',
'e1cb649fd5d9e7d25cb08e23c52ebae9493453e56ac0aff51bfd36073ebb0c40f14a9e00edb5a333e0be0121f500516cd4be06a33ca103fc2b115f1b25b9f08bb23372ad53275c6f5f39e1939f96869609$001dadc846013a3d6b76fb36fdef88ce' ],
public: false,
data: { new: 'value' },
createdDate: '2019-01-31T18:09:55.789Z',
id: 'new-bucket' }

post
Update Bucket

https://api.playportal.io/app/v1/bucket
Updates a data bucket. A user must be in the users list of the bucket to perform this operation.
Request
Response
Request
Headers
Authorization
required
string
Auth token generated when the user logged in.
Body Parameters
value
optional
object
Value to insert into the bucket at the location specified by the "key" parameter. Can be any valid JSON data.
key
required
string
Location in the bucket's data to update, in dot object notation.
id
required
string
Bucket ID to update.
Response
200: OK
Update successful.
{ users:
[ '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4f57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef',
'687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4e57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef' ],
public: false,
data: {
key: 'new value!',
array: [ 'one', 'two', 'three' ]}
}
}

delete
Delete Bucket

https://api.playportal.io/app/v1/bucket
Deletes a data bucket. A user must be in the users list of the bucket to perform this operation.
Request
Response
Request
Headers
Authorization
required
string
Auth token generated when the user logged in.
Body Parameters
id
required
string
ID of the bucket to delete.
Response
200: OK

post
Add User to Bucket

https://api.playportal.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 are already in a bucket's access list can use this method.
Request
Response
Request
Headers
Authorization
required
string
Auth token generated when the user logged in.
Body Parameters
id
required
string
ID of the bucket you wish to modify.
userId
required
string
User ID belonging to the user you wish to add to the bucket's access control list.
Response
200: OK
Returns the bucket that has been modified.
{ users:
[ '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4f57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef',
'687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4e57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef' ],
public: false,
data: {
key: 'new value!',
array: [ 'one', 'two', 'three' ]}
}
}

post
Remove a User From a Bucket

https://api.playportal.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.
Request
Response
Request
Headers
Authorization
required
string
Auth token generated when the user logged in.
Body Parameters
id
required
string
ID of the bucket you wish to modify.
userId
required
string
User ID belonging to the user you wish to remove from the bucket's access list.
Response
200: OK
Returns the bucket that has been modified.
{ users:
[ '687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4f57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef',
'687e2be0b2908ba9fef071e4be96ca26571b0bae99c8dd4e57b71f56f656528086c48dcfb6c0cd6e9dc6806e02173216a0eb64243c322950ab91667bd3380cf0141958e899634e619b8c7902eeb5286654$f8f2f8715a6eee264cf029581eccceef' ],
public: false,
data: {
key: 'new value!',
array: [ 'one', 'two', 'three' ]}
}
}