├── .gitattributes ├── README.md ├── data-structures ├── Comment.apib ├── Profile.apib ├── RantFeed.apib ├── RantInFeed.apib └── Rant.apib ├── .github └── workflows │ └── main.yml ├── devrant.apib └── reference ├── search.apib ├── weeklys.apib ├── user_interaction.apib ├── auth_and_user.apib └── rants.apib /.gitattributes: -------------------------------------------------------------------------------- 1 | *.* text eol=lf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # devRant API Docs 2 | 3 | ![Build and Deploy](https://github.com/devRant-Community/API-Docs/workflows/Build%20and%20Deploy/badge.svg) 4 | 5 | The unofficial devRant API documentation 6 | 7 | [OPEN DOCUMENTATION](https://devrantapi.docs.apiary.io) 8 | 9 | ### Feel free to contribute! 10 | -------------------------------------------------------------------------------- /data-structures/Comment.apib: -------------------------------------------------------------------------------- 1 | ## Comment (object) 2 | + id: 2639015 (number) 3 | + rand_id: 10123 (number) 4 | + body: `This rant sucks!` (string) 5 | + score: 10 (number) 6 | + created_time: 1591901533 (number) 7 | + vote_state: 0 (enum[number]) 8 | + Members 9 | + 1 - Upvoted 10 | + `-1` - Downvoted 11 | + 0 - Unvoted 12 | + `-2` - No vote allowed 13 | + user_id: 5125 (number) 14 | + user_username: `User2` (string) 15 | + user_score: 10000 (number) 16 | + user_avatar (object) 17 | + b: `2a8b9d` (string) - Avatar background color 18 | + i: `v-37_c-3_b-6_g-m_9-1_16_16-4_3-13_8-1_7-1_5-1_12-6_17-2_6-2_10-5_2-26_22-2_15-10_11-3_18-2_19-1_4-1.jpg` (string) - Avatar filename -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy 2 | on: 3 | push: 4 | branches: 5 | - source 6 | 7 | jobs: 8 | build-and-deploy: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout 🛎️ 12 | uses: actions/checkout@v2 13 | with: 14 | persist-credentials: false 15 | 16 | - name: Setup 🔧 17 | uses: actions/setup-node@v1.4.4 18 | - name: Install ♻ 19 | run: npm install -g hercule 20 | - name: Build 🏗 21 | run: mkdir dist && hercule devrant.apib -o ./dist/apiary.apib 22 | - name: Deploy 🚀 23 | uses: JamesIves/github-pages-deploy-action@3.5.3 24 | with: 25 | ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} 26 | BRANCH: master 27 | FOLDER: dist 28 | GIT_CONFIG_NAME: SkayoBot 29 | GIT_CONFIG_EMAIL: frederike.gnampf@gmail.com 30 | -------------------------------------------------------------------------------- /devrant.apib: -------------------------------------------------------------------------------- 1 | FORMAT: 1A 2 | HOST: https://devrant.com/api 3 | 4 | # devRant API 5 | Welcome to the unofficial devRant API Documentation! 6 | Here you will find documentation for all known endpoints 7 | 8 | **Note:**
9 | All *POST* requests are done with header application/x-form-urlencoded, API blueprint does not support *POST* request documentation yet 10 | 11 | ***POST requests will not work in playground*** 12 | 13 | Documentation was written by [@Skayo](https://github.com/Skayo) and [@frogstair](https://github.com/frogstair) 14 | 15 | Find an awesome-list [here](https://github.com/devRant-Community/awesome-devrant) 16 | 17 | 18 | :[Rants](reference/rants.apib) 19 | 20 | :[Authentication and user](reference/auth_and_user.apib) 21 | 22 | :[Search](reference/search.apib) 23 | 24 | :[Weeklys](reference/weeklys.apib) 25 | 26 | :[User interaction](reference/user_interaction.apib) 27 | 28 | 29 | # Data Structures 30 | 31 | :[Rant](data-structures/Rant.apib) 32 | 33 | :[RantFeed](data-structures/RantFeed.apib) 34 | 35 | :[RantInFeed](data-structures/RantInFeed.apib) 36 | 37 | :[Comment](data-structures/Comment.apib) 38 | 39 | :[Profile](data-structures/Profile.apib) -------------------------------------------------------------------------------- /data-structures/Profile.apib: -------------------------------------------------------------------------------- 1 | ## Profile (object) 2 | + username: `User1` (string) 3 | + score: 1234 (number) 4 | + about: `Bla bla I'm a dev.` (string) 5 | + location: `Idk` (string) 6 | + created_time: 1514824661 (number) - Time the user joined devRant 7 | + skills: `No skills :/` (string) 8 | + github: `User1` (string) 9 | + website: `www.user1.com` (string) 10 | + content (object) 11 | + rants (array[RantInFeed]) - User's rants 12 | + upvoted (array[RantInFeed]) - User's upvoted rants 13 | + comments (array[Comment]) - User's comments 14 | + favorites (array[RantInFeed]) - User's favorited rants 15 | + counts (object) 16 | + rants: 12 (number) 17 | + upvoted: 123 (number) 18 | + comments: 12 (number) 19 | + favorites: 1 (number) 20 | + collabs: 2 (number) 21 | + avatar (object) 22 | + b: `2a8b9d` (string) - Avatar background color 23 | + i: `v-18_c-1_b-4_g-m_9-1_1-1_16-7_3-1_8-1_7-1_5-1_12-1_6-16_10-6_2-27_11-3_18-2_4-1_19-1.png` (string) - Avatar file name 24 | + avatar_sm (object) 25 | + b: `2a8b9d` (string) - Avatar background color 26 | + i: `v-18_c-3_b-4_g-m_9-1_1-1_16-7_3-1_8-1_7-1_5-1_12-1_6-16_10-6_2-27_11-3_18-2_4-1_19-1.jpg` (string) - Avatar file name 27 | + dpp: 0 (number) - Numeric bool indicator if the user is a devRant++ member or not -------------------------------------------------------------------------------- /data-structures/RantFeed.apib: -------------------------------------------------------------------------------- 1 | ## RantFeed (object) 2 | + success: true (boolean) - Whether the request was successful 3 | + rants (array[RantInFeed]) 4 | + settings (object) - Empty array when not authenticated 5 | + notif_state: `1` (string) - Whether notifications are available 6 | + notif_token (string) 7 | + set: `5ee254ee76f3e` (string) - Session hash 8 | + wrw: 212 (number) - Weekly-Rant Week 9 | + dpp: 0 (number) - 1 if devRant++, 0 if not devRant++, not set when not authenticated 10 | + num_notifs: 0 (number) - Not set when not authenticated 11 | + unread (object) - Not set when not authenticated 12 | + total: 0 (number) - Same as num_notifs 13 | + news (object) 14 | + id: 321 (number) 15 | + type: `intlink` (string) - Internal Link (intlink) most of the time, not sure what other values are possible 16 | + headline: `Weekly Group Rant` (string) 17 | + body: `Story of screenshare gone wrong?` (string) 18 | + footer: `Add tag 'wk212' to your rant` (string) 19 | + height: 200 (number) 20 | + action: `grouprant` (enum[string]) 21 | What to do when clicked 22 | + Members 23 | + `grouprant` - Go to group rants section 24 | + `none` - Do nothing 25 | + `rant` - Go to a rant (Not confirmed if actually exists!) -------------------------------------------------------------------------------- /data-structures/RantInFeed.apib: -------------------------------------------------------------------------------- 1 | ## RantInFeed (object) 2 | + id: 20123 (number) 3 | + text: `Bla bla some long rant text with emojis and \n's` (string) 4 | + score: 123 (number) 5 | + created_time: 1518160633 (number) - When the rant was created 6 | + attached_image (object) - Empty string if there is no image 7 | + url: `https://img.devrant.com/devrant/rant/imageName.jpg` (string) 8 | + width: 753 (number) 9 | + height: 546 (number) 10 | + num_comments: 12 (number) 11 | + tags (array[string]) - List of tags. First tag is post type (rant, undefined, joke/meme, question, devRant, random, collab) 12 | + vote_state: 0 (enum[number]) 13 | + Members 14 | + 1 - Upvoted 15 | + `-1` - Downvoted 16 | + 0 - Unvoted 17 | + `-2` - No vote allowed 18 | + edited: false (boolean) 19 | + link: `rants/10123/some-strange-text-for-seo` (string) - Link to rant for social share etc 20 | + rt: 1 (number) - No clue what this is 21 | + rc: 1 (number) - No clue what this is 22 | + c_type: 2 (enum[number]) 23 | Only if collab. 24 | + Members 25 | + 1 - Open source idea 26 | + 2 - Existing open source project 27 | + 3 - Project idea 28 | + 4 - Existing project 29 | + c_type_long: `Existing open source project` (string) - Only if collab. Collab type as string (see above) 30 | + user_id: 12301 (number) 31 | + user_username: `User1` (string) 32 | + user_score: 1234 (number) 33 | + user_avatar (object) 34 | + b: `2a8b9d` (string) - Avatar background color 35 | + i: `v-18_c-3_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.jpg` (string) - Avatar filename 36 | + user_avatar_lg (object) 37 | + b: `2a8b9d` (string) - Avatar background color 38 | + i: `v-18_c-1_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.png` (string) - Avatar filename 39 | + user_dpp: 1 (number) - 1 if user is devRant++, 0 if not devRant++ -------------------------------------------------------------------------------- /data-structures/Rant.apib: -------------------------------------------------------------------------------- 1 | ## Rant (object) 2 | + id: 20123 (number) 3 | + text: `Bla bla some long rant text with emojis and \n's` (string) 4 | + score: 123 (number) 5 | + created_time: 1518160633 (number) - When the rant was created 6 | + attached_image (object) - Empty string if there is no image 7 | + url: `https://img.devrant.com/devrant/rant/imageName.jpg` (string) 8 | + width: 753 (number) 9 | + height: 546 (number) 10 | + num_comments: 12 (number) 11 | + tags (array[string]) 12 | + vote_state: 0 (enum[number]) 13 | + Members 14 | + 1 - Upvoted 15 | + `-1` - Downvoted 16 | + 0 - Unvoted 17 | + `-2` - No vote allowed 18 | + edited: false (boolean) 19 | + link: `rants/10123/some-strange-text-for-seo` (string) - Link to rant for social share etc. First part can be "rants" or "collabs" 20 | + rt: 1 (number) - No clue what this is 21 | + rc: 1 (number) - No clue what this is 22 | + links (array) 23 | + (object) 24 | + type: `url` (string) - Only urls are allowed in rants themselves so this should always be url 25 | + url: `https://github.com/User1/SomeRepo` (string) 26 | + short_url: `https://github.com/User...` (string) - Truncated url 27 | + title: `https://github.com/User...` (string) 28 | + start: 278 (number) - Starting position of the link 29 | + end: 313 (number) - Ending position of the link 30 | + special: 1 (number) - No clue what this is 31 | + special: 1 (number) - No clue what this is 32 | + c_type_long: `Existing open source project` (string) - Only if collab. 33 | + c_description: `Jungla is an alternative to GraphQL. Bla bla bla help pls` (string) - Only if collab. 34 | + c_tech_stack: `NodeJS` (string) - Only if collab. 35 | + c_team_size: `2` (string) - Only if collab. 36 | + c_url: `https://github.com/crazywolf132/Jungla` (string) - Only if collab. 37 | + user_id: 12301 (number) 38 | + user_username: `User1` (string) 39 | + user_score: 1234 (number) 40 | + user_avatar (object) 41 | + b: `2a8b9d` (string) - Avatar background color 42 | + i: `v-18_c-3_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.jpg` (string) - Avatar filename 43 | + user_avatar_lg (object) 44 | + b: `2a8b9d` (string) - Avatar background color 45 | + i: `v-18_c-1_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.png` (string) - Avatar filename 46 | + user_dpp: 1 (number) - 1 if user is devRant++, 0 if not devRant++ -------------------------------------------------------------------------------- /reference/search.apib: -------------------------------------------------------------------------------- 1 | # Search [/devrant/search] 2 | 3 | ## Search rants [GET /devrant/search{?app,term}] 4 | 5 | + Parameters 6 | + app: 3 (required, number) - App ID parameter 7 | + term: `find me this` (required, string) - Search term 8 | 9 | + Response 200 (application/json) 10 | + Attributes (object) 11 | + success: true (boolean) 12 | + results (array[RantInFeed]) 13 | 14 | + Body 15 | ```js 16 | { 17 | "success": true, 18 | "results": [ 19 | { 20 | "id": 30123, 21 | "text": "Find me this thing on google please", 22 | "score": 123, 23 | "created_time": 1487173080, // When the rant was created 24 | "attached_image": { // Empty string if there is no image 25 | "url": "https://img.devrant.com/devrant/rant/imageName.jpg", 26 | "width": 753, 27 | "height": 546 28 | }, 29 | "num_comments": 12, 30 | "tags": [ 31 | "fuck", 32 | "penis" 33 | ], 34 | "vote_state": 0, // As far as I know: 1=upvoted, -1=downvoted, 0=unvoted, -2=no vote 35 | "edited": true, 36 | "rt": 1, // No clue what this is 37 | "rc": 1, // No clue what this is 38 | "user_id": 12301, 39 | "user_username": "User1", 40 | "user_score": 1234, 41 | "user_avatar": { 42 | "b": "69c9cd", 43 | "i": "v-18_c-3_b-6_g-m_9-1_1-2_16-10_3-11_8-1_7-1_5-4_12-2_6-11_10-5_2-14_18-1_4-4_19-2_20-9.jpg" 44 | }, 45 | "user_avatar_lg": { 46 | "b": "69c9cd", 47 | "i": "v-18_c-1_b-6_g-m_9-1_1-2_16-10_3-11_8-1_7-1_5-4_12-2_6-11_10-5_2-14_18-1_4-4_19-2_20-9.png" 48 | }, 49 | // ... 50 | } 51 | ] 52 | } 53 | ``` 54 | 55 | ## Get list of most used tags [GET /devrant/search/tags{?app}] 56 | 57 | + Parameters 58 | + app: 3 (required, number) - App ID parameter 59 | 60 | + Response 200 (application/json) 61 | + Attributes (object) 62 | + success: true (boolean) 63 | + tags (array[string]) 64 | 65 | + Body 66 | ```js 67 | { 68 | "success":true, 69 | "tags":[ 70 | "rant", 71 | "linux", 72 | "devrant", 73 | "java", 74 | "javascript", 75 | "windows", 76 | "android", 77 | "js", 78 | "fml", 79 | "programming", 80 | "php", 81 | "python", 82 | "code", 83 | "git", 84 | "joke", 85 | "wtf", 86 | "google", 87 | "github", 88 | "css", 89 | "funny" 90 | ] 91 | } 92 | ``` -------------------------------------------------------------------------------- /reference/weeklys.apib: -------------------------------------------------------------------------------- 1 | # Weeklys [/devrant/] 2 | 3 | ## Get weekly list [GET /devrant/weekly-list{?app}] 4 | 5 | + Parameters 6 | + app: 3 (required, number) - App ID parameter 7 | 8 | + Response 200 (application/json) 9 | + Attributes (object) 10 | + success: true (boolean) 11 | + weeks (array) 12 | + (object) 13 | + week: 212 (number) 14 | + prompt: `Story of screenshare gone wrong?` (string) 15 | + date: `6/8/20` (string) - Date in format "d/m/yy" 16 | + num_rants: 16 (number) 17 | 18 | + Body 19 | ```js 20 | { 21 | "success":true, 22 | "weeks":[ 23 | { 24 | "week":212, 25 | "prompt":"Story of screenshare gone wrong?", 26 | "date":"6\/8\/20", 27 | "num_rants":16 28 | }, 29 | { 30 | "week":211, 31 | "prompt":"How you'll know you \"made it\" as a dev?", 32 | "date":"6\/1\/20", 33 | "num_rants":34 34 | } 35 | ] 36 | } 37 | ``` 38 | 39 | ## Get weekly list rants [GET /devrant/weekly-rants{?app,week,sort,limit,skip}] 40 | 41 | + Parameters 42 | + app: 3 (required, number) - App ID parameter 43 | + sort: `top` (optional, enum[string]) 44 | Sort rants 45 | + Members 46 | + `algo` 47 | + `top` 48 | + `recent` 49 | + limit: 20 (optional, number) - Limit the amount of rants to load. Used for pagination/infinite scroll. Maximum is 50, if more defaults to 20 50 | + skip: 0 (optional, number) - How many rants to skip before loading. Used for pagination/infinite scroll 51 | 52 | + Response 200 (application/json) 53 | + Attribute (RantFeed) 54 | 55 | + Body 56 | ```js 57 | { 58 | "success": true, 59 | "rants": [ 60 | { 61 | "id": 30123, 62 | "text": "Got rejected because of dickpick. Oops.", 63 | "score": 123, 64 | "created_time": 1518160644, // When the rant was created 65 | "attached_image": { // Empty string if there is no image 66 | "url": "https://img.devrant.com/devrant/rant/imageName.jpg", 67 | "width": 753, 68 | "height": 546 69 | }, 70 | "num_comments": 12, 71 | "tags": [ 72 | "wk90" 73 | ], 74 | "vote_state": 0, // As far as I know: 1=upvoted, -1=downvoted, 0=unvoted, -2=no vote 75 | "edited": false, 76 | "rt": 1, // No clue what this is 77 | "rc": 1, // No clue what this is 78 | "user_id": 12301, 79 | "user_username": "User1", 80 | "user_score": 1234, 81 | "user_avatar": { 82 | "b": "2a8b9d", 83 | "i": "v-18_c-3_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.jpg" 84 | }, 85 | "user_avatar_lg": { 86 | "b": "2a8b9d", 87 | "i": "v-18_c-1_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.png" 88 | }, 89 | "user_dpp": 1 // Bool indicator if the user is a devRant++ Member or not 90 | } 91 | ], 92 | "settings": [], // Not sure what this contains 93 | "wrw": 90, // Weekly-Rant Week 94 | "news": { 95 | "id": 123, 96 | "type": "weekly", // Not sure (Maybe if it's an announcement rant or the weekly rant topic) 97 | "headline": "Worst interview rejection?", 98 | "footer": "Week 90 Group Rant - Add tag 'wk90' to your rant", 99 | "height": 65, 100 | "action": "none" // Not sure (What to do when clicked) 101 | } 102 | } 103 | ``` -------------------------------------------------------------------------------- /reference/user_interaction.apib: -------------------------------------------------------------------------------- 1 | # User interaction [/devrant] 2 | 3 | ## Get user notifications [GET /users/me/notif-feed{?app,token_id,token_key,user_id}] 4 | 5 | + Parameters 6 | + app: 3 (required, number) - App ID parameter 7 | + token_id (required, number) - Token ID of the user. Used for authentication 8 | + token_key (required, string) - Token key of the user. Used for authentication 9 | + user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication 10 | 11 | + Response 200 (application/json) 12 | + Attributes (object) 13 | + success: true (boolean) 14 | + data (object) 15 | + items (array) - 100 items in total 16 | + (object) 17 | + created_time: 1591546309 (number) 18 | + type: `content_vote` (enum[string]) 19 | Type of notif 20 | + Members 21 | + `comment_vote` 22 | + `comment_content` 23 | + `comment_mention` 24 | + `comment_discuss` 25 | + `content_vote` 26 | + `rant_sub` 27 | + read: 0 (number) - 0 = unread, 1 = read 28 | + rant_id: 2619313 (number) 29 | + uid: 2451362 (number) - ID of the user that "fired" the notif 30 | + check_time: 1591546309 (number) 31 | + username_map (object) - Object with key-value pairs where key is notif ID and value is username 32 | + unread (object) 33 | + all: 1 (number) 34 | + upvotes: 1 (number) 35 | + mentions: 0 (number) 36 | + comments: 0 (number) 37 | + subs: 0 (number) 38 | + total: 1 (number) - Same as all 39 | 40 | + Body 41 | ```js 42 | { 43 | "success": true 44 | "data": { 45 | "items": [ 46 | { 47 | "created_time":1591546309, 48 | "type":"content_vote", //Type of ++ (form x_y where x is content/comment and y is vote/discuss) 49 | "read":0, //0 = unread, 1 = read 50 | "rant_id":2619313, 51 | "uid":2451362, 52 | }, 53 | //There is going to be 100 total 54 | ] 55 | "check_time":1591546309 56 | "username_map": { 57 | "2451362":'"frogstair", // "notif id": "username" 58 | // ... 59 | }, 60 | "unread": { 61 | "all": 1, 62 | "upvotes": 1, 63 | "mentions": 0, 64 | "comments": 0, 65 | "subs": 0, 66 | "total": 1 //Same as all 67 | } 68 | } 69 | } 70 | ``` 71 | 72 | ## Post a rant [POST /devrant/rants{?app,rant,type,token_id,token_key,user_id}] 73 | 74 | + Parameters 75 | + app: 3 (required, number) - App ID Parameters 76 | + rant: `Bla bla bla fuck my life` (required, string) - Text in the rant 77 | + type: 3 (required, enum[number]) 78 | Type of rant 79 | + Members 80 | + 1 - Rant 81 | + 2 - Undefined 82 | + 3 - Joke/Meme 83 | + 4 - Question 84 | + 5 - devRant 85 | + 6 - Random 86 | + token_id (required, number) - Token ID of the user. Used for authentication 87 | + token_key (required, string) - Token key of the user. Used for authentication 88 | + user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication 89 | 90 | + Request (application/x-form-urlencoded) 91 | 92 | + Response 200 (application/json) 93 | + Attributes (object) 94 | + success: true (boolean) 95 | + rant_id: 2619313 (number) 96 | 97 | + Body 98 | ```js 99 | { 100 | "success": true, 101 | "rant_id": 2619313 102 | } 103 | ``` 104 | 105 | ## Post a comment [POST /devrant/rants/{id}/comments{?app,comment,token_id,token_key,user_id}] 106 | 107 | + Parameters 108 | + app: 3 (required, number) - App ID Parameters 109 | + comment: `This rant sucks!` (required, string) - Comment text 110 | + token_id (required, number) - Token ID of the user. Used for authentication 111 | + token_key (required, string) - Token key of the user. Used for authentication 112 | + user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication 113 | 114 | + Response 200 (application/json) 115 | + Attributes (object) 116 | + success: true (boolean) 117 | 118 | + Body 119 | ```js 120 | { 121 | "success": true 122 | } 123 | ``` 124 | 125 | ## Delete a rant [DELETE /devrant/rants/{id}{?app,token_id,token_key,user_id}] 126 | 127 | + Parameters 128 | + id (required, number) - ID of the rant to delete 129 | + app: 3 (required, number) - App ID Parameters 130 | + token_id (required, number) - Token ID of the user. Used for authentication 131 | + token_key (required, string) - Token key of the user. Used for authentication 132 | + user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication 133 | 134 | + Response 200 (application/json) 135 | + Attributes (object) 136 | + success: true (boolean) 137 | 138 | + Body 139 | ```js 140 | { 141 | "success": true 142 | } 143 | ``` 144 | 145 | ## Delete a comment [DELETE /devrant/comments/{id}{?app,token_id,token_key,user_id}] 146 | 147 | + Parameters 148 | + id (required, number) - ID of the comment to delete 149 | + app: 3 (required, number) - App ID Parameters 150 | + token_id (required, number) - Token ID of the user. Used for authentication 151 | + token_key (required, string) - Token key of the user. Used for authentication 152 | + user_id (required, number) - ID of the user on whose behalf the action is done. Used for authentication 153 | 154 | + Response 200 (application/json) 155 | + Attributes (object) 156 | + success: true (boolean) 157 | 158 | + Body 159 | ```js 160 | { 161 | "success": true 162 | } 163 | ``` -------------------------------------------------------------------------------- /reference/auth_and_user.apib: -------------------------------------------------------------------------------- 1 | # Authentication and user [/users/] 2 | 3 | ## Get access keys [POST /users/auth-token{?app,username,password}] 4 | 5 | + Parameters 6 | + app: 3 (required, number) - App ID parameter 7 | + username (required, string) - Username to login with 8 | + password (required, string) - Password to login with 9 | 10 | + Request (application/x-form-urlencoded) 11 | 12 | + Response 200 (application/json) 13 | + Attributes (object) 14 | + success: `true` (boolean) 15 | + auth_token (object) 16 | + id: 6712386 (number) 17 | + key: `tD5qeCHb6qvvfU4dLpFEWPL7YDNjA4hz7caGLW7M` (string) 18 | + expire_time: 6712386 (number) 19 | + user_id: 1085040 (number) 20 | 21 | + Body 22 | ```js 23 | { 24 | "success": true, 25 | "auth_token": { 26 | "id": 6712386, 27 | "key": "tD5qeCHb6qvvfU4dLpFEWPL7YDNjA4hz7caGLW7M", 28 | "expire_time": 6712386, 29 | "user_id": 1085040 30 | } 31 | } 32 | ``` 33 | 34 | + Response 400 (application/json) 35 | + Attributes (object) 36 | + success: `true` (boolean) 37 | + error: `Invalid login credentials entered. Please try again.` (string) 38 | 39 | + Body 40 | ```js 41 | { 42 | "success": false, 43 | "error": "Invalid login credentials entered. Please try again." 44 | } 45 | ``` 46 | 47 | ## Get user information [GET /users/{id}{?app,skip,content}] 48 | 49 | + Parameters 50 | + id (required, number) - User ID 51 | + app: 3 (required, number) - App ID parameter 52 | + skip: 0 (optional, number) - Amount of content to skip 53 | + content: `all` (optional, enum[string]) 54 | Which type of content to load 55 | + Members 56 | + `all` 57 | + `rants` 58 | + `upvoted` 59 | + `comments` 60 | + `favorites` 61 | + `collabs` 62 | 63 | + Response 200 (application/json) 64 | + Attributes (object) 65 | + success: true (boolean) 66 | + profile (Profile) 67 | 68 | + Body 69 | ```js 70 | { 71 | "success": true, 72 | "profile": { 73 | "username": "User1", 74 | "score": 1234, 75 | "about": "Bla bla I'm a dev.", 76 | "location": "Idk", 77 | "created_time": 1514824661, // Time the user joined devRant 78 | "skills": "No skills :/", 79 | "github": "User1", 80 | "website": "www.user1.com", 81 | "content": { 82 | "content": { 83 | "rants": [ 84 | // Rants ... 85 | ], 86 | "upvoted": [ 87 | // Upvoted Rants... 88 | ], 89 | "comments": [ 90 | // Comments... 91 | ], 92 | "favorites": [ 93 | // Favorited Rants... 94 | ] 95 | }, 96 | "counts": { 97 | "rants": 12, 98 | "upvoted": 123, 99 | "comments": 12, 100 | "favorites": 1, 101 | "collabs": 2 102 | } 103 | }, 104 | "avatar": { 105 | "b": "2a8b9d", 106 | "i": "v-18_c-1_b-4_g-m_9-1_1-1_16-7_3-1_8-1_7-1_5-1_12-1_6-16_10-6_2-27_11-3_18-2_4-1_19-1.png" 107 | }, 108 | "avatar_sm": { 109 | "b": "2a8b9d", 110 | "i": "v-18_c-3_b-4_g-m_9-1_1-1_16-7_3-1_8-1_7-1_5-1_12-1_6-16_10-6_2-27_11-3_18-2_4-1_19-1.jpg" 111 | }, 112 | "dpp": 0 // Bool indicator if the user is a devRant++ Member or not 113 | } 114 | } 115 | ``` 116 | 117 | ## Get user ID [GET /get-user-id{?app,username}] 118 | 119 | + Parameters 120 | + app: 3 (required, number) - App ID parameter 121 | + username (required, string) - User username 122 | 123 | + Response 200 (application/json) 124 | + Attributes (object) 125 | + success: true (boolean) 126 | + user_id: 12301 (number) 127 | 128 | + Body 129 | ```js 130 | { 131 | "success": true, 132 | "user_id": 12301 133 | } 134 | ``` 135 | 136 | ## Get list of supporters [GET /devrant/supporters{?app}] 137 | 138 | + Parameters 139 | + app: 3 (required, number) - App ID parameter 140 | 141 | + Response 200 (application/json) 142 | + Attributes (object) 143 | + items (array) 144 | + (object) 145 | + user (object) 146 | + id: 12301 (number) 147 | + name: `User1` 148 | + avatar (object) 149 | + b: `2a8b9d` (string) - Avatar background color 150 | + i: `v-18_c-1_b-4_g-m_9-1_1-1_16-7_3-1_8-1_7-1_5-1_12-1_6-16_10-6_2-27_11-3_18-2_4-1_19-1.png` (string) - Avatar file name 151 | + start: 1496914102 (number) - Timestamp when the user joined devRant++ 152 | 153 | + Body 154 | ```js 155 | { 156 | "items": [ 157 | { 158 | "user": { 159 | "id": 12301, 160 | "name": "User1", 161 | "avatar": { 162 | "b": "2a8b9d", 163 | "i": "v-18_c-3_b-4_g-m_9-1_1-1_16-6_3-1_8-1_7-1_5-1_12-1_6-4_10-1_2-10_4-1.jpg" 164 | } 165 | }, 166 | "start": 1496914102 // Time since the user is a member 167 | }, 168 | { 169 | "user": { 170 | "id": 12302, 171 | "name": "User2", 172 | "avatar": { 173 | "b": "d55161", 174 | "i": "v-18_c-3_b-5_g-m_9-1_1-2_16-6_3-2_8-2_7-2_5-4_12-2_6-3_2-76_11-4_18-4_4-4_19-3_20-10_21-1.jpg" 175 | } 176 | }, 177 | "start": 1496924123 // Time since the user is a member 178 | }, 179 | // ... 180 | ] 181 | } 182 | ``` -------------------------------------------------------------------------------- /reference/rants.apib: -------------------------------------------------------------------------------- 1 | # Rants [/devrant/rants] 2 | 3 | ## Get rant feed [GET /devrant/rants{?app,limit,sort,range,skip,token_id,token_key,user_id}] 4 | If provided with keys it will get rants tailored to user 5 | 6 | + Parameters 7 | + app: 3 (required, number) - App ID parameter 8 | + sort: `top` (optional, enum[string]) 9 | Sort rants 10 | + Members 11 | + `algo` 12 | + `top` 13 | + `recent` 14 | + range: `all` (optional, enum[string]) 15 | Time range of the rants to load 16 | + Members 17 | + `day` 18 | + `week` 19 | + `month` 20 | + `all` 21 | + limit: 20 (optional, number) - Limit the amount of rants to load. Used for pagination/infinite scroll. Maximum is 50, if more defaults to 20 22 | + skip: 0 (optional, number) - How many rants to skip before loading. Used for pagination/infinite scroll 23 | + token_id (optional, number) - Token ID of the user. Used for authentication 24 | + token_key (optional, string) - Token key of the user. Used for authentication 25 | + user_id (optional, number) - ID of the user on whose behalf the action is done. Used for authentication 26 | 27 | + Response 200 (application/json) 28 | + Attributes (RantFeed) 29 | 30 | + Body 31 | ```js 32 | { 33 | "success": true, 34 | "rants": [ 35 | { 36 | "id": 20123, 37 | "text": "Bla bla some long rant text with emojis and \n's", 38 | "score": 123, 39 | "created_time": 1518160633, // When the rant was created 40 | "attached_image": { // Empty string if there is no image 41 | "url": "https://img.devrant.com/devrant/rant/imageName.jpg", 42 | "width": 753, 43 | "height": 546 44 | }, 45 | "num_comments": 12, 46 | "tags": [ 47 | "some-tag" 48 | ], 49 | "vote_state": 0, // 1=upvoted, -1=downvoted, 0=unvoted, -2=no vote allowed 50 | "edited": false, 51 | "rt": 1, // No clue what this is 52 | "rc": 1, // No clue what this is 53 | "user_id": 12301, 54 | "user_username": "User1", 55 | "user_score": 1234, 56 | "user_avatar": { 57 | "b": "2a8b9d", // Avatar background color 58 | "i": "v-18_c-3_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.jpg" // Avatar filename 59 | }, 60 | "user_avatar_lg": { 61 | "b": "2a8b9d", // Avatar background color 62 | "i": "v-18_c-1_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.png" // Avatar filename 63 | }, 64 | "user_dpp": 1 // 1 if user is devRant++, 0 if not devRant++ 65 | }, 66 | // ... 67 | ], 68 | "settings": { // Empty array when not authenticated 69 | "notif_state": "1", // If notifications are available 70 | "notif_token": "" 71 | }, 72 | "set": "5ee254ee76f3e", // Session hash 73 | "wrw": 212, // Weekly-Rant Week 74 | "dpp": 0, // 1 if devRant++, 0 if not devRant++, not set when not authenticated 75 | "num_notifs": 2, // Not set when not authenticated 76 | "unread": { // Not set when not authenticated 77 | "total": 2 // Same as "num_notifs" 78 | }, 79 | "news": { 80 | "id": 321, 81 | "type": "intlink", // Internal Link (intlink) most of the time, not sure what other values are possible 82 | "headline": "Weekly Group Rant", 83 | "body": "Story of screenshare gone wrong?", 84 | "footer": "Add tag 'wk212' to your rant", 85 | "height": 100, 86 | "action": "grouprant" // What to do when clicked, "grouprant" means go to group rants section, not sure what other values are possible (I'm guessing there's "rant") 87 | } 88 | } 89 | ``` 90 | 91 | ## Get a single rant [GET /devrant/rants/{id}{?app}] 92 | 93 | + Parameters 94 | + id (required, number) - ID of the rant 95 | + app: 3 (required, number) - App ID parameter 96 | 97 | + Response 200 (application/json) 98 | + Attributes (object) 99 | + rant (Rant) 100 | + comments (array[Comment]) 101 | + success: `true` (boolean) 102 | 103 | + Body 104 | ```js 105 | { 106 | "rant": { 107 | "id": 10123, 108 | "text": "Bla bla fuck everything", 109 | "score": 12, 110 | "created_time": 1517755150, 111 | "attached_image": { // Empty string if there is no image 112 | "url": "https://img.devrant.com/devrant/rant/imageName.jpg", 113 | "width": 753, 114 | "height": 546 115 | }, 116 | "num_comments": 8, 117 | "tags": [ 118 | "some-tag" 119 | ], 120 | "vote_state": 0, // 1=upvoted, -1=downvoted, 0=unvoted, -2=no vote allowed 121 | "edited": true, 122 | "link": "rants/10123/some-strange-text-for-seo", 123 | "rt": 1, // No clue what this is 124 | "rc": 7, // No clue what this is 125 | "links": [ 126 | { 127 | "type": "url", 128 | "url": "https://github.com/User1/SomeRepo", 129 | "short_url": "https://github.com/User...", 130 | "title": "https://github.com/User...", 131 | "start": 278, // Starting position of the link 132 | "end": 313, // Ending position of the link 133 | "special": 1 // No clue what this is 134 | } 135 | ], 136 | "special": true, // No clue what this is 137 | "user_id": 12301, 138 | "user_username": "User1", 139 | "user_score": 1234, 140 | "user_avatar": { 141 | "b": "69c9cd", 142 | "i": "v-18_c-3_b-6_g-m_9-1_1-3_16-8_3-11_8-4_7-4_5-2_12-3_6-12_10-4_2-18_18-4_4-2_19-3_21-2.jpg" 143 | }, 144 | "user_avatar_lg": { 145 | "b": "69c9cd", 146 | "i": "v-18_c-1_b-6_g-m_9-1_1-3_16-8_3-11_8-4_7-4_5-2_12-3_6-12_10-4_2-18_18-4_4-2_19-3_21-2.png" 147 | }, 148 | "user_dpp": 1 // Bool indicator if the user is a devRant++ Member or not 149 | }, 150 | "comments": [ 151 | { 152 | "id": 2639015, 153 | "rant_id": 10123, 154 | "body": "This rant sucks!", 155 | "score": -100, 156 | "created_time": 1591901533, 157 | "vote_state": 0, 158 | "user_id": 5125, 159 | "user_username": "User2", 160 | "user_score": 10000, 161 | "user_avatar": { 162 | "b": "69c9cd", 163 | "i": "v-37_c-3_b-6_g-m_9-1_1-6_16-4_3-13_8-1_7-1_5-1_12-6_17-2_6-2_10-5_2-26_22-2_15-10_11-3_18-2_19-1_4-1.jpg" 164 | } 165 | } 166 | // .... 167 | ], 168 | "success": true 169 | } 170 | ``` 171 | 172 | ## Get a random rant [GET /devrant/rants/surprise{?app}] 173 | 174 | + Parameters 175 | + app: 3 (required, number) - App ID parameter 176 | 177 | + Response 200 (application/json) 178 | + Attributes (object) 179 | + success: true (boolean) 180 | + rant (Rant) 181 | 182 | + Body 183 | ```js 184 | { 185 | "success": true, 186 | "rant": { 187 | "id": 20123, 188 | "text": "Such random. Much wow", 189 | "score": 13, 190 | "created_time": 1517755155, 191 | "attached_image": { // Empty string if there is no image 192 | "url": "https://img.devrant.com/devrant/rant/imageName.jpg", 193 | "width": 753, 194 | "height": 546 195 | }, 196 | "num_comments": 8, 197 | "tags": [ 198 | "some-tag" 199 | ], 200 | "vote_state": 0, // 1=upvoted, -1=downvoted, 0=unvoted, -2=no vote allowed 201 | "edited": true, 202 | "rt": 1, // No clue what this is 203 | "rc": 7, // No clue what this is 204 | "links": [ 205 | { 206 | "type": "url", 207 | "url": "https://github.com/User1/SomeRepo", 208 | "short_url": "https://github.com/User...", 209 | "title": "https://github.com/User...", 210 | "start": 278, // Starting position of the link 211 | "end": 313, // Ending position of the link 212 | "special": 1 // No clue what this is 213 | } 214 | ], 215 | "special": true, // No clue what this is 216 | "user_id": 12302, 217 | "user_username": "User2", 218 | "user_score": 123, 219 | "user_avatar": { 220 | "b": "69c9cd", 221 | "i": "v-18_c-3_b-6_g-m_9-1_1-3_16-8_3-11_8-4_7-4_5-2_12-3_6-12_10-4_2-18_18-4_4-2_19-3_21-2.jpg" 222 | }, 223 | "user_avatar_lg": { 224 | "b": "69c9cd", 225 | "i": "v-18_c-1_b-6_g-m_9-1_1-3_16-8_3-11_8-4_7-4_5-2_12-3_6-12_10-4_2-18_18-4_4-2_19-3_21-2.png" 226 | }, 227 | "user_dpp": 1 // Bool indicator if the user is a devRant++ Member or not 228 | } 229 | } 230 | ``` 231 | 232 | ## Get list of stories [GET /devrant/story-rants{?app,limit,sort,range,skip,token_id,token_key,user_id}] 233 | 234 | + Parameters 235 | + app: 3 (required, number) - App ID parameter 236 | + sort: `top` (optional, enum[string]) 237 | Sort rants 238 | + Members 239 | + `algo` 240 | + `top` 241 | + `recent` 242 | + range: `all` (optional, enum[string]) 243 | Time range of the rants to load 244 | + Members 245 | + `day` 246 | + `week` 247 | + `month` 248 | + `all` 249 | + limit: 20 (optional, number) - Limit the amount of rants to load. Used for pagination/infinite scroll. Maximum is 50, if more defaults to 20 250 | + skip: 0 (optional, number) - How many rants to skip before loading. Used for pagination/infinite scroll 251 | 252 | + Response 200 (application/json) 253 | + Attributes (RantFeed) 254 | 255 | + Body 256 | ```js 257 | { 258 | "success": true, 259 | "rants": [ 260 | { 261 | "id": 40123, 262 | "text": "Bla bla I hate my life, but this is a very long rant fuck yeah!", 263 | "score": 123, 264 | "created_time": 1518160633, // When the rant was created 265 | "attached_image": { // Empty string if there is no image 266 | "url": "https://img.devrant.com/devrant/rant/imageName.jpg", 267 | "width": 753, 268 | "height": 546 269 | }, 270 | "num_comments": 12, 271 | "tags": [ 272 | "some-tag" 273 | ], 274 | "vote_state": 0, // 1=upvoted, -1=downvoted, 0=unvoted, -2=no vote allowed 275 | "edited": false, 276 | "rt": 1, // No clue what this is 277 | "rc": 1, // No clue what this is 278 | "user_id": 12301, 279 | "user_username": "User1", 280 | "user_score": 1234, 281 | "user_avatar": { 282 | "b": "2a8b9d", 283 | "i": "v-18_c-3_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.jpg" 284 | }, 285 | "user_avatar_lg": { 286 | "b": "2a8b9d", 287 | "i": "v-18_c-1_b-4_g-m_9-1_1-2_16-3_3-3_8-3_7-3_5-4_12-2_6-7_10-9_2-48_15-11_18-4_4-4_19-3_20-14.png" 288 | }, 289 | "user_dpp": 1 // Bool indicator if the user is a devRant++ Member or not 290 | } 291 | ] 292 | } 293 | ``` 294 | 295 | ## Get list of collabs [GET /devrant/collabs{?app,limit,sort,range,skip}] 296 | 297 | + Parameters 298 | + app: 3 (required, number) - App ID parameter 299 | + sort: `top` (optional, enum[string]) 300 | Sort rants 301 | + Members 302 | + `algo` 303 | + `top` 304 | + `recent` 305 | + range: `all` (optional, enum[string]) 306 | Time range of the rants to load 307 | + Members 308 | + `day` 309 | + `week` 310 | + `month` 311 | + `all` 312 | + limit: 20 (optional, number) - Limit the amount of rants to load. Used for pagination/infinite scroll. Maximum is 50, if more defaults to 20 313 | + skip: 0 (optional, number) - How many rants to skip before loading. Used for pagination/infinite scroll 314 | 315 | + Response 200 (application/json) 316 | + Attributes (object) 317 | + success: true (boolean) 318 | + rants (array[RantInFeed]) 319 | 320 | + Body 321 | ```js 322 | { 323 | "success": true, 324 | "rants": [ 325 | { 326 | "id": 12311, 327 | "text": "devRant-Docs Page [more details]", 328 | "score": 1234567, 329 | "created_time": 1519068050, 330 | "attached_image": { // Empty string if there is no image 331 | "url": "https://img.devrant.com/devrant/rant/imageName.jpg", 332 | "width": 753, 333 | "height": 546 334 | }, 335 | "num_comments": 123, 336 | "tags": [ 337 | "some-tag" 338 | ], 339 | "vote_state": 0, // As far as I know: 1=upvoted, -1=downvoted, 0=unvoted, -2=no vote 340 | "edited": false, 341 | "link": "collabs/12311/some-strange-text-for-seo", 342 | "rt": 2, // No clue what this is 343 | "rc": 2, // No clue what this is 344 | "c_type": 2, // 1 = Open source idea, 2 = Existing open source project, 3 = Project idea, 4 = Existing project 345 | "c_type_long": "Existing open source project", // Collab type as string (see above) 346 | "user_id": 12301, 347 | "user_username": "User1", 348 | "user_score": 1234568, 349 | "user_avatar": { 350 | "b": "69c9cd", 351 | "i": "v-18_c-3_b-6_g-m_9-1_1-3_16-8_3-11_8-4_7-4_5-2_12-3_6-12_10-4_2-18_18-4_4-2_19-3_21-2.jpg" 352 | }, 353 | "user_avatar_lg": { 354 | "b": "69c9cd", 355 | "i": "v-18_c-1_b-6_g-m_9-1_1-3_16-8_3-11_8-4_7-4_5-2_12-3_6-12_10-4_2-18_18-4_4-2_19-3_21-2.png" 356 | }, 357 | "user_dpp": 1 // Bool indicator if the user is a devRant++ Member or not 358 | } 359 | ] 360 | } 361 | ``` --------------------------------------------------------------------------------