From fd78f415e13155927f6649a9f5fb93b9feb75348 Mon Sep 17 00:00:00 2001 From: "Sam Mills (Henchman)" Date: Sat, 11 Jul 2015 13:37:00 +0100 Subject: [PATCH 1/9] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0442cd2..27b30f8 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ patched or fixed. * houdhakker2 * IgorAntun * Marvin (xBytez) +* René Kooi (goto-bus-stop) +* SooYou Thank you for making this project possible by contributing! From 9f7f1f506a915d30b66bb5e68d2752dc4dc72d5a Mon Sep 17 00:00:00 2001 From: SooYou Date: Fri, 17 Jul 2015 02:43:04 +0200 Subject: [PATCH 2/9] added endpoint documentation --- api/endpoints/auth_facebook.md | 34 +++++++++ api/endpoints/auth_login.md | 32 +++++++++ api/endpoints/auth_reset_me.md | 22 ++++++ api/endpoints/auth_session.md | 22 ++++++ api/endpoints/bans.md | 44 ++++++++++++ api/endpoints/bans_add.md | 50 +++++++++++++ api/endpoints/booth.md | 22 ++++++ api/endpoints/booth_add.md | 34 +++++++++ api/endpoints/booth_cycle.md | 34 +++++++++ api/endpoints/booth_lock.md | 36 ++++++++++ api/endpoints/booth_move.md | 39 ++++++++++ api/endpoints/booth_remove_id.md | 22 ++++++ api/endpoints/booth_skip.md | 36 ++++++++++ api/endpoints/booth_skip_me.md | 22 ++++++ api/endpoints/chat_cid.md | 22 ++++++ api/endpoints/friends.md | 61 ++++++++++++++++ api/endpoints/friends_ignore.md | 32 +++++++++ api/endpoints/friends_invites.md | 31 ++++++++ api/endpoints/grabs.md | 39 ++++++++++ api/endpoints/ignores.md | 49 +++++++++++++ api/endpoints/mutes.md | 68 ++++++++++++++++++ api/endpoints/news.md | 26 +++++++ api/endpoints/playlists.md | 81 +++++++++++++++++++++ api/endpoints/playlists_id_activate.md | 34 +++++++++ api/endpoints/playlists_id_media_delete.md | 42 +++++++++++ api/endpoints/playlists_id_media_insert.md | 44 ++++++++++++ api/endpoints/playlists_id_media_move.md | 44 ++++++++++++ api/endpoints/playlists_id_media_update.md | 39 ++++++++++ api/endpoints/playlists_id_rename.md | 32 +++++++++ api/endpoints/playlists_id_shuffle.md | 30 ++++++++ api/endpoints/playlists_media.md | 30 ++++++++ api/endpoints/profile_blurb.md | 32 +++++++++ api/endpoints/rooms.md | 71 +++++++++++++++++++ api/endpoints/rooms_favorites.md | 82 ++++++++++++++++++++++ api/endpoints/rooms_history.md | 49 +++++++++++++ api/endpoints/rooms_join.md | 29 ++++++++ api/endpoints/rooms_me.md | 52 ++++++++++++++ api/endpoints/rooms_state.md | 79 +++++++++++++++++++++ api/endpoints/rooms_update.md | 36 ++++++++++ api/endpoints/rooms_validate.md | 28 ++++++++ api/endpoints/staff.md | 44 ++++++++++++ api/endpoints/staff_update.md | 43 ++++++++++++ api/endpoints/store_inventory.md | 26 +++++++ api/endpoints/store_products.md | 47 +++++++++++++ api/endpoints/store_purchase.md | 32 +++++++++ api/endpoints/store_purchase_username.md | 37 ++++++++++ api/endpoints/users.md | 38 ++++++++++ api/endpoints/users_avatar.md | 32 +++++++++ api/endpoints/users_bulk.md | 38 ++++++++++ api/endpoints/users_language.md | 32 +++++++++ api/endpoints/users_me.md | 59 ++++++++++++++++ api/endpoints/users_me_history.md | 50 +++++++++++++ api/endpoints/users_me_transactions.md | 29 ++++++++ api/endpoints/votes.md | 34 +++++++++ 54 files changed, 2152 insertions(+) create mode 100644 api/endpoints/auth_facebook.md create mode 100644 api/endpoints/auth_login.md create mode 100644 api/endpoints/auth_reset_me.md create mode 100644 api/endpoints/auth_session.md create mode 100644 api/endpoints/bans.md create mode 100644 api/endpoints/bans_add.md create mode 100644 api/endpoints/booth.md create mode 100644 api/endpoints/booth_add.md create mode 100644 api/endpoints/booth_cycle.md create mode 100644 api/endpoints/booth_lock.md create mode 100644 api/endpoints/booth_move.md create mode 100644 api/endpoints/booth_remove_id.md create mode 100644 api/endpoints/booth_skip.md create mode 100644 api/endpoints/booth_skip_me.md create mode 100644 api/endpoints/chat_cid.md create mode 100644 api/endpoints/friends.md create mode 100644 api/endpoints/friends_ignore.md create mode 100644 api/endpoints/friends_invites.md create mode 100644 api/endpoints/grabs.md create mode 100644 api/endpoints/ignores.md create mode 100644 api/endpoints/mutes.md create mode 100644 api/endpoints/news.md create mode 100644 api/endpoints/playlists.md create mode 100644 api/endpoints/playlists_id_activate.md create mode 100644 api/endpoints/playlists_id_media_delete.md create mode 100644 api/endpoints/playlists_id_media_insert.md create mode 100644 api/endpoints/playlists_id_media_move.md create mode 100644 api/endpoints/playlists_id_media_update.md create mode 100644 api/endpoints/playlists_id_rename.md create mode 100644 api/endpoints/playlists_id_shuffle.md create mode 100644 api/endpoints/playlists_media.md create mode 100644 api/endpoints/profile_blurb.md create mode 100644 api/endpoints/rooms.md create mode 100644 api/endpoints/rooms_favorites.md create mode 100644 api/endpoints/rooms_history.md create mode 100644 api/endpoints/rooms_join.md create mode 100644 api/endpoints/rooms_me.md create mode 100644 api/endpoints/rooms_state.md create mode 100644 api/endpoints/rooms_update.md create mode 100644 api/endpoints/rooms_validate.md create mode 100644 api/endpoints/staff.md create mode 100644 api/endpoints/staff_update.md create mode 100644 api/endpoints/store_inventory.md create mode 100644 api/endpoints/store_products.md create mode 100644 api/endpoints/store_purchase.md create mode 100644 api/endpoints/store_purchase_username.md create mode 100644 api/endpoints/users.md create mode 100644 api/endpoints/users_avatar.md create mode 100644 api/endpoints/users_bulk.md create mode 100644 api/endpoints/users_language.md create mode 100644 api/endpoints/users_me.md create mode 100644 api/endpoints/users_me_history.md create mode 100644 api/endpoints/users_me_transactions.md create mode 100644 api/endpoints/votes.md diff --git a/api/endpoints/auth_facebook.md b/api/endpoints/auth_facebook.md new file mode 100644 index 0000000..f6f38da --- /dev/null +++ b/api/endpoints/auth_facebook.md @@ -0,0 +1,34 @@ +# auth/facebook Endpoint + +The auth/facebook endpoint logs you into the plug.dj service + +**Note**: This sets the **pw** member in your state data to false + +### Endpoint + +**auth/facebook** + +### available verbs + +_POST_ + +### Parameters + +```js +{ + 'csrf': 'xxxxx', // Cross Site Request Forgery token + 'accessToken': 'xxx', // Access token given by facebook.com + 'userID': 'xxx' // userID given by facebook.com +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/auth_login.md b/api/endpoints/auth_login.md new file mode 100644 index 0000000..c8df5fa --- /dev/null +++ b/api/endpoints/auth_login.md @@ -0,0 +1,32 @@ +# auth/login Endpoint + +The auth/login endpoint logs you into the plug.dj service + +### Endpoint + +**auth/login** + +### available verbs + +_POST_ + +### Parameters + +```js +{ + 'csrf': 'xxxxx', // Cross Site Request Forgery token + 'email': 'xxx@xxx.com', // E-Mail address + 'password': 'xxx' // Password in plaintext +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/auth_reset_me.md b/api/endpoints/auth_reset_me.md new file mode 100644 index 0000000..62053d4 --- /dev/null +++ b/api/endpoints/auth_reset_me.md @@ -0,0 +1,22 @@ +# auth/reset/me Endpoint + +The auth/reset/me endpoint will invalidate your login. + +### Endpoint + +**auth/reset/me** + +### available verbs + +_POST_ + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/auth_session.md b/api/endpoints/auth_session.md new file mode 100644 index 0000000..c719b57 --- /dev/null +++ b/api/endpoints/auth_session.md @@ -0,0 +1,22 @@ +# auth/session Endpoint + +The auth/session enables you to log out of plug + +### Endpoint + +**auth/session** + +### available verbs + +_DELETE_ + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/bans.md b/api/endpoints/bans.md new file mode 100644 index 0000000..ffe9602 --- /dev/null +++ b/api/endpoints/bans.md @@ -0,0 +1,44 @@ +# bans Endpoint + +The bans endpoint retrieves a list of active bans + +**Note**: you need to have sufficient permission in the room to acces this resource, otherwise you'll just be greeted +with a requestError message. + +**Reason**: The reason member is set as a single number which represent the following reasons: +**1**: (VIOLATING_COMMUNITY_RULES) User violated the community rules +**2**: (VERBAL_ABUSE) User was harsh to other community members +**3**: (SPAMMING) User spammed the chat +**4**: (OFFENSIVE_LANGUAGE) User was using offensive language +**5**: (NEGATIVE_ATTITUDE) User was having a negative attitude towards others + +**BanDuration**: The duration member can have the following values: +**f**: User is banned permanently +**d**: User is banned for a day +**h**: User is banned for an hour + +### Endpoint + +**bans** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'duration': 'x', // See BanDuration above + 'moderator': 'xxxx', // Name of the moderator + 'reason': 1, // Reason why they got banned + 'id': -1, // ID of the user + 'timestamp': 'xxx', // Date when the ban became active + 'username': 'xxxx' // Name of the user + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/bans_add.md b/api/endpoints/bans_add.md new file mode 100644 index 0000000..0121c4d --- /dev/null +++ b/api/endpoints/bans_add.md @@ -0,0 +1,50 @@ +# bans/add Endpoint + +The bans/add endpoint enables you to ban a user. + +**Note**: you need to have sufficient permissions in the room to access this resource. + +**Reason**: The reason member is set as a single number which represent the following reasons: +**1**: (VIOLATING_COMMUNITY_RULES) User violated the community rules +**2**: (VERBAL_ABUSE) User was harsh to other community members +**3**: (SPAMMING) User spammed the chat +**4**: (OFFENSIVE_LANGUAGE) User was using offensive language +**5**: (NEGATIVE_ATTITUDE) User was having a negative attitude towards others + +**BanDuration**: The duration member can have the following values: +**f**: User is banned permanently +**d**: User is banned for a day +**h**: User is banned for an hour + +### Endpoint + +**bans/add** + +### available verbs + +_POST_ + +### Parameters + +**userID**: ID of the user you want to move +**reason**: The reason why the user got banned +**duration**: The duration of the ban + +```json +{ + "userID": -1, + "reason": 1, + "duration": "x" +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/booth.md b/api/endpoints/booth.md new file mode 100644 index 0000000..6086039 --- /dev/null +++ b/api/endpoints/booth.md @@ -0,0 +1,22 @@ +# booth Endpoint + +The booth endpoint enables you to join (_POST_) or leave (_DELETE_) the waitlist. + +### Endpoint + +**booth** + +### available verbs + +_POST_, _DELETE_ + +### Data returned for both verbs + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/booth_add.md b/api/endpoints/booth_add.md new file mode 100644 index 0000000..de343c5 --- /dev/null +++ b/api/endpoints/booth_add.md @@ -0,0 +1,34 @@ +# booth/add Endpoint + +The booth/add endpoint enables you to add a user to the waitlist. + +**Note**: you need to have sufficient permissions in the room to access this resource. + +### Endpoint + +**booth/add** + +### available verbs + +_POST_ + +### Parameters + +**id**: ID of the user you want to add + +```json +{ + "id": -1 +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/booth_cycle.md b/api/endpoints/booth_cycle.md new file mode 100644 index 0000000..4dfc1a6 --- /dev/null +++ b/api/endpoints/booth_cycle.md @@ -0,0 +1,34 @@ +# booth/cycle Endpoint + +The booth/cycle endpoint enables you to cycle the waitlist. + +**Note**: you need to have sufficient permissions in the room to access this resource. + +### Endpoint + +**booth/cycle** + +### available verbs + +_PUT_ + +### Parameters + +**shouldCycle**: Should the booth cycle? + +```json +{ + "shouldCycle": false +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/booth_lock.md b/api/endpoints/booth_lock.md new file mode 100644 index 0000000..e30484a --- /dev/null +++ b/api/endpoints/booth_lock.md @@ -0,0 +1,36 @@ +# booth/lock Endpoint + +The booth/lock endpoint enables you to lock the waitlist. + +**Note**: you need to have sufficient permissions in the room to access this resource. + +### Endpoint + +**booth/lock** + +### available verbs + +_PUT_ + +### Parameters + +**isLocked**: Should the waitlist be locked? +**removeAllDJs**: Should all DJs be removed from the waitlist? + +```json +{ + "isLocked": false, + "removeAllDJs": false +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/booth_move.md b/api/endpoints/booth_move.md new file mode 100644 index 0000000..023c26d --- /dev/null +++ b/api/endpoints/booth_move.md @@ -0,0 +1,39 @@ +# booth/move Endpoint + +The booth/move endpoint enables you to move a user in a waitlist. + +**Note**: you need to have sufficient permissions in the room to access this resource. + +### Endpoint + +**booth/move** + +### available verbs + +_POST_ + +### Parameters + +**userID**: ID of the user you want to move +**position**: The new position of the user + +**Note**: the waitlist has a zero based index, so to move the user to the desired position you have to think +n-1 where n equals the desired position + +```json +{ + "userID": -1, + "position": 0 +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/booth_remove_id.md b/api/endpoints/booth_remove_id.md new file mode 100644 index 0000000..8050406 --- /dev/null +++ b/api/endpoints/booth_remove_id.md @@ -0,0 +1,22 @@ +# booth/remove/:id Endpoint + +The booth/remove/:id endpoint lets you remove a user from the waitlist. + +### Endpoint + +**booth/remove/:id** + +### available verbs + +_DELETE_ + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/booth_skip.md b/api/endpoints/booth_skip.md new file mode 100644 index 0000000..c0e88d3 --- /dev/null +++ b/api/endpoints/booth_skip.md @@ -0,0 +1,36 @@ +# booth/skip Endpoint + +The booth/skip endpoint enables you to skip the current DJ. + +**Note**: you need to have sufficient permission in the room to acces this resource. + +### Endpoint + +**booth/skip** + +### available verbs + +_POST_ + +### Parameters + +**userID**: ID of the DJ you want to skip +**historyID**: History ID of the playback + +```json +{ + "userID": -1, + "historyID": "xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx" +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/booth_skip_me.md b/api/endpoints/booth_skip_me.md new file mode 100644 index 0000000..e9f206c --- /dev/null +++ b/api/endpoints/booth_skip_me.md @@ -0,0 +1,22 @@ +# booth/skip/me Endpoint + +The booth/skip/me endpoint enables you to skip yourself as the DJ. + +### Endpoint + +**booth/skip/me** + +### available verbs + +_POST_ + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/chat_cid.md b/api/endpoints/chat_cid.md new file mode 100644 index 0000000..05b6494 --- /dev/null +++ b/api/endpoints/chat_cid.md @@ -0,0 +1,22 @@ +# chat/:cid Endpoint + +The chat/:cid endpoint enables you to delete a chat message via the Chat ID (cid). + +### Endpoint + +**chat/:cid** + +### available verbs + +_DELETE_ + +### Data returned for both verbs + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/friends.md b/api/endpoints/friends.md new file mode 100644 index 0000000..755c290 --- /dev/null +++ b/api/endpoints/friends.md @@ -0,0 +1,61 @@ +# friends Endpoint + +The friends endpoint will retrieve all of your friends or adds a user as a friend. + +### Endpoint + +**friends** + +### available verbs + +_GET_, _POST_ + +### Data returned for _GET_ + +```js +{ + 'data': [{ // Contains the requested data + 'avatarID': 'xxx', // AvatarID (e.g.: 'base01') + 'badge': 'xxx', // Badge of the user (e.g.: '80sb01') + 'gRole': 0, // Global role of the user (0 = None; 3 = Brand Ambassador (BA); 5 = Admin) + 'guest': false, // Is the user a guest? (this is not possible as of now) + 'id': -1, // ID of the user + 'joined': 'xxx', // String representation of the time the user joined plug (e.g.: '2014-07-23 22:47:00.573000') + 'language': 'xx', // ISO 639-1 representation of the language used by the user + 'level': 1, // Level of the user, + 'status': 0, // (deprecated) Status of the user + 'room': { + 'slug': 'xxx', // URL conform representaiton of the room's name + 'name': 'xxx', // Name of the room + 'id': 'xxx' // ID of the room + }, + 'slug': 'xxx', // URL conform representation of the user's name (also used for the profile page) + 'sub': 0, // Is the user a subscriber? (0 = false; 1 = true) + 'username': 'xxx' // Name of the user + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` + +### Parameters for _POST_ + +**id**: ID of the user you want to add as a friend + +```json +{ + "id": -1 +} +``` + +### Data returned for _POST_ + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/friends_ignore.md b/api/endpoints/friends_ignore.md new file mode 100644 index 0000000..69b6b24 --- /dev/null +++ b/api/endpoints/friends_ignore.md @@ -0,0 +1,32 @@ +# friends/ignore Endpoint + +The friends/ignore endpoint enables you to ignore a friend request. + +### Endpoint + +**friends/ignore** + +### available verbs + +_PUT_ + +### Parameters + +**id**: The ID of the user whose friend request you want to reject + +```json +{ + "id": "xxxxx" +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/friends_invites.md b/api/endpoints/friends_invites.md new file mode 100644 index 0000000..32d1103 --- /dev/null +++ b/api/endpoints/friends_invites.md @@ -0,0 +1,31 @@ +# friends/invites Endpoint + +The friends/invites endpoint will retrieve all of the friend invites you received. + +### Endpoint + +**friends/invites** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'avatarID': 'xxx', // AvatarID (e.g.: 'base01') + 'gRole': 0, // Global role of the user (0 = None; 3 = Brand Ambassador (BA); 5 = Admin) + 'id': -1, // ID of the user + 'joined': 'xxx', // String representation of the time the user joined plug (e.g.: '2014-07-23 22:47:00.573000') + 'level': 1, // Level of the user, + 'status': 0, // (deprecated) Status of the user + 'timestamp': 'xxx', // When the friend invite was sent + 'username': 'xxx' // Name of the user + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/grabs.md b/api/endpoints/grabs.md new file mode 100644 index 0000000..9f0df1e --- /dev/null +++ b/api/endpoints/grabs.md @@ -0,0 +1,39 @@ +# grabs Endpoint + +The grabs endpoint enables you to grabs a song and add it to a playlist. + +### Endpoint + +**grabs** + +### available verbs + +_POST_ + +### Parameters + +**playlistID**: ID of the playlist you want to add the song to +**historyID**: ID of the playback + +```json +{ + "playlistID": -1, + "historyID": "xxxxxxxx-xxxx-4xxx-xxxxx-xxxxxxxxxxxx" +} +``` + +### Data returned + +```js +{ + 'data': [{ + "active": false, // Is the playlist active? + "count": 0, // Amount of Media in this playlist + "id": -1, // ID of the playlist + "name": "xxx" // Name of the playlist + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/ignores.md b/api/endpoints/ignores.md new file mode 100644 index 0000000..626702c --- /dev/null +++ b/api/endpoints/ignores.md @@ -0,0 +1,49 @@ +# ignores Endpoint + +The ignores endpoint retrieves or modifies your ignores. + +### Endpoint + +**ignores** + +### available verbs + +_GET_, _POST_ + +### Data returned for _GET_ + +```js +{ + 'data': [{ // Contains the requested data + 'id': -1, // ID of the user + 'username': 'xxxx' // Name of the user + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` + +### Parameters for _POST_ + +**id**: ID of the user you want to mute + +```json +{ + "id": -1 +} +``` + +### Data returned for _POST_ + +```js +{ + 'data': [{ // Contains the requested data + 'id': -1, // ID of the user + 'username': 'xxxx' // Name of the user + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/mutes.md b/api/endpoints/mutes.md new file mode 100644 index 0000000..70956be --- /dev/null +++ b/api/endpoints/mutes.md @@ -0,0 +1,68 @@ +# mutes Endpoint + +The mutes endpoint modifies the current mutes. + +**Note**: you need to have sufficient permission in the room to acces this resource, otherwise you'll just be greeted +with a requestError message. + +**Reason**: The reason member is set as a single number which represent the following reasons: +**1**: (VIOLATING_COMMUNITY_RULES) User violated the community rules +**2**: (VERBAL_ABUSE) User was harsh to other community members +**3**: (SPAMMING) User spammed the chat +**4**: (OFFENSIVE_LANGUAGE) User was using offensive language +**5**: (NEGATIVE_ATTITUDE) User was having a negative attitude towards others + +**MuteDuration**: The duration member can have the following values: +**s**: User is muted for 15 minutes +**m**: User is muted for 30 minutes +**l**: User is muted for 45 minutes + +### Endpoint + +**mutes** + +### available verbs + +_GET_, _POST_ + +### Data returned for _GET_ + +```js +{ + 'data': [{ // Contains the requested data + 'expires': 0, // Duration in seconds + 'moderator': 'xxxx', // Name of the moderator + 'reason': 1, // Reason why they got banned + 'id': -1, // ID of the user + 'username': 'xxxx' // Name of the user + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` + +### Parameters for _POST_ + +**userID**: ID of the user you want to mute +**reason**: The reason of the mute +**duration**: The duration of the mute + +```json +{ + "userID": -1, + "reason": 1, + "duration": "x" +} +``` + +### Data returned for _POST_ + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/news.md b/api/endpoints/news.md new file mode 100644 index 0000000..3fa0284 --- /dev/null +++ b/api/endpoints/news.md @@ -0,0 +1,26 @@ +# news Endpoint + +The news endpoint retrieves a sorted feed from blog.plug.dj + +### Endpoint + +**news** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'desc': 'xxxxxx', // Short preview of the article + 'title': 'xxxx', // Title of the article + 'href': 'xxxx' // Link to the article (normally blog.plug.dj) + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists.md b/api/endpoints/playlists.md new file mode 100644 index 0000000..24a6fd1 --- /dev/null +++ b/api/endpoints/playlists.md @@ -0,0 +1,81 @@ +# playlists Endpoint + +The playlists endpoint retrieves or modifies your playlists. + +### Endpoint + +**playlists** +**playlists/:id** + +### available verbs + +_GET_, _POST_, _DELETE_ + +### Data returned for _GET_ + +```js +{ + 'data': [{ // Contains the requested data + 'active': false, // Is the playlist currently selected for playback? + 'count': 0, // Amount of songs in this playlist + 'id': -1, // ID of the playlist + 'name': 'xxx' // Name of the playlist + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` + +### Parameters for _POST_ + +**name**: Name of the new playlist +**media**: Array of media objects used to fill the playlist + +```json +{ + "name": "xxx", + "media": [{ + "cid": "", + "title": "xxx", + "author": "xxx", + "image": "xxx", + "duration": 0, + "format": 1, + "id": -1 + }] +} +``` + +### Data returned for _POST_ + +```js +{ + 'data': [{ // Contains the requested data + 'active': false, // Is the playlist currently selected for playback? + 'count': 0, // Amount of songs in this playlist + 'id': -1, // ID of the playlist + 'name': 'xxx' // Name of the playlist + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` + +### URL Parameters + +**id**: ID of the playlist you want to delete + +>https://plug.dj/_/playlists/2093483 + +### Data returned for _DELETE_ + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists_id_activate.md b/api/endpoints/playlists_id_activate.md new file mode 100644 index 0000000..682731d --- /dev/null +++ b/api/endpoints/playlists_id_activate.md @@ -0,0 +1,34 @@ +# playlists/:id/activate Endpoint + +The playlists/:id/activate endpoint enables you to activate a playlist. + +### Endpoint + +**playlists/:id/activate** + +### available verbs + +_PUT_ + +### Parameters + +**id**: ID of the playlist you want to activate + +```json +{ + "id": -1 +} +``` + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'activated': -1 // ID of the playlist you just activated + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists_id_media_delete.md b/api/endpoints/playlists_id_media_delete.md new file mode 100644 index 0000000..b0aaed2 --- /dev/null +++ b/api/endpoints/playlists_id_media_delete.md @@ -0,0 +1,42 @@ +# playlists/:id/media/delete Endpoint + +The playlists/:id/media/delete lets you delete media objects. + +### Endpoint + +**playlists/:id/media/delete** + +### available verbs + +_POST_ + +### Parameters + +**ids**: IDs of the media objects you want to delete + +```json +{ + "ids": [ + -1 + ] +} +``` + +### Data returned + +```js +{ + 'data': [{ + 'cid': 'xxx', // Media ID used on the originating website + 'title': 'xxx', // Media title + 'author': 'xxx', // Media author + 'image': 'xxx', // Thumbnail (youtube) or Artwork (soundcloud) + 'duration': 0, // Duration in seconds + 'format': 1, // Media format (1 = youtube; 2 = soundcloud) + 'id': -1 // Internal media ID + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists_id_media_insert.md b/api/endpoints/playlists_id_media_insert.md new file mode 100644 index 0000000..2069165 --- /dev/null +++ b/api/endpoints/playlists_id_media_insert.md @@ -0,0 +1,44 @@ +# playlists/:id/media/insert Endpoint + +The playlists/:id/media/insert lets you insert media objects. + +### Endpoint + +**playlists/:id/media/insert** + +### available verbs + +_POST_ + +### Parameters + +**ids**: IDs of the media objects you want to insert +**append**: Should the array be concatenated at the end of the playlist? + +```json +{ + "media": [{ + + }], + "append": false +} +``` + +### Data returned + +```js +{ + 'data': [{ + 'cid': 'xxx', // Media ID used on the originating website + 'title': 'xxx', // Media title + 'author': 'xxx', // Media author + 'image': 'xxx', // Thumbnail (youtube) or Artwork (soundcloud) + 'duration': 0, // Duration in seconds + 'format': 1, // Media format (1 = youtube; 2 = soundcloud) + 'id': -1 // Internal media ID + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists_id_media_move.md b/api/endpoints/playlists_id_media_move.md new file mode 100644 index 0000000..8899a17 --- /dev/null +++ b/api/endpoints/playlists_id_media_move.md @@ -0,0 +1,44 @@ +# playlists/:id/media/move Endpoint + +The playlists/:id/media/move lets you move media objects to another index in a playlist. + +### Endpoint + +**playlists/:id/media/move** + +### available verbs + +_PUT_ + +### Parameters + +**ids**: Array of media IDs you want to move +**beforeID**: ID of the media where the media should be inserted + +```json +{ + "ids": [ + -1 + ], + "beforeID": -1 +} +``` + +### Data returned + +```js +{ + 'data': [{ + 'cid': 'xxx', // Media ID used on the originating website + 'title': 'xxx', // Media title + 'author': 'xxx', // Media author + 'image': 'xxx', // Thumbnail (youtube) or Artwork (soundcloud) + 'duration': 0, // Duration in seconds + 'format': 1, // Media format (1 = youtube; 2 = soundcloud) + 'id': -1 // Internal media ID + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists_id_media_update.md b/api/endpoints/playlists_id_media_update.md new file mode 100644 index 0000000..943f4b1 --- /dev/null +++ b/api/endpoints/playlists_id_media_update.md @@ -0,0 +1,39 @@ +# playlists/:id/media/update Endpoint + +The playlists/:id/media/update lets you update the metadata of a media object. + +### Endpoint + +**playlists/:id/media/update** + +### available verbs + +_PUT_ + +### Parameters + +**id**: ID of the media you want to update +**author**: Author of the media +**title**: Title of the media + +```json +{ + "id": -1, + "author": "xxx", + "title": "xxx" +} +``` + +### Data returned + +```js +{ + 'data': [{ + 'author': 'xxx', // Media author + 'title': 'xxx' // Media title + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists_id_rename.md b/api/endpoints/playlists_id_rename.md new file mode 100644 index 0000000..0d90253 --- /dev/null +++ b/api/endpoints/playlists_id_rename.md @@ -0,0 +1,32 @@ +# playlists/:id/rename Endpoint + +The playlists/:id/rename endpoint enables you to rename a playlist. + +### Endpoint + +**playlists/:id/rename** + +### available verbs + +_PUT_ + +### Parameters + +**name**: The new name of the playlist + +```json +{ + "id": -1 +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists_id_shuffle.md b/api/endpoints/playlists_id_shuffle.md new file mode 100644 index 0000000..9ac97a4 --- /dev/null +++ b/api/endpoints/playlists_id_shuffle.md @@ -0,0 +1,30 @@ +# playlists/:id/shuffle Endpoint + +The playlists/:id/shuffle endpoint enables you to shuffle a playlist. + +### Endpoint + +**playlists/:id/shuffle** + +### available verbs + +_PUT_ + +### Data returned + +```js +{ + 'data': [{ + 'cid': 'xxx', // Media ID used on the originating website + 'title': 'xxx', // Media title + 'author': 'xxx', // Media author + 'image': 'xxx', // Thumbnail (youtube) or Artwork (soundcloud) + 'duration': 0, // Duration in seconds + 'format': 1, // Media format (1 = youtube; 2 = soundcloud) + 'id': -1 // Internal media ID + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/playlists_media.md b/api/endpoints/playlists_media.md new file mode 100644 index 0000000..76a20ee --- /dev/null +++ b/api/endpoints/playlists_media.md @@ -0,0 +1,30 @@ +# playlists/:id/media Endpoint + +The playlists/:id/media endpoint retrieves all of your playlists. + +### Endpoint + +**playlists/:id/media** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'cid': 'xxx', // Media ID used on the originating website + 'title': 'xxx', // Media title + 'author': 'xxx', // Media author + 'image': 'xxx', // Thumbnail (youtube) or Artwork (soundcloud) + 'duration': 0, // Duration in seconds + 'format': 1, // Media format (1 = youtube; 2 = soundcloud) + 'id': -1 // Internal media ID + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/profile_blurb.md b/api/endpoints/profile_blurb.md new file mode 100644 index 0000000..4d77846 --- /dev/null +++ b/api/endpoints/profile_blurb.md @@ -0,0 +1,32 @@ +# profile/blurb Endpoint + +The profile/blurb endpoint enables you to change your profile message. + +### Endpoint + +**profile/blurb** + +### available verbs + +_PUT_ + +### Parameters + +**blurb**: Your new profile message + +```json +{ + "blurb": "xxxxx" +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/rooms.md b/api/endpoints/rooms.md new file mode 100644 index 0000000..35c7313 --- /dev/null +++ b/api/endpoints/rooms.md @@ -0,0 +1,71 @@ +# rooms Endpoint + +The rooms endpoint retrieves all rooms in a sorted list based on the amount of people that are connected or creates a room via _POST_. + +### Endpoint + +**rooms** +**rooms?q=:query&page=:page&limit=:limit** + +### available verbs + +_GET_, _POST_ + +### Parameters + +**q**: Search query used to filter the rooms +**page**: Pagination, starts at page 1. +**limit**: The amount of rooms that should be shown per page. + +### Data returned for _GET_ + +```js +{ + 'data': [{ // Contains the requested data + 'capacity': null, // Maximum capacity of the room (it's null for most rooms but the most populated ones) + 'cid': 'xxx', // ID of the room + 'dj': 'xxx', // Name of the DJ + 'favorite': false, // Is this room favorited by you? + 'format': 1, // Site the media originates from (1 = youtube; 2 = soundcloud) + 'guests': 0, // Amount of guests connected to the room + 'host': 'xxx' // Name of the host + 'id': 'xxx' // ID of the room + 'image': 'xxx.jpg', // Thumbnail + 'media': 'xxx', // Author and Title of the media being played + 'name': 'xxx', // Name of the room + 'nsfw': false, // Is the room flagged as inappropiate? (can not be set manually) + 'population': 0, // Current population of the room + 'slug': 'xxx' // URL conform representation of the room's name + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` + +### Parameters for _POST_ + +**name**: Name of your new community +**private**: Should this community be private? (this means that the room won't be listed in the public listing) + +```json +{ + "name": "xxx", + "private": false +} +``` + +### Data returned for _POST_ + +```js +{ + 'data': [{ // Contains the requested data + "id": -1, // Internal room ID + "name": "xxx", // Name of the room (same as the name you sent via post) + "slug": "xxx" // URL conform representation of the room's name + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/rooms_favorites.md b/api/endpoints/rooms_favorites.md new file mode 100644 index 0000000..1fb3197 --- /dev/null +++ b/api/endpoints/rooms_favorites.md @@ -0,0 +1,82 @@ +# rooms/favorites Endpoint + +The rooms/favorites endpoint requests metadata or modifies your favorite rooms list. + +### Endpoints + +**rooms/favorites** +**rooms/favorites?page=:page&limit=:limit** +**rooms/favorites/:slug** + +### available verbs + +_GET_, _POST_, _DELETE_ + +### Parameters for _GET_ + +**page**: Pagination, starts at page 1. +**limit**: The amount of rooms that should be shown per page. + +### Data returned for _GET_ + +```js +{ + 'data': [{ // Contains the requested data + 'capacity': null, // Maximum capacity of the room (it's null for most rooms but the most populated ones) + 'cid': 'xxx', // ID of the room + 'dj': '', // Username of the DJ + 'favorite': true, // Is this room favorited by you? + 'format': 1, // Site the media originates from (1 = youtube; 2 = soundcloud) + 'guests': 0, // Amount of guests that are connected + 'host': 'xxx' // Name of the host + 'id': 'xxx' // ID of the room + 'image': 'xxx.jpg', // Thumbnail + 'media': 'xxx', // Author and Title of the media being played + 'name': 'xxx', // Name of the room + 'nsfw': false, // Is the room flagged as inappropiate? (can not be set manually) + 'population': 0, // Current population of the room + 'slug': 'xxx' // URL conform representation of the room's name + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` + +### Parameters for _POST_ + +**id**: ID of the room you want to add to your favorites + +```json +{ + "id": -1 +} +``` + +### Data returned for _POST_ + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` + +### URL Parameters + +**id**: ID of the playlist you want to delete + +>https://plug.dj/_/rooms/favorites/xxx + +### Data returned for _DELETE_ + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/rooms_history.md b/api/endpoints/rooms_history.md new file mode 100644 index 0000000..0e77402 --- /dev/null +++ b/api/endpoints/rooms_history.md @@ -0,0 +1,49 @@ +# rooms/history Endpoint + +The room history endpoint enables you to get the room's history you're in. + +### Endpoint + +**rooms/history** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data in an array of objects + 'id': 'xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx', // Internal GUID v4 history ID + 'media': { + 'cid': 'xxx', // Media ID used on the originating website + 'title': 'xxx', // Media title + 'author': 'xxx', // Media author + 'image': 'xxx', // Thumbnail (youtube) or Artwork (soundcloud) + 'duration': 0, // Duration in seconds + 'format': 1, // Media format (1 = youtube; 2 = soundcloud) + 'id': -1 // Internal media ID + }, + 'room': { + 'name': 'xxx', // Name of the room the media was played in + 'slug': 'xxx' // URL conform representation of the room's name + }, + 'score': { + 'grabs': 0, // Amount of grabs + 'listeners': 0, // Amount of listeners + 'negative': 0, // Amount of mehs + 'positive': 0, // Amount of woots + 'skipped': 0 // Indicated whether the DJ was skipped or not + }, + 'timestamp': 'xx-xx-xx', // Indicates when this media was played + 'user': { + 'id': -1, // ID of the DJ + 'username': 'xxx' // Name of the user + } + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/rooms_join.md b/api/endpoints/rooms_join.md new file mode 100644 index 0000000..14036ac --- /dev/null +++ b/api/endpoints/rooms_join.md @@ -0,0 +1,29 @@ +# rooms/join Endpoint + +The rooms/join enables you to join a room + +### Endpoint + +**rooms/join** + +### available verbs + +_POST_ + +### parameters +```js +{ + 'slug': 'xxxxx' // The URL conform name of the room is needed to join`` +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/rooms_me.md b/api/endpoints/rooms_me.md new file mode 100644 index 0000000..d29a8f2 --- /dev/null +++ b/api/endpoints/rooms_me.md @@ -0,0 +1,52 @@ +# rooms/me Endpoint + +The rooms/me endpoint requests meta information about the rooms you host. + +**NOTE**: The guests member is not available in this request, neither is the amount of guests included in the +population count. + +### Endpoint + +**rooms/me** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'capacity': null, // Maximum capacity of the room (it's null for most rooms but the most populated ones) + 'cid': 'xxx', // ID of the room + 'dj': { // Current DJ (this is null if no DJ is playing) + 'avatarID': 'xxx', // AvatarID (e.g.: 'base01') + 'badge': 'xxx', // Badge of the DJ (e.g.: '80sb01') + 'gRole': 0, // Global role of the user (0 = None; 3 = Brand Ambassador (BA); 5 = Admin) + 'guest': false, // Is the DJ a guest? (this is not possible as of now) + 'id': -1, // ID of the DJ + 'joined': 'xxx', // String representation of the time the DJ joined plug (e.g.: '2014-07-23 22:47:00.573000') + 'language': 'xx', // ISO 639-1 representation of the language used by the DJ + 'level': 1, // Level of the DJ, + 'slug': 'xxx', // URL conform representation of the DJ's name (also used for the profile page) + 'sub': 0, // Is the DJ a subscriber? (0 = false; 1 = true) + 'username': 'xxx' // Name of the DJ + }, + 'favorite': false, // Is this room favorited by you? + 'format': 1, // Site the media originates from (1 = youtube; 2 = soundcloud) + 'host': 'xxx' // Name of the host + 'id': 'xxx' // ID of the room + 'image': 'xxx.jpg', // Thumbnail + 'media': 'xxx', // Author and Title of the media being played + 'name': 'xxx', // Name of the room + 'nsfw': false, // Is the room flagged as inappropiate? (can not be set manually) + 'population': 0, // Current population of the room + 'private': false, // Is the room private? + 'slug': 'xxx' // URL conform representation of the room's name + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/rooms_state.md b/api/endpoints/rooms_state.md new file mode 100644 index 0000000..d709d46 --- /dev/null +++ b/api/endpoints/rooms_state.md @@ -0,0 +1,79 @@ +# rooms/state Endpoint + +The rooms/state endpoint requests meta information about the room you are currently in. + +**NOTE**: The guests member is not available in this request, neither is the amount of guests included in the +population count. + +### Endpoint + +**rooms/state** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'booth': { + 'currentDJ': -1, // ID of the current DJ + 'isLocked': false, // Is the WaitList locked? + 'shouldCycle': false, // Should the WaitList cycle? + 'waitingDJs': [] // Representation of the WaitList as an ordered array of IDs + }, + 'fx': [], // Effects available for this room + 'grabs': {}, // Representation of the grabs as an array of IDs + 'meta': { // Meta information about the room + 'description': 'xxx', // Description of the room + 'favorite': false, // Is this room favorited by you? + 'guests': 0, // Amount of guests connected + 'hostID': -1, // ID of the host + 'hostName': 'xxx', // Name of the host + 'id': -1, // ID of the room + 'minChatLevel': 1, // Minimum level needed to chat + 'name': 'xxx', // Name of the room + 'population': 0, // Amount of real users in the room (guests excluded) + 'slug': 'xxx', // URL conform representation of the room's name + 'welcome': 'xxx' // Welcome message of the room + }, + 'mutes': { // Representation of the muted users as an array + 'xxxx': -1, // "ID of the user": time remaining in seconds + }, + 'playback': { + 'historyID': 'xxx', // HistoryID of the playback + 'playlistID': 'xxx', // ID of the playlist this media is in + 'startTime': 'xxx', // Date and time when the media started playing + 'media': { + 'author': 'xxx', // Author of the media + 'title': 'xxx', // Title of the media + 'cid': 'xxx', // Media ID used on the originating website + 'duration': 0, // Duration in seconds + 'format': 1, // Site the media originates from (1 = youtube; 2 = soundcloud) + 'id': -1, // Internal media ID + 'image': 'xxx' // Thumbnail + } + }, + 'role': 0, // Your role in the room + 'users': [{ // Array of user objects containing the currently connected users + 'avatarID': 'xxx', // AvatarID (e.g.: 'base01') + 'badge': 'xxx', // Badge of the DJ (e.g.: '80sb01') + 'gRole': 0, // Global role of the user (0 = None; 3 = Brand Ambassador (BA); 5 = Admin) + 'id': -1, // ID of the DJ + 'joined': 'xxx', // String representation of the time the DJ joined plug (e.g.: '2014-07-23 22:47:00.573000') + 'level': 1, // Level of the DJ, + 'role': 0, // Role of the user in this room + 'sub': 0, // Is the DJ a subscriber? (0 = false; 1 = true) + 'username': 'xxx' // Name of the DJ + }], + 'votes': { // Representation of the votes as an array + 'xxx': -1, // 'ID of the user': vote direction (1 = woot; -1 = meh) + } + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/rooms_update.md b/api/endpoints/rooms_update.md new file mode 100644 index 0000000..cfd14db --- /dev/null +++ b/api/endpoints/rooms_update.md @@ -0,0 +1,36 @@ +# rooms/update Endpoint + +The rooms/update endpoint enables you to partially change the metadata of your room. + +### Endpoint + +**rooms/update** + +### available verbs + +_POST_ + +### Parameters + +**name**: Name of your room +**description**: Description of your room +**welcome**: Welcome message of your room + +```json +{ + "name": "xxx", + "description": "xxx", + "welcome": "xxx", +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/rooms_validate.md b/api/endpoints/rooms_validate.md new file mode 100644 index 0000000..44fafcc --- /dev/null +++ b/api/endpoints/rooms_validate.md @@ -0,0 +1,28 @@ +# rooms/validate Endpoint + +The rooms/validate endpoint escapes a room's name into an URL conform string. + +### Endpoint + +**rooms/validate/:name** + +### available verbs + +_GET_ + +### Parameters + +**name**: Name of the room + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'slug': 'xxx' // URL conform representation of the room's name + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/staff.md b/api/endpoints/staff.md new file mode 100644 index 0000000..2f3328e --- /dev/null +++ b/api/endpoints/staff.md @@ -0,0 +1,44 @@ +# staff Endpoint + +The staff endpoint requests all staff members of the room you are currently in. + +**Note**: There's five roles for the user + +* **0**: None, just a regular user +* **1**: ResidentDJ, can lock the waitlist +* **2**: Bouncer, can delete chat messages, remove DJs, force skip and ban people +* **3**: Manager, can everything except removing co hosts and managers as well as editing the room meta +* **4**: Co-Host, can everything except removing co hosts +* **5**: Host, owner status + +### Endpoint + +**staff** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'avatarID': 'xxx', // AvatarID (e.g.: 'base01') + 'badge': 'xxx', // Badge of the DJ (e.g.: '80sb01') + 'gRole': 0, // Global role of the user (0 = None; 3 = Brand Ambassador (BA); 5 = Admin) + 'guest': false, // Is the DJ a guest? (this is not possible as of now) + 'id': -1, // ID of the DJ + 'joined': 'xxx', // String representation of the time the DJ joined plug (e.g.: '2014-07-23 22:47:00.573000') + 'language': 'xx', // ISO 639-1 representation of the language used by the DJ + 'level': 1, // Level of the DJ, + 'role': 1, // Role of the user in this room + 'slug': 'xxx', // URL conform representation of the DJ's name (also used for the profile page) + 'sub': 0, // Is the DJ a subscriber? (0 = false; 1 = true) + 'username': 'xxx' // Name of the DJ + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/staff_update.md b/api/endpoints/staff_update.md new file mode 100644 index 0000000..dfcd8e9 --- /dev/null +++ b/api/endpoints/staff_update.md @@ -0,0 +1,43 @@ +# staff/update Endpoint + +The staff/update endpoint enables you to update the role of a user in your room. + +**Note**: There's five roles for the user + +* **0**: None, just a regular user +* **1**: ResidentDJ, can lock the waitlist +* **2**: Bouncer, can delete chat messages, remove DJs, force skip and ban people +* **3**: Manager, can everything except removing co hosts and managers as well as editing the room meta +* **4**: Co-Host, can everything except removing co hosts +* **5**: Host, owner status + +### Endpoint + +**staff/update** + +### available verbs + +_POST_ + +### Parameters + +**userID**: ID of the user you want to add to the staff +**roleID**: ID of the role you want to apply + +```json +{ + "userID": -1, + "roleID": 1 +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/store_inventory.md b/api/endpoints/store_inventory.md new file mode 100644 index 0000000..a7b9f01 --- /dev/null +++ b/api/endpoints/store_inventory.md @@ -0,0 +1,26 @@ +# store/inventory Endpoint + +The store/inventory lists all of your boughts items. + +### Endpoint + +**store/inventory** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data in an array of objects + 'category': 'xxx', // Item category + 'id': 'xxx', // Item ID (which will then be set in avatarID for avatars and badge for badges) + 'type': 'xxx' // Item type (e.g.: avatars or badges) + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/store_products.md b/api/endpoints/store_products.md new file mode 100644 index 0000000..12f1470 --- /dev/null +++ b/api/endpoints/store_products.md @@ -0,0 +1,47 @@ +# store/products Endpoint + +The store/products lists all available products in the store + +### Endpoint + +**store/products** +**store/products/:type/:category** + +### available verbs + +_GET_ + +### Parameters + +**Note**: Not setting those will retrieve the full list of items available + +**type**: Same as the type member of the store item +**category**: Same as the category member of the store item + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data in an array of objects + 'cash': 0.0, // Only set if the item costs actual IRL money + 'base': true, // ?? (the first base products that are enabled for new accounts) + 'category': 'xxx', // This is shown in the store drop down i.e.: 'hiphop' + 'category_id': 0, // Internal ID for the category + 'currency': 7, // Internal ID for the type of currency + 'currency_name': 'plug_points', // Readable name of the currency + 'expires': 'xxx', // Date when the item gets removed from the store + 'id': 'xxxyy', // The actual item ID + 'level': 1, // The level needed to purchase this item + 'name': 'xxx', // The name of the item (after purchase saved as avatarID e.g.: base01) + 'parent_id': 0, // Set for items that derive from another item (i.e.: hiphop01 => base01) + 'pp': 0, // Plug points needed to purchase this item + 'price': 0, // Either a copy of pp or cash + 'product_id': 0, // ID of the item + 'tier_name': 'xx_xx_xx_y', // Different tier types for example 'cash_avatar_tier_2' + 'type': 'xxxx' // Type of the item (e.g.: 'avatars' or 'badges') + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/store_purchase.md b/api/endpoints/store_purchase.md new file mode 100644 index 0000000..1f5b27f --- /dev/null +++ b/api/endpoints/store_purchase.md @@ -0,0 +1,32 @@ +# store/purchase Endpoint + +The store/purchase endpoint enables you to buy items from the store. + +### Endpoint + +**store/purchase** + +### available verbs + +_POST_ + +### Parameters + +**id**: ID of the item you want to buy + +```json +{ + "id": "xxx" +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/store_purchase_username.md b/api/endpoints/store_purchase_username.md new file mode 100644 index 0000000..7b7cb41 --- /dev/null +++ b/api/endpoints/store_purchase_username.md @@ -0,0 +1,37 @@ +# store/purchase/username Endpoint + +The store/purchase/username endpoint enables you to buy items from the store. + +### Endpoint + +**store/purchase/username** + +### available verbs + +_POST_ + +### Parameters + +**username**: ID of the item you want to buy + +```json +{ + "id": "454", + "username": "xxx" +} +``` + +### Data returned + +```js +{ + 'data': [{ + 'count': 1, + 'name': 'username', + 'pp': 0 + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/users.md b/api/endpoints/users.md new file mode 100644 index 0000000..d69d73a --- /dev/null +++ b/api/endpoints/users.md @@ -0,0 +1,38 @@ +# users Endpoint + +The users endpoint retrieves the data about a specific user. + +### Endpoint + +**users/:id** + +### available verbs + +_GET_ + +### Parameters + +**id**: The ID of the user you want to check. + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'avatarID': 'xxx', // Their AvatarID (e.g.: 'base01') + 'badge': 'xxx', // Their badge (e.g.: '80sb01') + 'gRole': 0, // Their service wide role (0 = None; 3 = Brand Ambassador (BA); 5 = Admin) + 'guest': false, // Is the user a guest? + 'id': -1, // Their ID + 'joined': 'xxx', // String representation of the time they joined plug (e.g.: '2014-07-23 22:47:00.573000') + 'language': 'xx', // ISO 639-1 representation of their used language + 'level': 1, // Their level + 'slug': 'xxx', // URL conform representation of their name (also used for the profile page) + 'sub': 0, // Is the user a subscriber? (0 = false; 1 = true) + 'username': 'xxx', // Their username + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/users_avatar.md b/api/endpoints/users_avatar.md new file mode 100644 index 0000000..06fd03f --- /dev/null +++ b/api/endpoints/users_avatar.md @@ -0,0 +1,32 @@ +# users/avatar Endpoint + +The users/avatar endpoint enables you to change your avatar. + +### Endpoint + +**users/avatar** + +### available verbs + +_PUT_ + +### Parameters + +**id**: The avatarID of the avatar you want to use + +```json +{ + "id": "xxxxx" +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/users_bulk.md b/api/endpoints/users_bulk.md new file mode 100644 index 0000000..0b131ba --- /dev/null +++ b/api/endpoints/users_bulk.md @@ -0,0 +1,38 @@ +# users/bulk Endpoint + +The users/bulk endpoint retrieves the data about a specific user. + +### Endpoint + +**users/bulk** + +### available verbs + +_POST_ + +### Parameters + +**ids**: The IDs of the users you want to retrieve data of as an array + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'avatarID': 'xxx', // Their AvatarID (e.g.: 'base01') + 'badge': 'xxx', // Their badge (e.g.: '80sb01') + 'gRole': 0, // Their service wide role (0 = None; 3 = Brand Ambassador (BA); 5 = Admin) + 'guest': false, // Is the user a guest? + 'id': -1, // Their ID + 'joined': 'xxx', // String representation of the time they joined plug (e.g.: '2014-07-23 22:47:00.573000') + 'language': 'xx', // ISO 639-1 representation of their used language + 'level': 1, // Their level + 'slug': 'xxx', // URL conform representation of their name (also used for the profile page) + 'sub': 0, // Is the user a subscriber? (0 = false; 1 = true) + 'username': 'xxx', // Their username + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/users_language.md b/api/endpoints/users_language.md new file mode 100644 index 0000000..9230309 --- /dev/null +++ b/api/endpoints/users_language.md @@ -0,0 +1,32 @@ +# users/language Endpoint + +The users/language endpoint enables you to change your language settings. + +### Endpoint + +**users/language** + +### available verbs + +_PUT_ + +### Parameters + +**language**: ISO 639-1 representation of the language you want to use + +```json +{ + "language": "xx" +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/users_me.md b/api/endpoints/users_me.md new file mode 100644 index 0000000..84d4b08 --- /dev/null +++ b/api/endpoints/users_me.md @@ -0,0 +1,59 @@ +# users/me Endpoint + +The users/me endpoint retrieves some data about yourself as well as notifications. + +### Endpoint + +**users/me** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'avatarID': 'xxx', // Your AvatarID (e.g.: 'base01') + 'badge': 'xxx', // Your badge (e.g.: '80sb01') + 'gRole': 0, // Your service wide role (0 = None; 3 = Brand Ambassador (BA); 5 = Admin) + 'guest': false, // Are you a guest? + 'id': -1, // Your ID + 'joined': 'xxx', // String representation of the time you joined plug (e.g.: '2014-07-23 22:47:00.573000') + 'language': 'xx', // ISO 639-1 representation of the language used by you + 'level': 1, // Your level + 'blurb': 'xxx', // Profile message set by you + 'slug': 'xxx', // URL conform representation of the your name (also used for the profile page) + 'sub': 0, // Are you a subscriber? (0 = false; 1 = true) + 'username': 'xxx', // Your username + 'xp': 0, // Your XP count + 'pp': 0, // Amount of plug points you gathered + 'pw': true, // Logged in via email? + 'settings': { + 'chatImages': true, // Are chat images activates? + 'chatTimestamps': 12, // Chat timestamps as 12 or 24 hour version + 'emoji': true, // Should emojis be shown? + 'friendAvatarsOnly': true, // Should only the avatars of my friends be shown? + 'notifyDJ': true, // Notify me about a switch in DJs + 'notifyFriendJoin': true, // Should you notify me about friends joining? + 'notifyScore': true, // Should you notify me about the last played song's score? + 'tooltips': true, // Should tooltips be shown? + 'videoOnly': true, // Should only the video be shown? + }, + 'ignores': [{ + 'id': -1, // ID of the user + 'username': 'xxxx' // Name of the user + }], + 'notifications': [{ + 'action': 'xxx', // Type of the notification + 'id': -1, // Internal ID + 'timestamp': 'xxx', // Date when the notification triggered + 'value': 'x' // Value carried with the notification + }] + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/users_me_history.md b/api/endpoints/users_me_history.md new file mode 100644 index 0000000..7c753ec --- /dev/null +++ b/api/endpoints/users_me_history.md @@ -0,0 +1,50 @@ +# users/me/history Endpoint + +The users/me/history endpoint retrieves a sorted list of songs you have played in the past. + +### Endpoint + +**users/me/history** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data in an array of objects + 'id': 'xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx', // Internal GUID v4 history ID + 'media': { + 'cid': 'xxx', // Media ID used on the originating website + 'title': 'xxx', // Media title + 'author': 'xxx', // Media author + 'image': 'xxx', // Thumbnail (youtube) or Artwork (soundcloud) + 'duration': 0, // Duration in seconds + 'format': 1, // Media format (1 = youtube; 2 = soundcloud) + 'id': -1 // Internal media ID + }, + 'room': { + 'name': 'xxx', // Name of the room the media was played in + 'private': false, // Is the room private? + 'slug': 'xxx' // URL conform representation of the room's name + }, + 'score': { + 'grabs': 0, // Amount of grabs + 'listeners': 0, // Amount of listeners + 'negative': 0, // Amount of mehs + 'positive': 0, // Amount of woots + 'skipped': 0 // Indicated whether the DJ was skipped or not + }, + 'timestamp': 'xx-xx-xx', // Indicates when this media was played + 'user': { + 'id': -1, // ID of the DJ + 'username': 'xxx' // Name of the user + } + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/users_me_transactions.md b/api/endpoints/users_me_transactions.md new file mode 100644 index 0000000..9b1e368 --- /dev/null +++ b/api/endpoints/users_me_transactions.md @@ -0,0 +1,29 @@ +# users/me/transactions Endpoint + +The users/me/transactions endpoint retrieves the full list of your transactions with plug. + +### Endpoint + +**users/me/transactions** + +### available verbs + +_GET_ + +### Data returned + +```js +{ + 'data': [{ // Contains the requested data + 'id': 'xxx', // Internal ID of the transaction + 'item': 'xxxx', // Name of the item you bought + 'pp': 0, // The price you paid in plug points + 'cash': 0, // The price you paid in cash + 'timestamp': 'xxx', // Date of the transaction + 'type': 'xxxx' // The type of item you bought + }], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/votes.md b/api/endpoints/votes.md new file mode 100644 index 0000000..d65452f --- /dev/null +++ b/api/endpoints/votes.md @@ -0,0 +1,34 @@ +# votes Endpoint + +The votes endpoint enables you to woot or meh the current media. + +### Endpoint + +**votes** + +### available verbs + +_POST_ + +### Parameters + +**direction**: Literally the direction of your vote and as such 1 is interpreted as woot and -1 as meh +**historyID**: Internal GUID v4 history ID of the current playback + +```json +{ + "direction": 1, + "historyID": "xxxxxxxx-xxxx-4xxx-xxxxx-xxxxxxxxxxxx" +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file From fe9513dd167cf1e7b7475cf882616965dbcd0353 Mon Sep 17 00:00:00 2001 From: SooYou Date: Fri, 17 Jul 2015 03:30:16 +0200 Subject: [PATCH 3/9] added README.md --- api/endpoints/README.md | 76 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/api/endpoints/README.md b/api/endpoints/README.md index e69de29..5619c73 100644 --- a/api/endpoints/README.md +++ b/api/endpoints/README.md @@ -0,0 +1,76 @@ +### Introduction + +The plug API is seperated into two systems, +[WebSocket](https://github.com/plugcommunity/documentation/tree/master/api/events) and +[REST](#). +While the WebSocket part is used to communicate at real time (such as chat, booth advancement etc.), the REST API is +used to do everything that does not require a real time connection. While this certainly induces a bit of latency +for each action, it is something that can be easily handled with. + + +### Tips and tricks + +One thing to mention is that you can only send a limited amount of request in a certain timespan, if you do overdo it +for a longer amount of time you'll be banned. This can certainly happen when you decide to go for deleting +a bunch of chat messages without artifically slowing the amount of requests down. + +### List of endpoints + +| Endpoint Name | Link | +|----------------------- | ------------- | +| Auth Facebook | "[auth/facebook] (/auth_facebook.md)" | +| Auth Login | "[auth/login] (/auth_login.md)" | +| Auth Reset | "[auth/reset/me] (/auth_reset_me.md)" | +| Auth Session | "[auth/session] (/auth_session.md)" | +| Bans | "[bans] (/bans.md)" | +| Bans Add | "[bans/add] (/bans_add.md)" | +| Booth | "[booth] (/booth_md)" | +| Booth Add | "[booth/add] (/booth_add.md)" | +| Booth Cycle | "[booth/cycle] (/booth_cycle.md)" | +| Booth Lock | "[booth/lock] (/booth_lock.md)" | +| Booth Move | "[booth/move] (/booth_move.md)" | +| Booth Remove | "[booth/remove/:id] (/booth_remove.md)" | +| Booth Skip | "[booth/skip] (/booth_skip.md)" | +| Booth Skip Me | "[booth/skip/me] (/booth_skip_me.md)" | +| Chat Delete | "[chat/:cid] (/chat_cid.md)" | +| Friends | "[friends] (/friends.md)" | +| Friends Ignore | "[friends/ignore] (/friends_ignore.md)" | +| Friends Invites | "[friends/invites] (/friends_invites.md)" | +| Grabs | "[grabs] (/grabs.md)" | +| Ignores | "[ignores] (/ignores.md)" | +| Mutes | "[mutes] (/mutes.md)" | +| News | "[news] (/news.md)" | +| Playlists | "[playlists] (/playlists.md)" | +| Playlists Activate | "[playlists/:id/activate] (/playlists_id_activate.md)" | +| Playlists Media Delete | "[playlists/:id/media/delete] (/playlists_id_media_delete.md)" | +| Playlists Media Insert | "[playlists/:id/media/insert] (/playlists_id_media_insert.md)" | +| Playlists Media Move | "[playlists/:id/media/move] (/playlists_id_media_move.md)" | +| Playlists Media Update | "[playlists/:id/media/update] (/playlists_id_media_update.md)" | +| Playlists Rename | "[playlists/:id/rename] (/playlists_id_rename.md)" | +| Playlists Shuffle | "[playlists/:id/shuffle] (/playlists_id_shuffle.md)" | +| Playlists Media | "[playlists/:id/media] (/playlists_id_media.md)" | +| Profile Blurb | "[profile/blurb] (/profile_blurb.md)" | +| Rooms | "[rooms] (/rooms.md)" | +| Rooms Favorites | "[rooms/favorites] (/rooms_favorites.md)" | +| Rooms History | "[rooms/history] (/rooms_history.md)" | +| Rooms Join | "[rooms/join] (/rooms_join.md)" | +| Rooms Me | "[rooms/me] (/rooms_me.md)" | +| Rooms State | "[rooms/state] (/rooms_state.md)" | +| Rooms Update | "[rooms/update] (/rooms_update.md)" | +| Rooms Validate | "[rooms/validate] (/rooms_validate.md)" | +| Staff | "[staff] (/staff.md)" | +| Staff Update | "[staff/update] (/staff_update.md)" | +| Store Inventory | "[store/inventory] (/store_inventory.md)" | +| Store Products | "[store/products] (/store_products.md)" | +| Store Purchase | "[store/purchase] (/store_purchase.md)" | +| Store Purchase Username | "[store/purchase/username] (/store_purchase_username.md)" | +| Users | "[users] (/users.md)" | +| Users Avatar | "[users/avatar] (/users_avatar.md)" | +| Users Bulk | "[users/bulk] (/users_bulk.md)" | +| Users Language | "[users/language] (/users_language.md)" | +| Users Me | "[users/me] (/users_me.md)" | +| Users Me History | "[users/me/history] (/users_me_history.md)" | +| Users Me Transactions | "[users/me/transactions] (/users_me_transactions.md)" | +| Votes | "[votes] (/votes.md)" | + +*Ordered by Endpoint Name^ \ No newline at end of file From 740b14c02b03291147333e256e2c8fda6c0c90da Mon Sep 17 00:00:00 2001 From: SooYou Date: Fri, 17 Jul 2015 13:58:44 +0200 Subject: [PATCH 4/9] changed some wording; fixed links --- api/endpoints/README.md | 112 ++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/api/endpoints/README.md b/api/endpoints/README.md index 5619c73..51bc2d9 100644 --- a/api/endpoints/README.md +++ b/api/endpoints/README.md @@ -10,67 +10,67 @@ for each action, it is something that can be easily handled with. ### Tips and tricks -One thing to mention is that you can only send a limited amount of request in a certain timespan, if you do overdo it -for a longer amount of time you'll be banned. This can certainly happen when you decide to go for deleting +One thing to mention is that you can only send a limited amount of request in a certain timespan, if you overdo it +for a longer amount of time you'll be banned. This can certainly happen when you decide to to delete a bunch of chat messages without artifically slowing the amount of requests down. ### List of endpoints | Endpoint Name | Link | |----------------------- | ------------- | -| Auth Facebook | "[auth/facebook] (/auth_facebook.md)" | -| Auth Login | "[auth/login] (/auth_login.md)" | -| Auth Reset | "[auth/reset/me] (/auth_reset_me.md)" | -| Auth Session | "[auth/session] (/auth_session.md)" | -| Bans | "[bans] (/bans.md)" | -| Bans Add | "[bans/add] (/bans_add.md)" | -| Booth | "[booth] (/booth_md)" | -| Booth Add | "[booth/add] (/booth_add.md)" | -| Booth Cycle | "[booth/cycle] (/booth_cycle.md)" | -| Booth Lock | "[booth/lock] (/booth_lock.md)" | -| Booth Move | "[booth/move] (/booth_move.md)" | -| Booth Remove | "[booth/remove/:id] (/booth_remove.md)" | -| Booth Skip | "[booth/skip] (/booth_skip.md)" | -| Booth Skip Me | "[booth/skip/me] (/booth_skip_me.md)" | -| Chat Delete | "[chat/:cid] (/chat_cid.md)" | -| Friends | "[friends] (/friends.md)" | -| Friends Ignore | "[friends/ignore] (/friends_ignore.md)" | -| Friends Invites | "[friends/invites] (/friends_invites.md)" | -| Grabs | "[grabs] (/grabs.md)" | -| Ignores | "[ignores] (/ignores.md)" | -| Mutes | "[mutes] (/mutes.md)" | -| News | "[news] (/news.md)" | -| Playlists | "[playlists] (/playlists.md)" | -| Playlists Activate | "[playlists/:id/activate] (/playlists_id_activate.md)" | -| Playlists Media Delete | "[playlists/:id/media/delete] (/playlists_id_media_delete.md)" | -| Playlists Media Insert | "[playlists/:id/media/insert] (/playlists_id_media_insert.md)" | -| Playlists Media Move | "[playlists/:id/media/move] (/playlists_id_media_move.md)" | -| Playlists Media Update | "[playlists/:id/media/update] (/playlists_id_media_update.md)" | -| Playlists Rename | "[playlists/:id/rename] (/playlists_id_rename.md)" | -| Playlists Shuffle | "[playlists/:id/shuffle] (/playlists_id_shuffle.md)" | -| Playlists Media | "[playlists/:id/media] (/playlists_id_media.md)" | -| Profile Blurb | "[profile/blurb] (/profile_blurb.md)" | -| Rooms | "[rooms] (/rooms.md)" | -| Rooms Favorites | "[rooms/favorites] (/rooms_favorites.md)" | -| Rooms History | "[rooms/history] (/rooms_history.md)" | -| Rooms Join | "[rooms/join] (/rooms_join.md)" | -| Rooms Me | "[rooms/me] (/rooms_me.md)" | -| Rooms State | "[rooms/state] (/rooms_state.md)" | -| Rooms Update | "[rooms/update] (/rooms_update.md)" | -| Rooms Validate | "[rooms/validate] (/rooms_validate.md)" | -| Staff | "[staff] (/staff.md)" | -| Staff Update | "[staff/update] (/staff_update.md)" | -| Store Inventory | "[store/inventory] (/store_inventory.md)" | -| Store Products | "[store/products] (/store_products.md)" | -| Store Purchase | "[store/purchase] (/store_purchase.md)" | -| Store Purchase Username | "[store/purchase/username] (/store_purchase_username.md)" | -| Users | "[users] (/users.md)" | -| Users Avatar | "[users/avatar] (/users_avatar.md)" | -| Users Bulk | "[users/bulk] (/users_bulk.md)" | -| Users Language | "[users/language] (/users_language.md)" | -| Users Me | "[users/me] (/users_me.md)" | -| Users Me History | "[users/me/history] (/users_me_history.md)" | -| Users Me Transactions | "[users/me/transactions] (/users_me_transactions.md)" | -| Votes | "[votes] (/votes.md)" | +| Auth Facebook | "[auth/facebook] (/api/endpoints/auth_facebook.md)" | +| Auth Login | "[auth/login] (/api/endpoints/auth_login.md)" | +| Auth Reset | "[auth/reset/me] (/api/endpoints/auth_reset_me.md)" | +| Auth Session | "[auth/session] (/api/endpoints/auth_session.md)" | +| Bans | "[bans] (/api/endpoints/bans.md)" | +| Bans Add | "[bans/add] (/api/endpoints/bans_add.md)" | +| Booth | "[booth] (/api/endpoints/booth_md)" | +| Booth Add | "[booth/add] (/api/endpoints/booth_add.md)" | +| Booth Cycle | "[booth/cycle] (/api/endpoints/booth_cycle.md)" | +| Booth Lock | "[booth/lock] (/api/endpoints/booth_lock.md)" | +| Booth Move | "[booth/move] (/api/endpoints/booth_move.md)" | +| Booth Remove | "[booth/remove/:id] (/api/endpoints/booth_remove.md)" | +| Booth Skip | "[booth/skip] (/api/endpoints/booth_skip.md)" | +| Booth Skip Me | "[booth/skip/me] (/api/endpoints/booth_skip_me.md)" | +| Chat Delete | "[chat/:cid] (/api/endpoints/chat_cid.md)" | +| Friends | "[friends] (/api/endpoints/friends.md)" | +| Friends Ignore | "[friends/ignore] (/api/endpoints/friends_ignore.md)" | +| Friends Invites | "[friends/invites] (/api/endpoints/friends_invites.md)" | +| Grabs | "[grabs] (/api/endpoints/grabs.md)" | +| Ignores | "[ignores] (/api/endpoints/ignores.md)" | +| Mutes | "[mutes] (/api/endpoints/mutes.md)" | +| News | "[news] (/api/endpoints/news.md)" | +| Playlists | "[playlists] (/api/endpoints/playlists.md)" | +| Playlists Activate | "[playlists/:id/activate] (/api/endpoints/playlists_id_activate.md)" | +| Playlists Media Delete | "[playlists/:id/media/delete] (/api/endpoints/playlists_id_media_delete.md)" | +| Playlists Media Insert | "[playlists/:id/media/insert] (/api/endpoints/playlists_id_media_insert.md)" | +| Playlists Media Move | "[playlists/:id/media/move] (/api/endpoints/playlists_id_media_move.md)" | +| Playlists Media Update | "[playlists/:id/media/update] (/api/endpoints/playlists_id_media_update.md)" | +| Playlists Rename | "[playlists/:id/rename] (/api/endpoints/playlists_id_rename.md)" | +| Playlists Shuffle | "[playlists/:id/shuffle] (/api/endpoints/playlists_id_shuffle.md)" | +| Playlists Media | "[playlists/:id/media] (/api/endpoints/playlists_id_media.md)" | +| Profile Blurb | "[profile/blurb] (/api/endpoints/profile_blurb.md)" | +| Rooms | "[rooms] (/api/endpoints/rooms.md)" | +| Rooms Favorites | "[rooms/favorites] (/api/endpoints/rooms_favorites.md)" | +| Rooms History | "[rooms/history] (/api/endpoints/rooms_history.md)" | +| Rooms Join | "[rooms/join] (/api/endpoints/rooms_join.md)" | +| Rooms Me | "[rooms/me] (/api/endpoints/rooms_me.md)" | +| Rooms State | "[rooms/state] (/api/endpoints/rooms_state.md)" | +| Rooms Update | "[rooms/update] (/api/endpoints/rooms_update.md)" | +| Rooms Validate | "[rooms/validate] (/api/endpoints/rooms_validate.md)" | +| Staff | "[staff] (/api/endpoints/staff.md)" | +| Staff Update | "[staff/update] (/api/endpoints/staff_update.md)" | +| Store Inventory | "[store/inventory] (/api/endpoints/store_inventory.md)" | +| Store Products | "[store/products] (/api/endpoints/store_products.md)" | +| Store Purchase | "[store/purchase] (/api/endpoints/store_purchase.md)" | +| Store Purchase Username | "[store/purchase/username] (/api/endpoints/store_purchase_username.md)" | +| Users | "[users] (/api/endpoints/users.md)" | +| Users Avatar | "[users/avatar] (/api/endpoints/users_avatar.md)" | +| Users Bulk | "[users/bulk] (/api/endpoints/users_bulk.md)" | +| Users Language | "[users/language] (/api/endpoints/users_language.md)" | +| Users Me | "[users/me] (/api/endpoints/users_me.md)" | +| Users Me History | "[users/me/history] (/api/endpoints/users_me_history.md)" | +| Users Me Transactions | "[users/me/transactions] (/api/endpoints/users_me_transactions.md)" | +| Votes | "[votes] (/api/endpoints/votes.md)" | *Ordered by Endpoint Name^ \ No newline at end of file From 0fd60f8afd25925e9f34b4c316fe73e5ca23838d Mon Sep 17 00:00:00 2001 From: SooYou Date: Fri, 17 Jul 2015 14:00:05 +0200 Subject: [PATCH 5/9] fixed some typos and c&p errors --- api/endpoints/auth_facebook.md | 2 +- api/endpoints/auth_login.md | 2 +- api/endpoints/auth_session.md | 2 +- api/endpoints/bans.md | 8 ++++---- api/endpoints/bans_add.md | 2 +- api/endpoints/booth_add.md | 2 +- api/endpoints/booth_cycle.md | 4 ++-- api/endpoints/booth_lock.md | 4 ++-- api/endpoints/booth_move.md | 8 ++++---- api/endpoints/booth_remove_id.md | 2 ++ api/endpoints/booth_skip.md | 2 +- api/endpoints/chat_cid.md | 10 +++++++++- api/endpoints/mutes.md | 4 ++-- api/endpoints/news.md | 2 +- api/endpoints/playlists.md | 2 +- api/endpoints/playlists_id_activate.md | 2 +- api/endpoints/playlists_id_media_delete.md | 4 ++-- api/endpoints/playlists_id_media_insert.md | 14 ++++++++++---- api/endpoints/playlists_id_media_move.md | 6 +++--- api/endpoints/playlists_id_media_update.md | 2 +- api/endpoints/playlists_id_shuffle.md | 2 +- api/endpoints/playlists_media.md | 2 +- api/endpoints/rooms.md | 6 +++--- api/endpoints/rooms_favorites.md | 4 ++-- api/endpoints/rooms_history.md | 2 +- api/endpoints/rooms_join.md | 11 +++++++---- api/endpoints/rooms_me.md | 2 +- api/endpoints/rooms_state.md | 2 +- api/endpoints/store_inventory.md | 2 +- api/endpoints/store_products.md | 6 +++--- api/endpoints/store_purchase_username.md | 2 +- api/endpoints/users.md | 2 +- api/endpoints/users_bulk.md | 2 +- 33 files changed, 74 insertions(+), 55 deletions(-) diff --git a/api/endpoints/auth_facebook.md b/api/endpoints/auth_facebook.md index f6f38da..dab52af 100644 --- a/api/endpoints/auth_facebook.md +++ b/api/endpoints/auth_facebook.md @@ -1,6 +1,6 @@ # auth/facebook Endpoint -The auth/facebook endpoint logs you into the plug.dj service +The auth/facebook endpoint logs you into the plug.dj service. **Note**: This sets the **pw** member in your state data to false diff --git a/api/endpoints/auth_login.md b/api/endpoints/auth_login.md index c8df5fa..af26af0 100644 --- a/api/endpoints/auth_login.md +++ b/api/endpoints/auth_login.md @@ -1,6 +1,6 @@ # auth/login Endpoint -The auth/login endpoint logs you into the plug.dj service +The auth/login endpoint logs you into the plug.dj service. ### Endpoint diff --git a/api/endpoints/auth_session.md b/api/endpoints/auth_session.md index c719b57..6da88fb 100644 --- a/api/endpoints/auth_session.md +++ b/api/endpoints/auth_session.md @@ -1,6 +1,6 @@ # auth/session Endpoint -The auth/session enables you to log out of plug +The auth/session endpoint enables you to log out of plug. ### Endpoint diff --git a/api/endpoints/bans.md b/api/endpoints/bans.md index ffe9602..87e383a 100644 --- a/api/endpoints/bans.md +++ b/api/endpoints/bans.md @@ -1,9 +1,9 @@ # bans Endpoint -The bans endpoint retrieves a list of active bans +The bans endpoint retrieves a list of active bans. -**Note**: you need to have sufficient permission in the room to acces this resource, otherwise you'll just be greeted -with a requestError message. +**Note**: You need to have sufficient permissions in the room to access this resource, otherwise you'll just be greeted +with a requestError status. **Reason**: The reason member is set as a single number which represent the following reasons: **1**: (VIOLATING_COMMUNITY_RULES) User violated the community rules @@ -32,7 +32,7 @@ _GET_ 'data': [{ // Contains the requested data 'duration': 'x', // See BanDuration above 'moderator': 'xxxx', // Name of the moderator - 'reason': 1, // Reason why they got banned + 'reason': 1, // Reason why they got banned. See BanReason above 'id': -1, // ID of the user 'timestamp': 'xxx', // Date when the ban became active 'username': 'xxxx' // Name of the user diff --git a/api/endpoints/bans_add.md b/api/endpoints/bans_add.md index 0121c4d..0342e8b 100644 --- a/api/endpoints/bans_add.md +++ b/api/endpoints/bans_add.md @@ -2,7 +2,7 @@ The bans/add endpoint enables you to ban a user. -**Note**: you need to have sufficient permissions in the room to access this resource. +**Note**: You need to have sufficient permissions in the room to access this resource. **Reason**: The reason member is set as a single number which represent the following reasons: **1**: (VIOLATING_COMMUNITY_RULES) User violated the community rules diff --git a/api/endpoints/booth_add.md b/api/endpoints/booth_add.md index de343c5..259d82d 100644 --- a/api/endpoints/booth_add.md +++ b/api/endpoints/booth_add.md @@ -2,7 +2,7 @@ The booth/add endpoint enables you to add a user to the waitlist. -**Note**: you need to have sufficient permissions in the room to access this resource. +**Note**: You need to have sufficient permissions in the room to access this resource. ### Endpoint diff --git a/api/endpoints/booth_cycle.md b/api/endpoints/booth_cycle.md index 4dfc1a6..5b20ae4 100644 --- a/api/endpoints/booth_cycle.md +++ b/api/endpoints/booth_cycle.md @@ -1,8 +1,8 @@ # booth/cycle Endpoint -The booth/cycle endpoint enables you to cycle the waitlist. +The booth/cycle endpoint enables you to decide whether the waitlist should cycle or not. -**Note**: you need to have sufficient permissions in the room to access this resource. +**Note**: You need to have sufficient permissions in the room to access this resource. ### Endpoint diff --git a/api/endpoints/booth_lock.md b/api/endpoints/booth_lock.md index e30484a..5546cb5 100644 --- a/api/endpoints/booth_lock.md +++ b/api/endpoints/booth_lock.md @@ -1,8 +1,8 @@ # booth/lock Endpoint -The booth/lock endpoint enables you to lock the waitlist. +The booth/lock endpoint enables you to decide whether the waitlist should be locked or not. -**Note**: you need to have sufficient permissions in the room to access this resource. +**Note**: You need to have sufficient permissions in the room to access this resource. ### Endpoint diff --git a/api/endpoints/booth_move.md b/api/endpoints/booth_move.md index 023c26d..0f6cf0e 100644 --- a/api/endpoints/booth_move.md +++ b/api/endpoints/booth_move.md @@ -1,8 +1,8 @@ # booth/move Endpoint -The booth/move endpoint enables you to move a user in a waitlist. +The booth/move endpoint enables you to move a user in the waitlist. -**Note**: you need to have sufficient permissions in the room to access this resource. +**Note**: You need to have sufficient permissions in the room to access this resource. ### Endpoint @@ -17,8 +17,8 @@ _POST_ **userID**: ID of the user you want to move **position**: The new position of the user -**Note**: the waitlist has a zero based index, so to move the user to the desired position you have to think -n-1 where n equals the desired position +**Note**: The waitlist has a zero based index, so to move the user to the desired position you have to think +about it as **n-1** where **n** equals the **desired position** ```json { diff --git a/api/endpoints/booth_remove_id.md b/api/endpoints/booth_remove_id.md index 8050406..940d29c 100644 --- a/api/endpoints/booth_remove_id.md +++ b/api/endpoints/booth_remove_id.md @@ -2,6 +2,8 @@ The booth/remove/:id endpoint lets you remove a user from the waitlist. +**Note**: You need to have sufficient permissions in the room to access this resource. + ### Endpoint **booth/remove/:id** diff --git a/api/endpoints/booth_skip.md b/api/endpoints/booth_skip.md index c0e88d3..4ff1a18 100644 --- a/api/endpoints/booth_skip.md +++ b/api/endpoints/booth_skip.md @@ -2,7 +2,7 @@ The booth/skip endpoint enables you to skip the current DJ. -**Note**: you need to have sufficient permission in the room to acces this resource. +**Note**: You need to have sufficient permission in the room to acces this resource. ### Endpoint diff --git a/api/endpoints/chat_cid.md b/api/endpoints/chat_cid.md index 05b6494..f2cc66c 100644 --- a/api/endpoints/chat_cid.md +++ b/api/endpoints/chat_cid.md @@ -2,6 +2,8 @@ The chat/:cid endpoint enables you to delete a chat message via the Chat ID (cid). +**Note**: You need to have sufficient permissions in the room to access this resource. + ### Endpoint **chat/:cid** @@ -10,7 +12,13 @@ The chat/:cid endpoint enables you to delete a chat message via the Chat ID (cid _DELETE_ -### Data returned for both verbs +### URL Parameters + +**cid**: ID of the chat message you want to delete + +>https://plug.dj/_/chat/xxxxxx-xxxxxxxxxxx + +### Data returned ```js { diff --git a/api/endpoints/mutes.md b/api/endpoints/mutes.md index 70956be..04b5794 100644 --- a/api/endpoints/mutes.md +++ b/api/endpoints/mutes.md @@ -2,7 +2,7 @@ The mutes endpoint modifies the current mutes. -**Note**: you need to have sufficient permission in the room to acces this resource, otherwise you'll just be greeted +**Note**: You need to have sufficient permissions in the room to access this resource, otherwise you'll just be greeted with a requestError message. **Reason**: The reason member is set as a single number which represent the following reasons: @@ -32,7 +32,7 @@ _GET_, _POST_ 'data': [{ // Contains the requested data 'expires': 0, // Duration in seconds 'moderator': 'xxxx', // Name of the moderator - 'reason': 1, // Reason why they got banned + 'reason': 1, // Reason why they got muted 'id': -1, // ID of the user 'username': 'xxxx' // Name of the user }], diff --git a/api/endpoints/news.md b/api/endpoints/news.md index 3fa0284..595538e 100644 --- a/api/endpoints/news.md +++ b/api/endpoints/news.md @@ -1,6 +1,6 @@ # news Endpoint -The news endpoint retrieves a sorted feed from blog.plug.dj +The news endpoint retrieves a sorted feed from blog.plug.dj. ### Endpoint diff --git a/api/endpoints/playlists.md b/api/endpoints/playlists.md index 24a6fd1..209e52a 100644 --- a/api/endpoints/playlists.md +++ b/api/endpoints/playlists.md @@ -67,7 +67,7 @@ _GET_, _POST_, _DELETE_ **id**: ID of the playlist you want to delete ->https://plug.dj/_/playlists/2093483 +>https://plug.dj/_/playlists/-1 ### Data returned for _DELETE_ diff --git a/api/endpoints/playlists_id_activate.md b/api/endpoints/playlists_id_activate.md index 682731d..8bfff9f 100644 --- a/api/endpoints/playlists_id_activate.md +++ b/api/endpoints/playlists_id_activate.md @@ -1,6 +1,6 @@ # playlists/:id/activate Endpoint -The playlists/:id/activate endpoint enables you to activate a playlist. +The playlists/:id/activate endpoint enables you to activate a playlist as the one you want to play media of. ### Endpoint diff --git a/api/endpoints/playlists_id_media_delete.md b/api/endpoints/playlists_id_media_delete.md index b0aaed2..138521c 100644 --- a/api/endpoints/playlists_id_media_delete.md +++ b/api/endpoints/playlists_id_media_delete.md @@ -1,6 +1,6 @@ # playlists/:id/media/delete Endpoint -The playlists/:id/media/delete lets you delete media objects. +The playlists/:id/media/delete endpoint lets you delete media objects. ### Endpoint @@ -26,7 +26,7 @@ _POST_ ```js { - 'data': [{ + 'data': [{ // Contains the requested data 'cid': 'xxx', // Media ID used on the originating website 'title': 'xxx', // Media title 'author': 'xxx', // Media author diff --git a/api/endpoints/playlists_id_media_insert.md b/api/endpoints/playlists_id_media_insert.md index 2069165..0399f59 100644 --- a/api/endpoints/playlists_id_media_insert.md +++ b/api/endpoints/playlists_id_media_insert.md @@ -1,6 +1,6 @@ # playlists/:id/media/insert Endpoint -The playlists/:id/media/insert lets you insert media objects. +The playlists/:id/media/insert endpoint lets you insert media objects into a playlist. ### Endpoint @@ -12,13 +12,19 @@ _POST_ ### Parameters -**ids**: IDs of the media objects you want to insert +**media**: Media objects you want to insert **append**: Should the array be concatenated at the end of the playlist? ```json { "media": [{ - + 'cid': 'xxx', + 'title': 'xxx', + 'author': 'xxx', + 'image': 'xxx', + 'duration': 0, + 'format': 1, + 'id': -1 }], "append": false } @@ -28,7 +34,7 @@ _POST_ ```js { - 'data': [{ + 'data': [{ // Contains the requested data 'cid': 'xxx', // Media ID used on the originating website 'title': 'xxx', // Media title 'author': 'xxx', // Media author diff --git a/api/endpoints/playlists_id_media_move.md b/api/endpoints/playlists_id_media_move.md index 8899a17..161e07a 100644 --- a/api/endpoints/playlists_id_media_move.md +++ b/api/endpoints/playlists_id_media_move.md @@ -1,6 +1,6 @@ # playlists/:id/media/move Endpoint -The playlists/:id/media/move lets you move media objects to another index in a playlist. +The playlists/:id/media/move endpoint lets you move media objects to another index in a playlist. ### Endpoint @@ -12,7 +12,7 @@ _PUT_ ### Parameters -**ids**: Array of media IDs you want to move +**ids**: Array of media IDs which represent the media you want to move **beforeID**: ID of the media where the media should be inserted ```json @@ -28,7 +28,7 @@ _PUT_ ```js { - 'data': [{ + 'data': [{ // Contains the requested data 'cid': 'xxx', // Media ID used on the originating website 'title': 'xxx', // Media title 'author': 'xxx', // Media author diff --git a/api/endpoints/playlists_id_media_update.md b/api/endpoints/playlists_id_media_update.md index 943f4b1..805c20a 100644 --- a/api/endpoints/playlists_id_media_update.md +++ b/api/endpoints/playlists_id_media_update.md @@ -1,6 +1,6 @@ # playlists/:id/media/update Endpoint -The playlists/:id/media/update lets you update the metadata of a media object. +The playlists/:id/media/update endpoint lets you update the metadata of a media object. ### Endpoint diff --git a/api/endpoints/playlists_id_shuffle.md b/api/endpoints/playlists_id_shuffle.md index 9ac97a4..3a9eddb 100644 --- a/api/endpoints/playlists_id_shuffle.md +++ b/api/endpoints/playlists_id_shuffle.md @@ -14,7 +14,7 @@ _PUT_ ```js { - 'data': [{ + 'data': [{ // Contains the requested data 'cid': 'xxx', // Media ID used on the originating website 'title': 'xxx', // Media title 'author': 'xxx', // Media author diff --git a/api/endpoints/playlists_media.md b/api/endpoints/playlists_media.md index 76a20ee..89e7863 100644 --- a/api/endpoints/playlists_media.md +++ b/api/endpoints/playlists_media.md @@ -1,6 +1,6 @@ # playlists/:id/media Endpoint -The playlists/:id/media endpoint retrieves all of your playlists. +The playlists/:id/media endpoint retrieves all media objects in one of your playlists. ### Endpoint diff --git a/api/endpoints/rooms.md b/api/endpoints/rooms.md index 35c7313..eaffa28 100644 --- a/api/endpoints/rooms.md +++ b/api/endpoints/rooms.md @@ -1,6 +1,6 @@ # rooms Endpoint -The rooms endpoint retrieves all rooms in a sorted list based on the amount of people that are connected or creates a room via _POST_. +The rooms endpoint retrieves all rooms in a sorted list ordered by the amount of people that are connected or creates a room via _POST_. ### Endpoint @@ -14,8 +14,8 @@ _GET_, _POST_ ### Parameters **q**: Search query used to filter the rooms -**page**: Pagination, starts at page 1. -**limit**: The amount of rooms that should be shown per page. +**page**: Pagination, starts at page 1 +**limit**: The amount of rooms that should be shown per page ### Data returned for _GET_ diff --git a/api/endpoints/rooms_favorites.md b/api/endpoints/rooms_favorites.md index 1fb3197..4428470 100644 --- a/api/endpoints/rooms_favorites.md +++ b/api/endpoints/rooms_favorites.md @@ -14,8 +14,8 @@ _GET_, _POST_, _DELETE_ ### Parameters for _GET_ -**page**: Pagination, starts at page 1. -**limit**: The amount of rooms that should be shown per page. +**page**: Pagination, starts at page 1 +**limit**: The amount of rooms that should be shown per page ### Data returned for _GET_ diff --git a/api/endpoints/rooms_history.md b/api/endpoints/rooms_history.md index 0e77402..a655722 100644 --- a/api/endpoints/rooms_history.md +++ b/api/endpoints/rooms_history.md @@ -1,6 +1,6 @@ # rooms/history Endpoint -The room history endpoint enables you to get the room's history you're in. +The room history endpoint enables you to get the room's history. ### Endpoint diff --git a/api/endpoints/rooms_join.md b/api/endpoints/rooms_join.md index 14036ac..2a027aa 100644 --- a/api/endpoints/rooms_join.md +++ b/api/endpoints/rooms_join.md @@ -1,6 +1,6 @@ # rooms/join Endpoint -The rooms/join enables you to join a room +The rooms/join endpoint enables you to join a room. ### Endpoint @@ -10,10 +10,13 @@ The rooms/join enables you to join a room _POST_ -### parameters -```js +### Parameters + +**slug**: The URL conform name of the room you want to join + +```json { - 'slug': 'xxxxx' // The URL conform name of the room is needed to join`` + "slug": "xxxxx" } ``` diff --git a/api/endpoints/rooms_me.md b/api/endpoints/rooms_me.md index d29a8f2..66dcf4b 100644 --- a/api/endpoints/rooms_me.md +++ b/api/endpoints/rooms_me.md @@ -2,7 +2,7 @@ The rooms/me endpoint requests meta information about the rooms you host. -**NOTE**: The guests member is not available in this request, neither is the amount of guests included in the +**NOTE**: The guests member is not available in this request, **neither** is the amount of guests included in the population count. ### Endpoint diff --git a/api/endpoints/rooms_state.md b/api/endpoints/rooms_state.md index d709d46..9456892 100644 --- a/api/endpoints/rooms_state.md +++ b/api/endpoints/rooms_state.md @@ -2,7 +2,7 @@ The rooms/state endpoint requests meta information about the room you are currently in. -**NOTE**: The guests member is not available in this request, neither is the amount of guests included in the +**NOTE**: The guests member is not available in this request, **neither** is the amount of guests included in the population count. ### Endpoint diff --git a/api/endpoints/store_inventory.md b/api/endpoints/store_inventory.md index a7b9f01..3edb5a5 100644 --- a/api/endpoints/store_inventory.md +++ b/api/endpoints/store_inventory.md @@ -1,6 +1,6 @@ # store/inventory Endpoint -The store/inventory lists all of your boughts items. +The store/inventory endpoint lists all of your boughts items. ### Endpoint diff --git a/api/endpoints/store_products.md b/api/endpoints/store_products.md index 12f1470..2b869d3 100644 --- a/api/endpoints/store_products.md +++ b/api/endpoints/store_products.md @@ -1,6 +1,6 @@ # store/products Endpoint -The store/products lists all available products in the store +The store/products endpoint lists all available products in the store. ### Endpoint @@ -11,9 +11,9 @@ The store/products lists all available products in the store _GET_ -### Parameters +### URL Parameters -**Note**: Not setting those will retrieve the full list of items available +**Note**: Not setting these will retrieve the full list of items available **type**: Same as the type member of the store item **category**: Same as the category member of the store item diff --git a/api/endpoints/store_purchase_username.md b/api/endpoints/store_purchase_username.md index 7b7cb41..fc4a91d 100644 --- a/api/endpoints/store_purchase_username.md +++ b/api/endpoints/store_purchase_username.md @@ -1,6 +1,6 @@ # store/purchase/username Endpoint -The store/purchase/username endpoint enables you to buy items from the store. +The store/purchase/username endpoint enables you to change your username. ### Endpoint diff --git a/api/endpoints/users.md b/api/endpoints/users.md index d69d73a..adbb0ad 100644 --- a/api/endpoints/users.md +++ b/api/endpoints/users.md @@ -10,7 +10,7 @@ The users endpoint retrieves the data about a specific user. _GET_ -### Parameters +### URL Parameters **id**: The ID of the user you want to check. diff --git a/api/endpoints/users_bulk.md b/api/endpoints/users_bulk.md index 0b131ba..4f6e017 100644 --- a/api/endpoints/users_bulk.md +++ b/api/endpoints/users_bulk.md @@ -1,6 +1,6 @@ # users/bulk Endpoint -The users/bulk endpoint retrieves the data about a specific user. +The users/bulk endpoint retrieves the data about several users. ### Endpoint From ac6edf77b1acd561bd0a5fb4973cf2c4ec7fce3b Mon Sep 17 00:00:00 2001 From: SooYou Date: Fri, 17 Jul 2015 14:05:57 +0200 Subject: [PATCH 6/9] fixed malformed json request --- api/endpoints/playlists_id_media_insert.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/endpoints/playlists_id_media_insert.md b/api/endpoints/playlists_id_media_insert.md index 0399f59..cf89925 100644 --- a/api/endpoints/playlists_id_media_insert.md +++ b/api/endpoints/playlists_id_media_insert.md @@ -18,13 +18,13 @@ _POST_ ```json { "media": [{ - 'cid': 'xxx', - 'title': 'xxx', - 'author': 'xxx', - 'image': 'xxx', - 'duration': 0, - 'format': 1, - 'id': -1 + "cid": "xxx", + "title": "xxx", + "author": "xxx", + "image": "xxx", + "duration": 0, + "format": 1, + "id": -1 }], "append": false } From e7c3ef7a26989e4c41fe6ef907b60947cb683dc7 Mon Sep 17 00:00:00 2001 From: SooYou Date: Fri, 17 Jul 2015 14:09:34 +0200 Subject: [PATCH 7/9] changed both parameter section examples to json for consistency --- api/endpoints/auth_facebook.md | 12 ++++++++---- api/endpoints/auth_login.md | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/api/endpoints/auth_facebook.md b/api/endpoints/auth_facebook.md index dab52af..eb65ba1 100644 --- a/api/endpoints/auth_facebook.md +++ b/api/endpoints/auth_facebook.md @@ -14,11 +14,15 @@ _POST_ ### Parameters -```js +**csrf**: Cross Site Request Forgery token +**accessToken**: Access token given by facebook.com +**userID**: userID given by facebook.com + +```json { - 'csrf': 'xxxxx', // Cross Site Request Forgery token - 'accessToken': 'xxx', // Access token given by facebook.com - 'userID': 'xxx' // userID given by facebook.com + "csrf": "xxxxx" + "accessToken": "xxx" + "userID": "xxx" } ``` diff --git a/api/endpoints/auth_login.md b/api/endpoints/auth_login.md index af26af0..bb966c7 100644 --- a/api/endpoints/auth_login.md +++ b/api/endpoints/auth_login.md @@ -12,11 +12,15 @@ _POST_ ### Parameters -```js +**csrf**: Cross Site Request Forgery token +**email**: your email +**password**: your password + +```json { - 'csrf': 'xxxxx', // Cross Site Request Forgery token - 'email': 'xxx@xxx.com', // E-Mail address - 'password': 'xxx' // Password in plaintext + "csrf": "xxxxx" + "email": "xxx@xxx.com" + "password": "xxx" } ``` From 17914efd3d386289eb55c6ea5d398c5e75480c14 Mon Sep 17 00:00:00 2001 From: SooYou Date: Fri, 17 Jul 2015 16:24:56 +0200 Subject: [PATCH 8/9] added possible error messages --- api/endpoints/auth_login.md | 24 ++++++++++- api/endpoints/bans.md | 12 ++++++ api/endpoints/bans_add.md | 50 ++++++++++++++++++++++ api/endpoints/booth.md | 22 ++++++++++ api/endpoints/booth_add.md | 30 +++++++++++++ api/endpoints/booth_cycle.md | 22 ++++++++++ api/endpoints/booth_lock.md | 22 ++++++++++ api/endpoints/booth_move.md | 30 +++++++++++++ api/endpoints/booth_remove_id.md | 12 ++++++ api/endpoints/booth_skip.md | 22 ++++++++++ api/endpoints/booth_skip_me.md | 12 ++++++ api/endpoints/friends.md | 22 ++++++++++ api/endpoints/friends_ignore.md | 22 ++++++++++ api/endpoints/friends_invites.md | 12 ++++++ api/endpoints/grabs.md | 22 ++++++++++ api/endpoints/ignores.md | 22 ++++++++++ api/endpoints/mutes.md | 22 ++++++++++ api/endpoints/playlists.md | 32 ++++++++++++++ api/endpoints/playlists_id_activate.md | 22 ++++++++++ api/endpoints/playlists_id_media_delete.md | 22 ++++++++++ api/endpoints/playlists_id_media_insert.md | 22 ++++++++++ api/endpoints/playlists_id_media_move.md | 22 ++++++++++ api/endpoints/playlists_id_media_update.md | 22 ++++++++++ api/endpoints/playlists_id_rename.md | 22 ++++++++++ api/endpoints/playlists_id_shuffle.md | 12 ++++++ api/endpoints/playlists_media.md | 12 ++++++ api/endpoints/profile_blurb.md | 22 ++++++++++ api/endpoints/rooms.md | 22 ++++++++++ api/endpoints/rooms_favorites.md | 22 ++++++++++ api/endpoints/rooms_history.md | 12 ++++++ api/endpoints/rooms_join.md | 22 ++++++++++ api/endpoints/rooms_me.md | 12 ++++++ api/endpoints/rooms_state.md | 22 ++++++++++ api/endpoints/rooms_update.md | 22 ++++++++++ api/endpoints/rooms_validate.md | 12 ++++++ api/endpoints/staff.md | 12 ++++++ api/endpoints/staff_update.md | 22 ++++++++++ api/endpoints/store_inventory.md | 12 ++++++ api/endpoints/store_products.md | 12 ++++++ api/endpoints/store_purchase.md | 22 ++++++++++ api/endpoints/store_purchase_username.md | 22 ++++++++++ api/endpoints/users.md | 22 ++++++++++ api/endpoints/users_avatar.md | 22 ++++++++++ api/endpoints/users_bulk.md | 32 ++++++++++++++ api/endpoints/users_language.md | 22 ++++++++++ api/endpoints/users_me.md | 12 ++++++ api/endpoints/users_me_history.md | 12 ++++++ api/endpoints/users_me_transactions.md | 12 ++++++ api/endpoints/votes.md | 12 ++++++ 49 files changed, 982 insertions(+), 2 deletions(-) diff --git a/api/endpoints/auth_login.md b/api/endpoints/auth_login.md index bb966c7..a0d268d 100644 --- a/api/endpoints/auth_login.md +++ b/api/endpoints/auth_login.md @@ -13,8 +13,8 @@ _POST_ ### Parameters **csrf**: Cross Site Request Forgery token -**email**: your email -**password**: your password +**email**: Your email +**password**: Your password ```json { @@ -24,6 +24,26 @@ _POST_ } ``` +### Possible error messages + +CSRF token is invalid +```json +{ + "data": [ + "This CSRF token has expired." + ], + "status": "csrfTokenExpired", +} +``` + +Email or password aren't correct +```json +{ + "data": [], + "status": "badLogin", +} +``` + ### Data returned ```js diff --git a/api/endpoints/bans.md b/api/endpoints/bans.md index 87e383a..09be176 100644 --- a/api/endpoints/bans.md +++ b/api/endpoints/bans.md @@ -25,6 +25,18 @@ with a requestError status. _GET_ +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/bans_add.md b/api/endpoints/bans_add.md index 0342e8b..b5a6d89 100644 --- a/api/endpoints/bans_add.md +++ b/api/endpoints/bans_add.md @@ -38,6 +38,56 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +Wrong userID +```json +{ + "data": [], + "status": "requestError", +} +``` + +Wrong duration time +```json +{ + "data": [ + "Not a valid ban duration" + ], + "status": "requestError", +} +``` + +Reason is missing +```json +{ + "data": [ + "reason is required" + ], + "status": "requestError", +} +``` + +userID is missing +```json +{ + "data": [ + "userID is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/booth.md b/api/endpoints/booth.md index 6086039..56c3913 100644 --- a/api/endpoints/booth.md +++ b/api/endpoints/booth.md @@ -10,6 +10,28 @@ The booth endpoint enables you to join (_POST_) or leave (_DELETE_) the waitlist _POST_, _DELETE_ +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +Not in a room +```json +{ + "data": [ + "not in a room." + ], + "status": "requestError", +} +``` + ### Data returned for both verbs ```js diff --git a/api/endpoints/booth_add.md b/api/endpoints/booth_add.md index 259d82d..9755128 100644 --- a/api/endpoints/booth_add.md +++ b/api/endpoints/booth_add.md @@ -22,6 +22,36 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +User isn't in the room +```json +{ + "data": [], + "status": "roomMismatch", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/booth_cycle.md b/api/endpoints/booth_cycle.md index 5b20ae4..fd3a7fb 100644 --- a/api/endpoints/booth_cycle.md +++ b/api/endpoints/booth_cycle.md @@ -22,6 +22,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +shouldCycle is missing +```json +{ + "data": [ + "shouldCycle is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/booth_lock.md b/api/endpoints/booth_lock.md index 5546cb5..b34b5b0 100644 --- a/api/endpoints/booth_lock.md +++ b/api/endpoints/booth_lock.md @@ -24,6 +24,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +isLocked or removeAllDJs is missing +```json +{ + "data": [ + "xxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/booth_move.md b/api/endpoints/booth_move.md index 0f6cf0e..4f63405 100644 --- a/api/endpoints/booth_move.md +++ b/api/endpoints/booth_move.md @@ -27,6 +27,36 @@ about it as **n-1** where **n** equals the **desired position** } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +User is not in the waitlist +```json +{ + "data": [], + "status": "userNotInBooth", +} +``` + +userID or position is missing +```json +{ + "data": [ + "xxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/booth_remove_id.md b/api/endpoints/booth_remove_id.md index 940d29c..b2a6ab2 100644 --- a/api/endpoints/booth_remove_id.md +++ b/api/endpoints/booth_remove_id.md @@ -12,6 +12,18 @@ The booth/remove/:id endpoint lets you remove a user from the waitlist. _DELETE_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/booth_skip.md b/api/endpoints/booth_skip.md index 4ff1a18..ef89e25 100644 --- a/api/endpoints/booth_skip.md +++ b/api/endpoints/booth_skip.md @@ -24,6 +24,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +userID or historyID is missing +```json +{ + "data": [ + "xxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/booth_skip_me.md b/api/endpoints/booth_skip_me.md index e9f206c..d5eb920 100644 --- a/api/endpoints/booth_skip_me.md +++ b/api/endpoints/booth_skip_me.md @@ -10,6 +10,18 @@ The booth/skip/me endpoint enables you to skip yourself as the DJ. _POST_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/friends.md b/api/endpoints/friends.md index 755c290..f0920c5 100644 --- a/api/endpoints/friends.md +++ b/api/endpoints/friends.md @@ -49,6 +49,28 @@ _GET_, _POST_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned for _POST_ ```js diff --git a/api/endpoints/friends_ignore.md b/api/endpoints/friends_ignore.md index 69b6b24..c14127a 100644 --- a/api/endpoints/friends_ignore.md +++ b/api/endpoints/friends_ignore.md @@ -20,6 +20,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/friends_invites.md b/api/endpoints/friends_invites.md index 32d1103..7ff83b5 100644 --- a/api/endpoints/friends_invites.md +++ b/api/endpoints/friends_invites.md @@ -10,6 +10,18 @@ The friends/invites endpoint will retrieve all of the friend invites you receive _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/grabs.md b/api/endpoints/grabs.md index 9f0df1e..eff91cf 100644 --- a/api/endpoints/grabs.md +++ b/api/endpoints/grabs.md @@ -22,6 +22,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +playlistID or historyID is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/ignores.md b/api/endpoints/ignores.md index 626702c..4a9a65c 100644 --- a/api/endpoints/ignores.md +++ b/api/endpoints/ignores.md @@ -34,6 +34,28 @@ _GET_, _POST_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned for _POST_ ```js diff --git a/api/endpoints/mutes.md b/api/endpoints/mutes.md index 04b5794..410cfb8 100644 --- a/api/endpoints/mutes.md +++ b/api/endpoints/mutes.md @@ -56,6 +56,28 @@ _GET_, _POST_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +userID or reason is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned for _POST_ ```js diff --git a/api/endpoints/playlists.md b/api/endpoints/playlists.md index 209e52a..64e79e2 100644 --- a/api/endpoints/playlists.md +++ b/api/endpoints/playlists.md @@ -11,6 +11,16 @@ The playlists endpoint retrieves or modifies your playlists. _GET_, _POST_, _DELETE_ +### Possible error messages + +Insufficient permissions +```json +{ + "data": [], + "status": "notAuthorized", +} +``` + ### Data returned for _GET_ ```js @@ -47,6 +57,28 @@ _GET_, _POST_, _DELETE_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +name or media is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned for _POST_ ```js diff --git a/api/endpoints/playlists_id_activate.md b/api/endpoints/playlists_id_activate.md index 8bfff9f..0f875bc 100644 --- a/api/endpoints/playlists_id_activate.md +++ b/api/endpoints/playlists_id_activate.md @@ -20,6 +20,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/playlists_id_media_delete.md b/api/endpoints/playlists_id_media_delete.md index 138521c..070eccf 100644 --- a/api/endpoints/playlists_id_media_delete.md +++ b/api/endpoints/playlists_id_media_delete.md @@ -22,6 +22,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +ids is missing +```json +{ + "data": [ + "ids is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/playlists_id_media_insert.md b/api/endpoints/playlists_id_media_insert.md index cf89925..b712067 100644 --- a/api/endpoints/playlists_id_media_insert.md +++ b/api/endpoints/playlists_id_media_insert.md @@ -30,6 +30,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +media or append is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/playlists_id_media_move.md b/api/endpoints/playlists_id_media_move.md index 161e07a..c473377 100644 --- a/api/endpoints/playlists_id_media_move.md +++ b/api/endpoints/playlists_id_media_move.md @@ -24,6 +24,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +ids or beforeID is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/playlists_id_media_update.md b/api/endpoints/playlists_id_media_update.md index 805c20a..a3c80a5 100644 --- a/api/endpoints/playlists_id_media_update.md +++ b/api/endpoints/playlists_id_media_update.md @@ -24,6 +24,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id, author or title is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/playlists_id_rename.md b/api/endpoints/playlists_id_rename.md index 0d90253..5bab355 100644 --- a/api/endpoints/playlists_id_rename.md +++ b/api/endpoints/playlists_id_rename.md @@ -20,6 +20,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +name is missing +```json +{ + "data": [ + "name is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/playlists_id_shuffle.md b/api/endpoints/playlists_id_shuffle.md index 3a9eddb..2b8c8cb 100644 --- a/api/endpoints/playlists_id_shuffle.md +++ b/api/endpoints/playlists_id_shuffle.md @@ -10,6 +10,18 @@ The playlists/:id/shuffle endpoint enables you to shuffle a playlist. _PUT_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/playlists_media.md b/api/endpoints/playlists_media.md index 89e7863..3eb14aa 100644 --- a/api/endpoints/playlists_media.md +++ b/api/endpoints/playlists_media.md @@ -10,6 +10,18 @@ The playlists/:id/media endpoint retrieves all media objects in one of your play _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/profile_blurb.md b/api/endpoints/profile_blurb.md index 4d77846..75375fc 100644 --- a/api/endpoints/profile_blurb.md +++ b/api/endpoints/profile_blurb.md @@ -20,6 +20,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +blurb is missing +```json +{ + "data": [ + "blurb is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/rooms.md b/api/endpoints/rooms.md index eaffa28..a84dd21 100644 --- a/api/endpoints/rooms.md +++ b/api/endpoints/rooms.md @@ -55,6 +55,28 @@ _GET_, _POST_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +name or private is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned for _POST_ ```js diff --git a/api/endpoints/rooms_favorites.md b/api/endpoints/rooms_favorites.md index 4428470..6d2bbe7 100644 --- a/api/endpoints/rooms_favorites.md +++ b/api/endpoints/rooms_favorites.md @@ -53,6 +53,28 @@ _GET_, _POST_, _DELETE_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned for _POST_ ```js diff --git a/api/endpoints/rooms_history.md b/api/endpoints/rooms_history.md index a655722..ce12486 100644 --- a/api/endpoints/rooms_history.md +++ b/api/endpoints/rooms_history.md @@ -10,6 +10,18 @@ The room history endpoint enables you to get the room's history. _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/rooms_join.md b/api/endpoints/rooms_join.md index 2a027aa..10d3a92 100644 --- a/api/endpoints/rooms_join.md +++ b/api/endpoints/rooms_join.md @@ -20,6 +20,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +slug is missing +```json +{ + "data": [ + "slug is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/rooms_me.md b/api/endpoints/rooms_me.md index 66dcf4b..0f82d94 100644 --- a/api/endpoints/rooms_me.md +++ b/api/endpoints/rooms_me.md @@ -13,6 +13,18 @@ population count. _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/rooms_state.md b/api/endpoints/rooms_state.md index 9456892..43eaa04 100644 --- a/api/endpoints/rooms_state.md +++ b/api/endpoints/rooms_state.md @@ -13,6 +13,28 @@ population count. _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +Still on dashboard +```json +{ + "data": [ + "not in a room." + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/rooms_update.md b/api/endpoints/rooms_update.md index cfd14db..08f8177 100644 --- a/api/endpoints/rooms_update.md +++ b/api/endpoints/rooms_update.md @@ -24,6 +24,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +name, description or welcome is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/rooms_validate.md b/api/endpoints/rooms_validate.md index 44fafcc..81ab8ce 100644 --- a/api/endpoints/rooms_validate.md +++ b/api/endpoints/rooms_validate.md @@ -14,6 +14,18 @@ _GET_ **name**: Name of the room +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/staff.md b/api/endpoints/staff.md index 2f3328e..16fe013 100644 --- a/api/endpoints/staff.md +++ b/api/endpoints/staff.md @@ -19,6 +19,18 @@ The staff endpoint requests all staff members of the room you are currently in. _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/staff_update.md b/api/endpoints/staff_update.md index dfcd8e9..704ef03 100644 --- a/api/endpoints/staff_update.md +++ b/api/endpoints/staff_update.md @@ -31,6 +31,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +userID or roleID is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/store_inventory.md b/api/endpoints/store_inventory.md index 3edb5a5..178858c 100644 --- a/api/endpoints/store_inventory.md +++ b/api/endpoints/store_inventory.md @@ -10,6 +10,18 @@ The store/inventory endpoint lists all of your boughts items. _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/store_products.md b/api/endpoints/store_products.md index 2b869d3..3abcc1a 100644 --- a/api/endpoints/store_products.md +++ b/api/endpoints/store_products.md @@ -18,6 +18,18 @@ _GET_ **type**: Same as the type member of the store item **category**: Same as the category member of the store item +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/store_purchase.md b/api/endpoints/store_purchase.md index 1f5b27f..04cda9f 100644 --- a/api/endpoints/store_purchase.md +++ b/api/endpoints/store_purchase.md @@ -20,6 +20,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/store_purchase_username.md b/api/endpoints/store_purchase_username.md index fc4a91d..1b0164a 100644 --- a/api/endpoints/store_purchase_username.md +++ b/api/endpoints/store_purchase_username.md @@ -21,6 +21,28 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id or username is missing +```json +{ + "data": [ + "xxxxxxxx is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/users.md b/api/endpoints/users.md index adbb0ad..088a066 100644 --- a/api/endpoints/users.md +++ b/api/endpoints/users.md @@ -14,6 +14,28 @@ _GET_ **id**: The ID of the user you want to check. +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/users_avatar.md b/api/endpoints/users_avatar.md index 06fd03f..5efd052 100644 --- a/api/endpoints/users_avatar.md +++ b/api/endpoints/users_avatar.md @@ -20,6 +20,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +id is missing +```json +{ + "data": [ + "id is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/users_bulk.md b/api/endpoints/users_bulk.md index 4f6e017..461b200 100644 --- a/api/endpoints/users_bulk.md +++ b/api/endpoints/users_bulk.md @@ -14,6 +14,38 @@ _POST_ **ids**: The IDs of the users you want to retrieve data of as an array +```json +{ + "ids": [ + -1, + -1, + -1 + ] +} +``` + +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +ids is missing +```json +{ + "data": [ + "ids is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/users_language.md b/api/endpoints/users_language.md index 9230309..9ce7896 100644 --- a/api/endpoints/users_language.md +++ b/api/endpoints/users_language.md @@ -20,6 +20,28 @@ _PUT_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +language is missing +```json +{ + "data": [ + "language is required" + ], + "status": "requestError", +} +``` + ### Data returned ```js diff --git a/api/endpoints/users_me.md b/api/endpoints/users_me.md index 84d4b08..80d57aa 100644 --- a/api/endpoints/users_me.md +++ b/api/endpoints/users_me.md @@ -10,6 +10,18 @@ The users/me endpoint retrieves some data about yourself as well as notification _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/users_me_history.md b/api/endpoints/users_me_history.md index 7c753ec..f6a3522 100644 --- a/api/endpoints/users_me_history.md +++ b/api/endpoints/users_me_history.md @@ -10,6 +10,18 @@ The users/me/history endpoint retrieves a sorted list of songs you have played i _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/users_me_transactions.md b/api/endpoints/users_me_transactions.md index 9b1e368..9f95fb3 100644 --- a/api/endpoints/users_me_transactions.md +++ b/api/endpoints/users_me_transactions.md @@ -10,6 +10,18 @@ The users/me/transactions endpoint retrieves the full list of your transactions _GET_ +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js diff --git a/api/endpoints/votes.md b/api/endpoints/votes.md index d65452f..20b0558 100644 --- a/api/endpoints/votes.md +++ b/api/endpoints/votes.md @@ -22,6 +22,18 @@ _POST_ } ``` +### Possible error messages + +Insufficient permissions (not being logged in) +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + ### Data returned ```js From f299bdb7ef3de0610cf1a90ab768d630fda44702 Mon Sep 17 00:00:00 2001 From: SooYou Date: Fri, 17 Jul 2015 17:15:57 +0200 Subject: [PATCH 9/9] fixed missing commas; added rooms_sos; added more error messages --- api/endpoints/auth_facebook.md | 6 ++-- api/endpoints/auth_login.md | 4 +-- api/endpoints/bans_add.md | 14 ++------- api/endpoints/rooms_sos.md | 56 +++++++++++++++++++++++++++++++++ api/endpoints/store_purchase.md | 20 ++++++++++++ 5 files changed, 83 insertions(+), 17 deletions(-) create mode 100644 api/endpoints/rooms_sos.md diff --git a/api/endpoints/auth_facebook.md b/api/endpoints/auth_facebook.md index eb65ba1..e67e378 100644 --- a/api/endpoints/auth_facebook.md +++ b/api/endpoints/auth_facebook.md @@ -20,9 +20,9 @@ _POST_ ```json { - "csrf": "xxxxx" - "accessToken": "xxx" - "userID": "xxx" + "csrf": "xxxxx", + "accessToken": "xxx", + "userID": "xxx" } ``` diff --git a/api/endpoints/auth_login.md b/api/endpoints/auth_login.md index a0d268d..c8da34c 100644 --- a/api/endpoints/auth_login.md +++ b/api/endpoints/auth_login.md @@ -18,8 +18,8 @@ _POST_ ```json { - "csrf": "xxxxx" - "email": "xxx@xxx.com" + "csrf": "xxxxx", + "email": "xxx@xxx.com", "password": "xxx" } ``` diff --git a/api/endpoints/bans_add.md b/api/endpoints/bans_add.md index b5a6d89..1057321 100644 --- a/api/endpoints/bans_add.md +++ b/api/endpoints/bans_add.md @@ -68,21 +68,11 @@ Wrong duration time } ``` -Reason is missing +reason or userID is missing ```json { "data": [ - "reason is required" - ], - "status": "requestError", -} -``` - -userID is missing -```json -{ - "data": [ - "userID is required" + "xxxxxxxx is required" ], "status": "requestError", } diff --git a/api/endpoints/rooms_sos.md b/api/endpoints/rooms_sos.md new file mode 100644 index 0000000..984c32f --- /dev/null +++ b/api/endpoints/rooms_sos.md @@ -0,0 +1,56 @@ +# rooms/sos Endpoint + +The rooms/sos endpoint enables you to send an emergency ticket to the plug staff. + +**Note**: You need to have sufficient permissions in a room to do this + +### Endpoint + +**rooms/sos** + +### available verbs + +_POST_ + +### Parameters + +**message**: Your emergency message + +```json +{ + "message": "xxxxx" +} +``` + +### Possible error messages + +Insufficient permissions +```json +{ + "data": [ + "You are not authorized to access this resource." + ], + "status": "notAuthorized", +} +``` + +message is missing +```json +{ + "data": [ + "message is required" + ], + "status": "requestError", +} +``` + +### Data returned + +```js +{ + 'data': [], + 'meta': {}, + 'status': 'ok', + 'time': 'xx.xxxxxxxxxxx' +} +``` \ No newline at end of file diff --git a/api/endpoints/store_purchase.md b/api/endpoints/store_purchase.md index 04cda9f..0606340 100644 --- a/api/endpoints/store_purchase.md +++ b/api/endpoints/store_purchase.md @@ -42,6 +42,26 @@ id is missing } ``` +Not enough plug points +```json +{ + "data": [ + "fundsPP" + ], + "status": "requestError", +} +``` + +Not a store item +```json +{ + "data": [ + "listing" + ], + "status": "requestError", +} +``` + ### Data returned ```js