├── .github └── workflows │ └── update_docs.yml ├── .gitignore ├── CNAME ├── LICENSE.txt ├── README.md ├── categories.yml ├── definitions ├── admin │ ├── generate_api_key.yml │ ├── get_badges.yml │ ├── get_user.yml │ └── site_settings.yml ├── categories │ ├── categories.yml │ ├── category.yml │ ├── category_response.yml │ ├── new_category.yml │ ├── new_category_response.yml │ ├── update_category.yml │ └── update_category_response.yml ├── groups │ ├── get_group_response.yml │ ├── get_groups_response.yml │ ├── group_members_response.yml │ └── new_group_response.yml ├── notifications │ └── get.yml ├── posts │ ├── get_post_response.yml │ ├── get_posts_response.yml │ ├── posts.json │ ├── posts.yml │ └── update_post_response.yml ├── search │ └── query_response.yml ├── topics │ ├── invite.yml │ ├── latest_topics_response.yml │ ├── new_topic.yml │ ├── new_topic_response.yml │ ├── private-messages-sent.yml │ ├── private-messages.yml │ ├── top.yml │ ├── topic_response.yml │ ├── update_topic.yml │ └── update_topic_response.yml └── users │ ├── directory_items_response.yml │ ├── get_user_response.yml │ ├── list.yml │ ├── new_user.yml │ └── new_user_response.yml ├── favicon.png ├── index-versioned.html ├── index.html ├── lefthook.yml ├── local.html ├── logo.svg ├── openapi.json ├── openapi.yml ├── openapi_changed.sh ├── package-lock.json ├── package.json ├── postman ├── discourse.postman_collection.json └── discourse_local.postman_environment.json ├── responses ├── admin │ ├── generate_api_key.json │ ├── get_badges.json │ ├── get_user.json │ └── site_settings.json ├── categories │ └── update_category_response.json ├── groups │ ├── get_groups_response.json │ ├── group_members_response.json │ └── new_group_response.json ├── notifications │ └── get.json ├── posts │ ├── get_post_response.json │ └── update_post_response.json ├── search │ └── query_response.json ├── topics │ ├── invite.json │ ├── latest_topics_response.json │ ├── new_topic_response.json │ ├── private-messages-sent.json │ ├── private-messages.json │ ├── top.json │ ├── topic_response.json │ └── update_topic_response.json └── users │ ├── active_list.json │ ├── directory_items.json │ ├── get_user_response.json │ ├── new_list.json │ ├── new_user_response.json │ └── staff_list.json ├── server.js ├── to_json.rb ├── tojson.js └── toschema.js /.github/workflows/update_docs.yml: -------------------------------------------------------------------------------- 1 | name: Update Docs 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 0 * * *' 7 | 8 | jobs: 9 | update-docs: 10 | runs-on: ubuntu-latest 11 | container: discourse/discourse_test:slim 12 | timeout-minutes: 30 13 | 14 | env: 15 | DISCOURSE_HOSTNAME: www.example.com 16 | RUBY_GLOBAL_METHOD_CACHE_SIZE: 131072 17 | RAILS_ENV: test 18 | PGUSER: discourse 19 | PGPASSWORD: discourse 20 | 21 | steps: 22 | - uses: actions/checkout@v3 23 | with: 24 | repository: discourse/discourse 25 | fetch-depth: 1 26 | 27 | - name: checkout documentation 28 | uses: actions/checkout@v3 29 | with: 30 | path: discourse_api_docs 31 | 32 | - name: setup git 33 | run: | 34 | git config --global user.name discoursebuild 35 | git config --global user.email build@discourse.org 36 | 37 | - name: Start redis 38 | run: | 39 | redis-server /etc/redis/redis.conf & 40 | 41 | - name: Start Postgres 42 | run: | 43 | chown -R postgres /var/run/postgresql 44 | sudo -E -u postgres script/start_test_db.rb 45 | sudo -u postgres psql -c "CREATE ROLE $PGUSER LOGIN SUPERUSER PASSWORD '$PGPASSWORD';" 46 | 47 | - name: Bundler cache 48 | uses: actions/cache@v3 49 | with: 50 | path: vendor/bundle 51 | key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} 52 | restore-keys: | 53 | ${{ runner.os }}-gem- 54 | 55 | - name: Setup gems 56 | run: | 57 | bundle config --local path vendor/bundle 58 | bundle config --local deployment true 59 | bundle config --local without development 60 | bundle install --jobs 4 61 | bundle clean 62 | 63 | - name: pnpm install 64 | run: pnpm install 65 | 66 | - name: Create and migrate database 67 | run: | 68 | bin/rake db:create 69 | bin/rake db:migrate 70 | 71 | - name: Generate swagger 72 | run: bin/rake rswag:specs:swaggerize 73 | 74 | - name: Move definition to discourse_api_docs 75 | run: mv openapi/openapi.yaml discourse_api_docs/openapi.yml 76 | 77 | - name: Convert to json 78 | working-directory: discourse_api_docs 79 | run: yarn install && yarn node tojson.js 80 | 81 | - name: Create PR 82 | uses: peter-evans/create-pull-request@v4.0.4 83 | with: 84 | path: discourse_api_docs 85 | add-paths: "openapi.yml,openapi.json" 86 | branch: update-documentation 87 | commit-message: "Update Documentation with core changes" 88 | title: "Update documentation" 89 | author: discoursebuild 90 | body: | 91 | Updates Documentation with changes from Discourse core 92 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | docs.discourse.org -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Civilized Discourse Construction Kit, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Discourse API Documentation 2 | 3 | ![automatic updates](https://github.com/discourse/discourse_api_docs/actions/workflows/update_docs.yml/badge.svg) 4 | 5 | To view the the Discourse API Documentation you can visit: 6 | 7 | https://docs.discourse.org/ 8 | 9 | ### Contributing 10 | 11 | Contributions are welcome! Start by cloning this repo as well as the 12 | [discourse](https://github.com/discourse/discourse) repo. 13 | 14 | 15 | The API docs are automatically generated from the discourse repo using a tool 16 | called rswag. 17 | 18 | You can generate the openapi.yml file that is located in this repo by running 19 | this command from inside of your discourse repo directory: 20 | 21 | 22 | ``` 23 | rake rswag:specs:swaggerize && cp openapi/openapi.yaml ~/code/discourse_api_docs/openapi.yml 24 | ``` 25 | 26 | Please do not manually edit the openapi.yml or openapi.json files located in 27 | this repo. These files must be edited from the rswag files located in 28 | 29 | https://github.com/discourse/discourse/tree/main/spec/requests/api 30 | 31 | To view your changes locally, run: 32 | 33 | ``` 34 | npm install 35 | node server.js 36 | ``` 37 | 38 | Browse to http://localhost:3001 to see the pretty docs. 39 | 40 | Before you push your changes or create a PR convert the yml file to json: 41 | 42 | ``` 43 | node tojson.js 44 | ``` 45 | 46 | To verify converting to json worked correctly, please run: 47 | 48 | ``` 49 | node server.js json 50 | ``` 51 | 52 | which will load the json file directly instead of live converting the yml file 53 | to json. Now browse to http://localhost:3001 and verify your changes still look 54 | okay. 55 | 56 | Then you can commit your changes and create a PR. This is because we are using 57 | github pages to host the static doc website. 58 | 59 | ### Automatic openapi.yml generation 60 | 61 | If you are changing multiple API specs in the core Discourse repo, then you can use the `bundle exec rake autospec:swagger` rake task to watch for changes to files in the `spec/requests/api` directory. When a change is detected the swaggerize rake task command is run, the openapi.yml file is generated, and node tojson.js is run. 62 | 63 | This can all be done while the local API docs server is running for live updates every time API spec files are changed. 64 | 65 | ### Schema Generator 66 | 67 | To aid in writing the yml responses in the swagger.yml file use this command to 68 | convert actual json responses to a yml schema file: 69 | 70 | ``` 71 | node toschema.js 72 | ``` 73 | 74 | Example: 75 | 76 | ``` 77 | node toschema.js responses/topics/topic_respones.json definitions/topics/topic_response.yml 78 | ``` 79 | 80 | This will convert a json response into json schema and then convert the schema 81 | to yml. 82 | 83 | -------------------------------------------------------------------------------- /categories.yml: -------------------------------------------------------------------------------- 1 | categories: 2 | type: object 3 | properties: 4 | category_list: 5 | type: object 6 | properties: 7 | can_create_category: 8 | type: boolean 9 | description: 10 | can_create_topic: 11 | type: boolean 12 | description: 13 | draft: 14 | type: boolean 15 | description: 16 | draft_key: 17 | type: string 18 | description: 19 | draft_sequence: 20 | type: integer 21 | description: 22 | categories: 23 | type: array 24 | description: 25 | items: 26 | $ref: '#/definitions/category' 27 | category: 28 | type: object 29 | properties: 30 | id: 31 | type: integer 32 | description: "The id for the category" 33 | name: 34 | type: string 35 | description: 36 | color: 37 | type: string 38 | description: 39 | text_color: 40 | type: string 41 | description: 42 | slug: 43 | type: string 44 | description: 45 | topic_count: 46 | type: integer 47 | description: 48 | post_count: 49 | type: integer 50 | description: 51 | position: 52 | type: integer 53 | description: 54 | description: 55 | type: string 56 | description: 57 | description_text: 58 | type: string 59 | description: 60 | topic_url: 61 | type: string 62 | description: 63 | logo_url: 64 | type: string 65 | description: 66 | background_url: 67 | type: string 68 | description: 69 | read_restricted: 70 | type: boolean 71 | description: 72 | permission: 73 | type: integer 74 | description: 75 | notification_level: 76 | type: string 77 | description: 78 | can_edit: 79 | type: boolean 80 | description: 81 | topic_template: 82 | type: string 83 | description: 84 | has_children: 85 | type: boolean 86 | description: 87 | topics_day: 88 | type: integer 89 | description: 90 | topics_week: 91 | type: integer 92 | description: 93 | topics_month: 94 | type: integer 95 | description: 96 | topics_year: 97 | type: integer 98 | description: 99 | topics_all_time: 100 | type: integer 101 | description: 102 | description_excerpt: 103 | type: string 104 | description: 105 | 106 | -------------------------------------------------------------------------------- /definitions/admin/generate_api_key.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | api_key: 5 | type: object 6 | properties: 7 | id: 8 | type: number 9 | key: 10 | type: string 11 | minLength: 1 12 | user: 13 | type: object 14 | properties: 15 | id: 16 | type: number 17 | username: 18 | type: string 19 | minLength: 1 20 | avatar_template: 21 | type: string 22 | minLength: 1 23 | required: 24 | - id 25 | - username 26 | - avatar_template 27 | required: 28 | - id 29 | - key 30 | - user 31 | -------------------------------------------------------------------------------- /definitions/admin/get_badges.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | badges: 5 | type: array 6 | items: 7 | properties: 8 | id: 9 | type: number 10 | name: 11 | type: string 12 | description: 13 | type: string 14 | grant_count: 15 | type: number 16 | allow_title: 17 | type: boolean 18 | multiple_grant: 19 | type: boolean 20 | icon: 21 | type: string 22 | image: 23 | type: string 24 | listable: 25 | type: boolean 26 | enabled: 27 | type: boolean 28 | badge_grouping_id: 29 | type: number 30 | system: 31 | type: boolean 32 | long_description: 33 | type: string 34 | slug: 35 | type: string 36 | query: 37 | type: string 38 | trigger: 39 | type: number 40 | target_posts: 41 | type: boolean 42 | auto_revoke: 43 | type: boolean 44 | show_posts: 45 | type: boolean 46 | badge_type_id: 47 | type: number 48 | badge_types: 49 | type: array 50 | items: 51 | properties: 52 | id: 53 | type: number 54 | name: 55 | type: string 56 | sort_order: 57 | type: number 58 | badge_groupings: 59 | type: array 60 | items: 61 | properties: 62 | id: 63 | type: number 64 | name: 65 | type: number 66 | description: 67 | type: string 68 | position: 69 | type: number 70 | system: 71 | type: boolean 72 | admin_badges: 73 | type: object 74 | properties: 75 | protected_system_fields: 76 | type: array 77 | items: 78 | type: string 79 | triggers: 80 | type: object 81 | properties: 82 | none: 83 | type: number 84 | post_action: 85 | type: number 86 | post_revision: 87 | type: number 88 | trust_level_change: 89 | type: number 90 | user_change: 91 | type: number 92 | post_processed: 93 | type: number 94 | badge_ids: 95 | type: array 96 | items: 97 | type: number 98 | badge_grouping_ids: 99 | type: array 100 | items: 101 | type: number 102 | badge_type_ids: 103 | type: array 104 | items: 105 | type: number 106 | 107 | -------------------------------------------------------------------------------- /definitions/admin/get_user.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | id: 5 | type: number 6 | username: 7 | type: string 8 | minLength: 1 9 | avatar_template: 10 | type: string 11 | minLength: 1 12 | active: 13 | type: boolean 14 | admin: 15 | type: boolean 16 | moderator: 17 | type: boolean 18 | last_seen_at: 19 | type: string 20 | minLength: 1 21 | last_emailed_at: 22 | type: string 23 | minLength: 1 24 | created_at: 25 | type: string 26 | minLength: 1 27 | last_seen_age: 28 | type: number 29 | last_emailed_age: 30 | type: number 31 | created_at_age: 32 | type: number 33 | username_lower: 34 | type: string 35 | minLength: 1 36 | trust_level: 37 | type: number 38 | manual_locked_trust_level: 39 | type: object 40 | flag_level: 41 | type: number 42 | title: 43 | type: object 44 | suspended_at: 45 | type: string 46 | minLength: 1 47 | suspended_till: 48 | type: string 49 | minLength: 1 50 | suspended: 51 | type: boolean 52 | time_read: 53 | type: number 54 | staged: 55 | type: boolean 56 | days_visited: 57 | type: number 58 | posts_read_count: 59 | type: number 60 | topics_entered: 61 | type: number 62 | post_count: 63 | type: number 64 | name: 65 | type: string 66 | minLength: 1 67 | can_send_activation_email: 68 | type: boolean 69 | can_activate: 70 | type: boolean 71 | can_deactivate: 72 | type: boolean 73 | ip_address: 74 | type: string 75 | minLength: 1 76 | registration_ip_address: 77 | type: string 78 | minLength: 1 79 | can_grant_admin: 80 | type: boolean 81 | can_revoke_admin: 82 | type: boolean 83 | can_grant_moderation: 84 | type: boolean 85 | can_revoke_moderation: 86 | type: boolean 87 | can_impersonate: 88 | type: boolean 89 | like_count: 90 | type: number 91 | like_given_count: 92 | type: number 93 | topic_count: 94 | type: number 95 | flags_given_count: 96 | type: number 97 | flags_received_count: 98 | type: number 99 | private_topics_count: 100 | type: number 101 | can_delete_all_posts: 102 | type: boolean 103 | can_be_deleted: 104 | type: boolean 105 | can_be_anonymized: 106 | type: boolean 107 | full_suspend_reason: 108 | type: string 109 | minLength: 1 110 | silence_reason: 111 | type: object 112 | primary_group_id: 113 | type: object 114 | badge_count: 115 | type: number 116 | warnings_received_count: 117 | type: number 118 | user_fields: 119 | type: object 120 | properties: 121 | '1': 122 | type: object 123 | bounce_score: 124 | type: number 125 | reset_bounce_score_after: 126 | type: object 127 | can_view_action_logs: 128 | type: boolean 129 | can_disable_second_factor: 130 | type: boolean 131 | single_sign_on_record: 132 | type: object 133 | approved_by: 134 | type: object 135 | suspended_by: 136 | type: object 137 | properties: 138 | id: 139 | type: number 140 | username: 141 | type: string 142 | minLength: 1 143 | avatar_template: 144 | type: string 145 | minLength: 1 146 | required: 147 | - id 148 | - username 149 | - avatar_template 150 | silenced_by: 151 | type: object 152 | groups: 153 | type: array 154 | uniqueItems: true 155 | minItems: 1 156 | items: 157 | required: 158 | - id 159 | - automatic 160 | - name 161 | - display_name 162 | - user_count 163 | - mentionable_level 164 | - messageable_level 165 | - visibility_level 166 | - automatic_membership_retroactive 167 | - primary_group 168 | - has_messages 169 | - public_admission 170 | - public_exit 171 | - allow_membership_requests 172 | - default_notification_level 173 | properties: 174 | id: 175 | type: number 176 | automatic: 177 | type: boolean 178 | name: 179 | type: string 180 | minLength: 1 181 | display_name: 182 | type: string 183 | minLength: 1 184 | user_count: 185 | type: number 186 | mentionable_level: 187 | type: number 188 | messageable_level: 189 | type: number 190 | visibility_level: 191 | type: number 192 | automatic_membership_email_domains: 193 | type: object 194 | automatic_membership_retroactive: 195 | type: boolean 196 | primary_group: 197 | type: boolean 198 | title: 199 | type: object 200 | grant_trust_level: 201 | type: object 202 | incoming_email: 203 | type: object 204 | has_messages: 205 | type: boolean 206 | flair_url: 207 | type: object 208 | flair_bg_color: 209 | type: object 210 | flair_color: 211 | type: object 212 | bio_raw: 213 | type: object 214 | bio_cooked: 215 | type: object 216 | public_admission: 217 | type: boolean 218 | public_exit: 219 | type: boolean 220 | allow_membership_requests: 221 | type: boolean 222 | full_name: 223 | type: object 224 | default_notification_level: 225 | type: number 226 | membership_request_template: 227 | type: object 228 | -------------------------------------------------------------------------------- /definitions/admin/site_settings.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | site_settings: 5 | type: array 6 | uniqueItems: true 7 | minItems: 1 8 | items: 9 | required: 10 | - setting 11 | - description 12 | - default 13 | - type 14 | - value 15 | - category 16 | - preview 17 | - translate_names 18 | properties: 19 | setting: 20 | type: string 21 | minLength: 1 22 | description: 23 | type: string 24 | minLength: 1 25 | default: 26 | type: string 27 | minLength: 1 28 | type: 29 | type: string 30 | minLength: 1 31 | value: 32 | type: string 33 | minLength: 1 34 | category: 35 | type: string 36 | minLength: 1 37 | preview: 38 | type: string 39 | minLength: 1 40 | valid_values: 41 | type: array 42 | uniqueItems: true 43 | minItems: 1 44 | items: 45 | required: 46 | - name 47 | - value 48 | properties: 49 | name: 50 | type: string 51 | minLength: 1 52 | value: 53 | type: string 54 | minLength: 1 55 | translate_names: 56 | type: boolean 57 | choices: 58 | type: array 59 | uniqueItems: null 60 | minItems: null 61 | items: 62 | type: object 63 | diags: 64 | type: object 65 | properties: 66 | last_message_processed: 67 | type: object 68 | -------------------------------------------------------------------------------- /definitions/categories/categories.yml: -------------------------------------------------------------------------------- 1 | # categories 2 | type: object 3 | properties: 4 | category_list: 5 | type: object 6 | properties: 7 | can_create_category: 8 | type: boolean 9 | can_create_topic: 10 | type: boolean 11 | draft: 12 | type: boolean 13 | draft_key: 14 | type: string 15 | draft_sequence: 16 | type: integer 17 | categories: 18 | type: array 19 | items: 20 | $ref: 'category.yml' 21 | -------------------------------------------------------------------------------- /definitions/categories/category.yml: -------------------------------------------------------------------------------- 1 | # category 2 | type: object 3 | properties: 4 | id: 5 | type: integer 6 | name: 7 | type: string 8 | color: 9 | type: string 10 | text_color: 11 | type: string 12 | slug: 13 | type: string 14 | topic_count: 15 | type: integer 16 | post_count: 17 | type: integer 18 | position: 19 | type: integer 20 | description: 21 | type: string 22 | description_text: 23 | type: string 24 | topic_url: 25 | type: string 26 | logo_url: 27 | type: string 28 | background_url: 29 | type: string 30 | read_restricted: 31 | type: boolean 32 | permission: 33 | type: integer 34 | notification_level: 35 | type: string 36 | can_edit: 37 | type: boolean 38 | topic_template: 39 | type: string 40 | has_children: 41 | type: boolean 42 | topics_day: 43 | type: integer 44 | topics_week: 45 | type: integer 46 | topics_month: 47 | type: integer 48 | topics_year: 49 | type: integer 50 | topics_all_time: 51 | type: integer 52 | description_excerpt: 53 | type: string 54 | -------------------------------------------------------------------------------- /definitions/categories/category_response.yml: -------------------------------------------------------------------------------- 1 | # category_response 2 | type: object 3 | properties: 4 | users: 5 | type: array 6 | items: 7 | type: object 8 | properties: 9 | id: 10 | type: integer 11 | username: 12 | type: string 13 | avatar_template: 14 | type: string 15 | topic_list: 16 | type: object 17 | properties: 18 | can_create_topic: 19 | type: boolean 20 | draft: 21 | type: boolean 22 | draft_key: 23 | type: string 24 | draft_sequence: 25 | type: integer 26 | per_page: 27 | type: integer 28 | topics: 29 | type: array 30 | items: 31 | type: object 32 | properties: 33 | id: 34 | type: integer 35 | title: 36 | type: string 37 | fancy_title: 38 | type: string 39 | slug: 40 | type: string 41 | posts_count: 42 | type: integer 43 | reply_count: 44 | type: integer 45 | highest_post_number: 46 | type: integer 47 | image_url: 48 | type: string 49 | created_at: 50 | type: string 51 | last_posted_at: 52 | type: string 53 | bumped: 54 | type: boolean 55 | bumped_at: 56 | type: string 57 | unseen: 58 | type: boolean 59 | pinned: 60 | type: boolean 61 | unpinned: 62 | type: boolean 63 | excerpt: 64 | type: string 65 | visible: 66 | type: boolean 67 | closed: 68 | type: boolean 69 | archived: 70 | type: boolean 71 | bookmarked: 72 | type: object 73 | liked: 74 | type: object 75 | views: 76 | type: integer 77 | like_count: 78 | type: integer 79 | has_summary: 80 | type: boolean 81 | archetype: 82 | type: string 83 | last_poster_username: 84 | type: string 85 | category_id: 86 | type: integer 87 | pinned_globally: 88 | type: boolean 89 | posters: 90 | type: array 91 | items: 92 | type: object 93 | properties: 94 | extras: 95 | type: string 96 | description: 97 | type: string 98 | user_id: 99 | type: integer 100 | 101 | -------------------------------------------------------------------------------- /definitions/categories/new_category.yml: -------------------------------------------------------------------------------- 1 | # new_category 2 | type: object 3 | required: 4 | - name 5 | - color 6 | - text_color 7 | properties: 8 | name: 9 | type: string 10 | color: 11 | type: string 12 | text_color: 13 | type: string 14 | -------------------------------------------------------------------------------- /definitions/categories/new_category_response.yml: -------------------------------------------------------------------------------- 1 | # new_category_response 2 | type: object 3 | properties: 4 | category: 5 | type: object 6 | properties: 7 | id: 8 | type: integer 9 | description: "The id for the category" 10 | name: 11 | type: string 12 | description: 13 | color: 14 | type: string 15 | description: 16 | text_color: 17 | type: string 18 | description: 19 | slug: 20 | type: string 21 | topic_count: 22 | type: integer 23 | post_count: 24 | type: integer 25 | position: 26 | type: integer 27 | description: 28 | type: string 29 | description_text: 30 | type: string 31 | topic_url: 32 | type: string 33 | logo_url: 34 | type: string 35 | background_url: 36 | type: string 37 | read_restricted: 38 | type: boolean 39 | permission: 40 | type: string 41 | notification_level: 42 | type: string 43 | can_edit: 44 | type: boolean 45 | topic_template: 46 | type: string 47 | has_children: 48 | type: boolean 49 | available_groups: 50 | type: array 51 | auto_close_hours: 52 | type: integer 53 | auto_close_based_on_last_post: 54 | type: boolean 55 | group_permissions: 56 | type: array 57 | email_in: 58 | type: boolean 59 | email_in_allow_strangers: 60 | type: boolean 61 | suppress_from_homepage: 62 | type: boolean 63 | can_delete: 64 | type: boolean 65 | cannot_delete_reason: 66 | type: string 67 | allow_badges: 68 | type: boolean 69 | custom_fields: 70 | type: object 71 | 72 | -------------------------------------------------------------------------------- /definitions/categories/update_category.yml: -------------------------------------------------------------------------------- 1 | # new_category 2 | type: object 3 | required: 4 | - name 5 | - color 6 | - text_color 7 | properties: 8 | name: 9 | type: string 10 | color: 11 | type: string 12 | text_color: 13 | type: string 14 | -------------------------------------------------------------------------------- /definitions/categories/update_category_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | success: 5 | type: string 6 | minLength: 1 7 | category: 8 | type: object 9 | properties: 10 | id: 11 | type: number 12 | name: 13 | type: string 14 | minLength: 1 15 | color: 16 | type: string 17 | minLength: 1 18 | text_color: 19 | type: string 20 | minLength: 1 21 | slug: 22 | type: string 23 | minLength: 1 24 | topic_count: 25 | type: number 26 | post_count: 27 | type: number 28 | position: 29 | type: number 30 | description: 31 | type: object 32 | description_text: 33 | type: object 34 | topic_url: 35 | type: string 36 | minLength: 1 37 | logo_url: 38 | type: string 39 | background_url: 40 | type: string 41 | read_restricted: 42 | type: boolean 43 | permission: 44 | type: object 45 | notification_level: 46 | type: object 47 | can_edit: 48 | type: boolean 49 | topic_template: 50 | type: string 51 | has_children: 52 | type: object 53 | available_groups: 54 | type: array 55 | uniqueItems: null 56 | minItems: null 57 | items: 58 | type: object 59 | auto_close_hours: 60 | type: object 61 | auto_close_based_on_last_post: 62 | type: boolean 63 | group_permissions: 64 | type: array 65 | uniqueItems: true 66 | minItems: 1 67 | items: 68 | required: 69 | - permission_type 70 | - group_name 71 | properties: 72 | permission_type: 73 | type: number 74 | group_name: 75 | type: string 76 | minLength: 1 77 | email_in: 78 | type: object 79 | email_in_allow_strangers: 80 | type: boolean 81 | suppress_from_homepage: 82 | type: boolean 83 | can_delete: 84 | type: boolean 85 | cannot_delete_reason: 86 | type: object 87 | allow_badges: 88 | type: boolean 89 | custom_fields: 90 | type: object 91 | -------------------------------------------------------------------------------- /definitions/groups/get_group_response.yml: -------------------------------------------------------------------------------- 1 | type: object 2 | description: "" 3 | properties: 4 | group: 5 | type: object 6 | required: 7 | - id 8 | - automatic 9 | - name 10 | - user_count 11 | - automatic_membership_retroactive 12 | - primary_group 13 | properties: 14 | id: 15 | type: number 16 | automatic: 17 | type: boolean 18 | name: 19 | type: string 20 | minLength: 1 21 | user_count: 22 | type: number 23 | mentionable_level: 24 | type: number 25 | messageable_level: 26 | type: number 27 | visibility_level: 28 | type: number 29 | automatic_membership_email_domains: 30 | type: object 31 | automatic_membership_retroactive: 32 | type: boolean 33 | primary_group: 34 | type: boolean 35 | title: 36 | type: object 37 | grant_trust_level: 38 | type: object 39 | incoming_email: 40 | type: object 41 | has_messages: 42 | type: boolean 43 | flair_url: 44 | type: object 45 | flair_bg_color: 46 | type: object 47 | flair_color: 48 | type: object 49 | bio_raw: 50 | type: object 51 | bio_cooked: 52 | type: object 53 | public_admission: 54 | type: boolean 55 | public_exit: 56 | type: boolean 57 | allow_membership_requests: 58 | type: boolean 59 | full_name: 60 | type: string 61 | default_notification_level: 62 | type: number 63 | membership_request_template: 64 | type: object 65 | is_group_user: 66 | type: boolean 67 | is_group_owner: 68 | type: boolean 69 | mentionable: 70 | type: boolean 71 | messageable: 72 | type: boolean 73 | extras: 74 | type: object 75 | properties: 76 | visible_group_names: 77 | type: array 78 | items: 79 | type: string 80 | 81 | -------------------------------------------------------------------------------- /definitions/groups/get_groups_response.yml: -------------------------------------------------------------------------------- 1 | type: array 2 | description: "" 3 | minItems: 1 4 | uniqueItems: true 5 | items: 6 | type: object 7 | required: 8 | - id 9 | - automatic 10 | - name 11 | - user_count 12 | - automatic_membership_retroactive 13 | - primary_group 14 | properties: 15 | id: 16 | type: number 17 | automatic: 18 | type: boolean 19 | name: 20 | type: string 21 | minLength: 1 22 | display_name: 23 | type: string 24 | user_count: 25 | type: number 26 | mentionable_level: 27 | type: number 28 | messageable_level: 29 | type: number 30 | visibility_level: 31 | type: number 32 | automatic_membership_email_domains: 33 | type: object 34 | automatic_membership_retroactive: 35 | type: boolean 36 | primary_group: 37 | type: boolean 38 | title: 39 | type: object 40 | grant_trust_level: 41 | type: object 42 | incoming_email: 43 | type: object 44 | has_messages: 45 | type: boolean 46 | flair_url: 47 | type: object 48 | flair_bg_color: 49 | type: object 50 | flair_color: 51 | type: object 52 | bio_raw: 53 | type: object 54 | bio_cooked: 55 | type: object 56 | public_admission: 57 | type: boolean 58 | public_exit: 59 | type: boolean 60 | allow_membership_requests: 61 | type: boolean 62 | full_name: 63 | type: string 64 | default_notification_level: 65 | type: number 66 | membership_request_template: 67 | type: object 68 | is_group_user: 69 | type: boolean 70 | 71 | -------------------------------------------------------------------------------- /definitions/groups/group_members_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | members: 5 | type: array 6 | uniqueItems: true 7 | minItems: 1 8 | items: 9 | required: 10 | - id 11 | - username 12 | - avatar_template 13 | - last_seen_at 14 | properties: 15 | id: 16 | type: number 17 | username: 18 | type: string 19 | minLength: 1 20 | avatar_template: 21 | type: string 22 | minLength: 1 23 | # name: 24 | # type: object 25 | # title: 26 | # type: object 27 | # last_posted_at: 28 | # type: object 29 | # last_seen_at: 30 | # type: string 31 | # minLength: 1 32 | owners: 33 | type: array 34 | uniqueItems: null 35 | minItems: null 36 | items: 37 | type: object 38 | meta: 39 | type: object 40 | properties: 41 | total: 42 | type: number 43 | limit: 44 | type: number 45 | offset: 46 | type: number 47 | required: 48 | - total 49 | - limit 50 | - offset 51 | -------------------------------------------------------------------------------- /definitions/groups/new_group_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | basic_group: 5 | type: object 6 | properties: 7 | id: 8 | type: number 9 | automatic: 10 | type: boolean 11 | name: 12 | type: string 13 | minLength: 1 14 | user_count: 15 | type: number 16 | alias_level: 17 | type: number 18 | visible: 19 | type: boolean 20 | automatic_membership_email_domains: 21 | type: object 22 | automatic_membership_retroactive: 23 | type: boolean 24 | primary_group: 25 | type: boolean 26 | title: 27 | type: object 28 | grant_trust_level: 29 | type: object 30 | incoming_email: 31 | type: object 32 | notification_level: 33 | type: object 34 | has_messages: 35 | type: boolean 36 | is_member: 37 | type: boolean 38 | mentionable: 39 | type: boolean 40 | flair_url: 41 | type: object 42 | flair_bg_color: 43 | type: object 44 | flair_color: 45 | type: object 46 | required: 47 | - id 48 | - automatic 49 | - name 50 | - user_count 51 | - alias_level 52 | - visible 53 | - automatic_membership_retroactive 54 | - primary_group 55 | - has_messages 56 | - is_member 57 | - mentionable 58 | -------------------------------------------------------------------------------- /definitions/notifications/get.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | notifications: 5 | type: array 6 | uniqueItems: true 7 | minItems: 1 8 | items: 9 | required: 10 | - id 11 | - notification_type 12 | - read 13 | - created_at 14 | - post_number 15 | - topic_id 16 | - fancy_title 17 | - slug 18 | properties: 19 | id: 20 | type: number 21 | notification_type: 22 | type: number 23 | read: 24 | type: boolean 25 | created_at: 26 | type: string 27 | minLength: 1 28 | post_number: 29 | type: number 30 | topic_id: 31 | type: number 32 | fancy_title: 33 | type: string 34 | minLength: 1 35 | slug: 36 | type: string 37 | minLength: 1 38 | data: 39 | type: object 40 | properties: 41 | topic_title: 42 | type: string 43 | minLength: 1 44 | original_post_id: 45 | type: number 46 | original_post_type: 47 | type: number 48 | original_username: 49 | type: string 50 | minLength: 1 51 | revision_number: 52 | type: object 53 | display_username: 54 | type: string 55 | minLength: 1 56 | required: 57 | - topic_title 58 | - original_post_id 59 | - original_post_type 60 | - original_username 61 | - display_username 62 | total_rows_notifications: 63 | type: number 64 | seen_notification_id: 65 | type: number 66 | load_more_notifications: 67 | type: string 68 | minLength: 1 69 | -------------------------------------------------------------------------------- /definitions/posts/get_post_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | id: 5 | type: number 6 | name: 7 | type: string 8 | username: 9 | type: string 10 | minLength: 1 11 | avatar_template: 12 | type: string 13 | minLength: 1 14 | created_at: 15 | type: string 16 | minLength: 1 17 | cooked: 18 | type: string 19 | minLength: 1 20 | post_number: 21 | type: number 22 | post_type: 23 | type: number 24 | updated_at: 25 | type: string 26 | minLength: 1 27 | reply_count: 28 | type: number 29 | reply_to_post_number: 30 | type: object 31 | quote_count: 32 | type: number 33 | avg_time: 34 | type: object 35 | incoming_link_count: 36 | type: number 37 | reads: 38 | type: number 39 | score: 40 | type: number 41 | yours: 42 | type: boolean 43 | topic_id: 44 | type: number 45 | topic_slug: 46 | type: string 47 | minLength: 1 48 | display_username: 49 | type: string 50 | primary_group_name: 51 | type: object 52 | primary_group_flair_url: 53 | type: object 54 | primary_group_flair_bg_color: 55 | type: object 56 | primary_group_flair_color: 57 | type: object 58 | version: 59 | type: number 60 | can_edit: 61 | type: boolean 62 | can_delete: 63 | type: boolean 64 | can_recover: 65 | type: boolean 66 | can_wiki: 67 | type: boolean 68 | user_title: 69 | type: object 70 | raw: 71 | type: string 72 | minLength: 1 73 | actions_summary: 74 | type: array 75 | uniqueItems: null 76 | minItems: null 77 | items: 78 | type: object 79 | moderator: 80 | type: boolean 81 | admin: 82 | type: boolean 83 | staff: 84 | type: boolean 85 | user_id: 86 | type: number 87 | hidden: 88 | type: boolean 89 | hidden_reason_id: 90 | type: object 91 | trust_level: 92 | type: number 93 | deleted_at: 94 | type: object 95 | user_deleted: 96 | type: boolean 97 | edit_reason: 98 | type: object 99 | can_view_edit_history: 100 | type: boolean 101 | wiki: 102 | type: boolean 103 | -------------------------------------------------------------------------------- /definitions/posts/get_posts_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | latest_posts: 5 | type: array 6 | uniqueItems: true 7 | minItems: 1 8 | items: 9 | properties: 10 | id: 11 | type: number 12 | name: 13 | type: string 14 | minLength: 1 15 | username: 16 | type: string 17 | minLength: 1 18 | avatar_template: 19 | type: string 20 | minLength: 1 21 | created_at: 22 | type: string 23 | minLength: 1 24 | cooked: 25 | type: string 26 | minLength: 1 27 | post_number: 28 | type: number 29 | post_type: 30 | type: number 31 | updated_at: 32 | type: string 33 | minLength: 1 34 | reply_count: 35 | type: number 36 | reply_to_post_number: 37 | type: object 38 | quote_count: 39 | type: number 40 | avg_time: 41 | type: object 42 | incoming_link_count: 43 | type: number 44 | reads: 45 | type: number 46 | score: 47 | type: number 48 | yours: 49 | type: boolean 50 | topic_id: 51 | type: number 52 | topic_slug: 53 | type: string 54 | minLength: 1 55 | topic_title: 56 | type: string 57 | minLength: 1 58 | topic_html_title: 59 | type: string 60 | minLength: 1 61 | category_id: 62 | type: number 63 | display_username: 64 | type: string 65 | minLength: 1 66 | primary_group_name: 67 | type: object 68 | primary_group_flair_url: 69 | type: object 70 | primary_group_flair_bg_color: 71 | type: object 72 | primary_group_flair_color: 73 | type: object 74 | version: 75 | type: number 76 | can_edit: 77 | type: boolean 78 | can_delete: 79 | type: boolean 80 | can_recover: 81 | type: object 82 | can_wiki: 83 | type: boolean 84 | user_title: 85 | type: object 86 | raw: 87 | type: string 88 | minLength: 1 89 | actions_summary: 90 | type: array 91 | uniqueItems: true 92 | minItems: 1 93 | items: 94 | required: 95 | - id 96 | - hidden 97 | - can_act 98 | properties: 99 | id: 100 | type: number 101 | hidden: 102 | type: boolean 103 | can_act: 104 | type: boolean 105 | moderator: 106 | type: boolean 107 | admin: 108 | type: boolean 109 | staff: 110 | type: boolean 111 | user_id: 112 | type: number 113 | hidden: 114 | type: boolean 115 | trust_level: 116 | type: number 117 | deleted_at: 118 | type: object 119 | user_deleted: 120 | type: boolean 121 | edit_reason: 122 | type: object 123 | can_view_edit_history: 124 | type: boolean 125 | wiki: 126 | type: boolean 127 | static_doc: 128 | type: boolean 129 | 130 | -------------------------------------------------------------------------------- /definitions/posts/posts.yml: -------------------------------------------------------------------------------- 1 | $schema: 'http://json-schema.org/draft-04/schema#' 2 | description: "" 3 | type: object 4 | properties: 5 | latest_posts: 6 | type: array 7 | uniqueItems: true 8 | minItems: 1 9 | items: 10 | required: 11 | - id 12 | - name 13 | - username 14 | - avatar_template 15 | - created_at 16 | - cooked 17 | - post_number 18 | - post_type 19 | - updated_at 20 | - reply_count 21 | - quote_count 22 | - incoming_link_count 23 | - reads 24 | - score 25 | - yours 26 | - topic_id 27 | - topic_slug 28 | - topic_title 29 | - topic_html_title 30 | - category_id 31 | - display_username 32 | - version 33 | - can_edit 34 | - can_delete 35 | - can_wiki 36 | - raw 37 | - moderator 38 | - admin 39 | - staff 40 | - user_id 41 | - hidden 42 | - trust_level 43 | - user_deleted 44 | - can_view_edit_history 45 | - wiki 46 | - static_doc 47 | properties: 48 | id: 49 | type: number 50 | name: 51 | type: string 52 | minLength: 1 53 | username: 54 | type: string 55 | minLength: 1 56 | avatar_template: 57 | type: string 58 | minLength: 1 59 | created_at: 60 | type: string 61 | minLength: 1 62 | cooked: 63 | type: string 64 | minLength: 1 65 | post_number: 66 | type: number 67 | post_type: 68 | type: number 69 | updated_at: 70 | type: string 71 | minLength: 1 72 | reply_count: 73 | type: number 74 | reply_to_post_number: 75 | type: object 76 | quote_count: 77 | type: number 78 | avg_time: 79 | type: object 80 | incoming_link_count: 81 | type: number 82 | reads: 83 | type: number 84 | score: 85 | type: number 86 | yours: 87 | type: boolean 88 | topic_id: 89 | type: number 90 | topic_slug: 91 | type: string 92 | minLength: 1 93 | topic_title: 94 | type: string 95 | minLength: 1 96 | topic_html_title: 97 | type: string 98 | minLength: 1 99 | category_id: 100 | type: number 101 | display_username: 102 | type: string 103 | minLength: 1 104 | primary_group_name: 105 | type: object 106 | primary_group_flair_url: 107 | type: object 108 | primary_group_flair_bg_color: 109 | type: object 110 | primary_group_flair_color: 111 | type: object 112 | version: 113 | type: number 114 | can_edit: 115 | type: boolean 116 | can_delete: 117 | type: boolean 118 | can_recover: 119 | type: object 120 | can_wiki: 121 | type: boolean 122 | user_title: 123 | type: object 124 | raw: 125 | type: string 126 | minLength: 1 127 | actions_summary: 128 | type: array 129 | uniqueItems: true 130 | minItems: 1 131 | items: 132 | required: 133 | - id 134 | - hidden 135 | - can_act 136 | properties: 137 | id: 138 | type: number 139 | hidden: 140 | type: boolean 141 | can_act: 142 | type: boolean 143 | moderator: 144 | type: boolean 145 | admin: 146 | type: boolean 147 | staff: 148 | type: boolean 149 | user_id: 150 | type: number 151 | hidden: 152 | type: boolean 153 | trust_level: 154 | type: number 155 | deleted_at: 156 | type: object 157 | user_deleted: 158 | type: boolean 159 | edit_reason: 160 | type: object 161 | can_view_edit_history: 162 | type: boolean 163 | wiki: 164 | type: boolean 165 | static_doc: 166 | type: boolean 167 | -------------------------------------------------------------------------------- /definitions/posts/update_post_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | post: 5 | type: object 6 | properties: 7 | id: 8 | type: number 9 | name: 10 | type: string 11 | username: 12 | type: string 13 | minLength: 1 14 | avatar_template: 15 | type: string 16 | minLength: 1 17 | created_at: 18 | type: string 19 | minLength: 1 20 | cooked: 21 | type: string 22 | minLength: 1 23 | post_number: 24 | type: number 25 | post_type: 26 | type: number 27 | updated_at: 28 | type: string 29 | minLength: 1 30 | reply_count: 31 | type: number 32 | reply_to_post_number: 33 | type: object 34 | quote_count: 35 | type: number 36 | avg_time: 37 | type: object 38 | incoming_link_count: 39 | type: number 40 | reads: 41 | type: number 42 | score: 43 | type: number 44 | yours: 45 | type: boolean 46 | topic_id: 47 | type: number 48 | topic_slug: 49 | type: string 50 | minLength: 1 51 | display_username: 52 | type: string 53 | primary_group_name: 54 | type: object 55 | primary_group_flair_url: 56 | type: object 57 | primary_group_flair_bg_color: 58 | type: object 59 | primary_group_flair_color: 60 | type: object 61 | version: 62 | type: number 63 | can_edit: 64 | type: boolean 65 | can_delete: 66 | type: boolean 67 | can_recover: 68 | type: boolean 69 | can_wiki: 70 | type: boolean 71 | user_title: 72 | type: object 73 | actions_summary: 74 | type: array 75 | uniqueItems: true 76 | minItems: 1 77 | items: 78 | required: 79 | - id 80 | - hidden 81 | - can_act 82 | properties: 83 | id: 84 | type: number 85 | hidden: 86 | type: boolean 87 | can_act: 88 | type: boolean 89 | moderator: 90 | type: boolean 91 | admin: 92 | type: boolean 93 | staff: 94 | type: boolean 95 | user_id: 96 | type: number 97 | draft_sequence: 98 | type: number 99 | hidden: 100 | type: boolean 101 | hidden_reason_id: 102 | type: object 103 | trust_level: 104 | type: number 105 | deleted_at: 106 | type: object 107 | user_deleted: 108 | type: boolean 109 | edit_reason: 110 | type: object 111 | can_view_edit_history: 112 | type: boolean 113 | wiki: 114 | type: boolean 115 | required: 116 | - id 117 | - name 118 | - username 119 | - avatar_template 120 | - created_at 121 | - cooked 122 | - post_number 123 | - post_type 124 | - updated_at 125 | - reply_count 126 | - quote_count 127 | - incoming_link_count 128 | - reads 129 | - score 130 | - yours 131 | - topic_id 132 | - topic_slug 133 | - display_username 134 | - version 135 | - can_edit 136 | - can_delete 137 | - can_recover 138 | - can_wiki 139 | - actions_summary 140 | - moderator 141 | - admin 142 | - staff 143 | - user_id 144 | - draft_sequence 145 | - hidden 146 | - trust_level 147 | - user_deleted 148 | - can_view_edit_history 149 | - wiki 150 | -------------------------------------------------------------------------------- /definitions/search/query_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | posts: 5 | type: array 6 | uniqueItems: true 7 | minItems: 1 8 | items: 9 | required: 10 | - id 11 | - username 12 | - avatar_template 13 | - created_at 14 | - cooked 15 | - like_count 16 | - blurb 17 | - post_number 18 | - topic_id 19 | type: object 20 | properties: 21 | id: 22 | type: number 23 | name: 24 | type: object 25 | username: 26 | type: string 27 | minLength: 1 28 | avatar_template: 29 | type: string 30 | minLength: 1 31 | created_at: 32 | type: string 33 | minLength: 1 34 | cooked: 35 | type: string 36 | minLength: 1 37 | like_count: 38 | type: number 39 | blurb: 40 | type: string 41 | minLength: 1 42 | post_number: 43 | type: number 44 | topic_id: 45 | type: number 46 | topics: 47 | type: array 48 | uniqueItems: true 49 | minItems: 1 50 | items: 51 | required: 52 | - id 53 | - title 54 | - fancy_title 55 | - slug 56 | - posts_count 57 | - reply_count 58 | - highest_post_number 59 | - created_at 60 | - last_posted_at 61 | - bumped 62 | - bumped_at 63 | - unseen 64 | - pinned 65 | - visible 66 | - closed 67 | - archived 68 | - views 69 | - like_count 70 | - has_summary 71 | - archetype 72 | - category_id 73 | - pinned_globally 74 | type: object 75 | properties: 76 | id: 77 | type: number 78 | title: 79 | type: string 80 | minLength: 1 81 | fancy_title: 82 | type: string 83 | minLength: 1 84 | slug: 85 | type: string 86 | minLength: 1 87 | posts_count: 88 | type: number 89 | reply_count: 90 | type: number 91 | highest_post_number: 92 | type: number 93 | image_url: 94 | type: object 95 | created_at: 96 | type: string 97 | minLength: 1 98 | last_posted_at: 99 | type: string 100 | minLength: 1 101 | bumped: 102 | type: boolean 103 | bumped_at: 104 | type: string 105 | minLength: 1 106 | unseen: 107 | type: boolean 108 | pinned: 109 | type: boolean 110 | unpinned: 111 | type: object 112 | visible: 113 | type: boolean 114 | closed: 115 | type: boolean 116 | archived: 117 | type: boolean 118 | bookmarked: 119 | type: object 120 | liked: 121 | type: object 122 | views: 123 | type: number 124 | like_count: 125 | type: number 126 | has_summary: 127 | type: boolean 128 | archetype: 129 | type: string 130 | minLength: 1 131 | last_poster_username: 132 | type: object 133 | category_id: 134 | type: number 135 | pinned_globally: 136 | type: boolean 137 | posters: 138 | type: array 139 | uniqueItems: null 140 | minItems: null 141 | items: 142 | type: object 143 | users: 144 | type: array 145 | uniqueItems: null 146 | minItems: null 147 | items: 148 | type: object 149 | categories: 150 | type: array 151 | uniqueItems: null 152 | minItems: null 153 | items: 154 | type: object 155 | grouped_search_result: 156 | type: object 157 | properties: 158 | more_posts: 159 | type: object 160 | more_users: 161 | type: object 162 | more_categories: 163 | type: object 164 | post_ids: 165 | type: array 166 | uniqueItems: null 167 | minItems: null 168 | items: 169 | type: object 170 | user_ids: 171 | type: array 172 | uniqueItems: null 173 | minItems: null 174 | items: 175 | type: object 176 | category_ids: 177 | type: array 178 | uniqueItems: null 179 | minItems: null 180 | items: 181 | type: object 182 | required: 183 | - post_ids 184 | - user_ids 185 | - category_ids 186 | -------------------------------------------------------------------------------- /definitions/topics/invite.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | user: 5 | type: object 6 | properties: 7 | id: 8 | type: number 9 | username: 10 | type: string 11 | minLength: 1 12 | avatar_template: 13 | type: string 14 | minLength: 1 15 | required: 16 | - id 17 | - username 18 | - avatar_template 19 | -------------------------------------------------------------------------------- /definitions/topics/latest_topics_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | users: 5 | type: array 6 | items: 7 | type: object 8 | properties: 9 | id: 10 | type: integer 11 | username: 12 | type: string 13 | avatar_template: 14 | type: string 15 | topic_list: 16 | type: object 17 | properties: 18 | can_create_topic: 19 | type: boolean 20 | draft: 21 | type: object 22 | draft_key: 23 | type: string 24 | minLength: 1 25 | draft_sequence: 26 | type: object 27 | per_page: 28 | type: integer 29 | topics: 30 | type: array 31 | uniqueItems: true 32 | minItems: 1 33 | items: 34 | required: 35 | - id 36 | - title 37 | - fancy_title 38 | - slug 39 | - posts_count 40 | - reply_count 41 | - highest_post_number 42 | - created_at 43 | - last_posted_at 44 | - bumped 45 | - bumped_at 46 | - unseen 47 | - pinned 48 | - excerpt 49 | - visible 50 | - closed 51 | - archived 52 | - views 53 | - like_count 54 | - has_summary 55 | - archetype 56 | - last_poster_username 57 | - category_id 58 | - pinned_globally 59 | type: object 60 | properties: 61 | id: 62 | type: integer 63 | title: 64 | type: string 65 | minLength: 1 66 | fancy_title: 67 | type: string 68 | minLength: 1 69 | slug: 70 | type: string 71 | minLength: 1 72 | posts_count: 73 | type: integer 74 | reply_count: 75 | type: integer 76 | highest_post_number: 77 | type: integer 78 | image_url: 79 | type: object 80 | created_at: 81 | type: string 82 | minLength: 1 83 | last_posted_at: 84 | type: string 85 | minLength: 1 86 | bumped: 87 | type: boolean 88 | bumped_at: 89 | type: string 90 | minLength: 1 91 | unseen: 92 | type: boolean 93 | pinned: 94 | type: boolean 95 | unpinned: 96 | type: object 97 | excerpt: 98 | type: string 99 | minLength: 1 100 | visible: 101 | type: boolean 102 | closed: 103 | type: boolean 104 | archived: 105 | type: boolean 106 | bookmarked: 107 | type: object 108 | liked: 109 | type: object 110 | views: 111 | type: integer 112 | like_count: 113 | type: integer 114 | has_summary: 115 | type: boolean 116 | archetype: 117 | type: string 118 | minLength: 1 119 | last_poster_username: 120 | type: string 121 | minLength: 1 122 | category_id: 123 | type: integer 124 | pinned_globally: 125 | type: boolean 126 | posters: 127 | type: array 128 | uniqueItems: true 129 | minItems: 1 130 | items: 131 | required: 132 | - extras 133 | - description 134 | - user_id 135 | type: object 136 | properties: 137 | extras: 138 | type: string 139 | minLength: 1 140 | description: 141 | type: string 142 | minLength: 1 143 | user_id: 144 | type: integer 145 | required: 146 | - can_create_topic 147 | - draft_key 148 | - per_page 149 | - topics 150 | -------------------------------------------------------------------------------- /definitions/topics/new_topic.yml: -------------------------------------------------------------------------------- 1 | # new_topic 2 | type: object 3 | required: 4 | - title 5 | - raw 6 | properties: 7 | title: 8 | type: string 9 | raw: 10 | type: string 11 | -------------------------------------------------------------------------------- /definitions/topics/new_topic_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | id: 5 | type: number 6 | name: 7 | type: string 8 | username: 9 | type: string 10 | minLength: 1 11 | avatar_template: 12 | type: string 13 | minLength: 1 14 | created_at: 15 | type: string 16 | minLength: 1 17 | cooked: 18 | type: string 19 | minLength: 1 20 | post_number: 21 | type: number 22 | post_type: 23 | type: number 24 | updated_at: 25 | type: string 26 | minLength: 1 27 | reply_count: 28 | type: number 29 | reply_to_post_number: 30 | type: null 31 | quote_count: 32 | type: number 33 | avg_time: 34 | type: null 35 | incoming_link_count: 36 | type: number 37 | reads: 38 | type: number 39 | score: 40 | type: number 41 | yours: 42 | type: boolean 43 | topic_id: 44 | type: number 45 | topic_slug: 46 | type: string 47 | minLength: 1 48 | display_username: 49 | type: string 50 | primary_group_name: 51 | type: null 52 | primary_group_flair_url: 53 | type: null 54 | primary_group_flair_bg_color: 55 | type: null 56 | primary_group_flair_color: 57 | type: null 58 | version: 59 | type: number 60 | can_edit: 61 | type: boolean 62 | can_delete: 63 | type: boolean 64 | can_recover: 65 | type: boolean 66 | can_wiki: 67 | type: boolean 68 | user_title: 69 | type: null 70 | actions_summary: 71 | type: array 72 | uniqueItems: true 73 | minItems: 1 74 | items: 75 | required: 76 | - id 77 | - hidden 78 | - can_act 79 | properties: 80 | id: 81 | type: number 82 | hidden: 83 | type: boolean 84 | can_act: 85 | type: boolean 86 | moderator: 87 | type: boolean 88 | admin: 89 | type: boolean 90 | staff: 91 | type: boolean 92 | user_id: 93 | type: number 94 | draft_sequence: 95 | type: number 96 | hidden: 97 | type: boolean 98 | hidden_reason_id: 99 | type: null 100 | trust_level: 101 | type: number 102 | deleted_at: 103 | type: null 104 | user_deleted: 105 | type: boolean 106 | edit_reason: 107 | type: null 108 | can_view_edit_history: 109 | type: boolean 110 | wiki: 111 | type: boolean 112 | -------------------------------------------------------------------------------- /definitions/topics/private-messages-sent.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | users: 5 | type: array 6 | uniqueItems: true 7 | minItems: 1 8 | items: 9 | required: 10 | - id 11 | - username 12 | - avatar_template 13 | properties: 14 | id: 15 | type: number 16 | username: 17 | type: string 18 | minLength: 1 19 | avatar_template: 20 | type: string 21 | minLength: 1 22 | topic_list: 23 | type: object 24 | properties: 25 | can_create_topic: 26 | type: boolean 27 | draft: 28 | type: object 29 | draft_key: 30 | type: string 31 | minLength: 1 32 | draft_sequence: 33 | type: number 34 | per_page: 35 | type: number 36 | topics: 37 | type: array 38 | uniqueItems: true 39 | minItems: 1 40 | items: 41 | required: 42 | - id 43 | - title 44 | - fancy_title 45 | - slug 46 | - posts_count 47 | - reply_count 48 | - highest_post_number 49 | - created_at 50 | - last_posted_at 51 | - bumped 52 | - bumped_at 53 | - unseen 54 | - last_read_post_number 55 | - unread 56 | - new_posts 57 | - pinned 58 | - visible 59 | - closed 60 | - archived 61 | - notification_level 62 | - bookmarked 63 | - liked 64 | - views 65 | - like_count 66 | - has_summary 67 | - archetype 68 | - last_poster_username 69 | - pinned_globally 70 | properties: 71 | id: 72 | type: number 73 | title: 74 | type: string 75 | minLength: 1 76 | fancy_title: 77 | type: string 78 | minLength: 1 79 | slug: 80 | type: string 81 | minLength: 1 82 | posts_count: 83 | type: number 84 | reply_count: 85 | type: number 86 | highest_post_number: 87 | type: number 88 | image_url: 89 | type: object 90 | created_at: 91 | type: string 92 | minLength: 1 93 | last_posted_at: 94 | type: string 95 | minLength: 1 96 | bumped: 97 | type: boolean 98 | bumped_at: 99 | type: string 100 | minLength: 1 101 | unseen: 102 | type: boolean 103 | last_read_post_number: 104 | type: number 105 | unread: 106 | type: number 107 | new_posts: 108 | type: number 109 | pinned: 110 | type: boolean 111 | unpinned: 112 | type: object 113 | visible: 114 | type: boolean 115 | closed: 116 | type: boolean 117 | archived: 118 | type: boolean 119 | notification_level: 120 | type: number 121 | bookmarked: 122 | type: boolean 123 | liked: 124 | type: boolean 125 | views: 126 | type: number 127 | like_count: 128 | type: number 129 | has_summary: 130 | type: boolean 131 | archetype: 132 | type: string 133 | minLength: 1 134 | last_poster_username: 135 | type: string 136 | minLength: 1 137 | category_id: 138 | type: object 139 | pinned_globally: 140 | type: boolean 141 | posters: 142 | type: array 143 | uniqueItems: true 144 | minItems: 1 145 | items: 146 | required: 147 | - extras 148 | - description 149 | - user_id 150 | properties: 151 | extras: 152 | type: string 153 | minLength: 1 154 | description: 155 | type: string 156 | minLength: 1 157 | user_id: 158 | type: number 159 | participants: 160 | type: array 161 | uniqueItems: true 162 | minItems: 1 163 | items: 164 | required: 165 | - user_id 166 | properties: 167 | extras: 168 | type: object 169 | description: 170 | type: object 171 | user_id: 172 | type: number 173 | required: 174 | - can_create_topic 175 | - draft_key 176 | - draft_sequence 177 | - per_page 178 | - topics 179 | -------------------------------------------------------------------------------- /definitions/topics/private-messages.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | topic_list: 5 | type: object 6 | properties: 7 | can_create_topic: 8 | type: boolean 9 | draft: 10 | type: null 11 | draft_key: 12 | type: string 13 | minLength: 1 14 | draft_sequence: 15 | type: number 16 | per_page: 17 | type: number 18 | topics: 19 | type: array 20 | uniqueItems: true 21 | minItems: 1 22 | items: 23 | required: 24 | - id 25 | - title 26 | - fancy_title 27 | - slug 28 | - posts_count 29 | - reply_count 30 | - highest_post_number 31 | - created_at 32 | - last_posted_at 33 | - bumped 34 | - bumped_at 35 | - unseen 36 | - last_read_post_number 37 | - unread 38 | - new_posts 39 | - pinned 40 | - visible 41 | - closed 42 | - archived 43 | - notification_level 44 | - bookmarked 45 | - liked 46 | - views 47 | - like_count 48 | - has_summary 49 | - archetype 50 | - last_poster_username 51 | - pinned_globally 52 | properties: 53 | id: 54 | type: number 55 | title: 56 | type: string 57 | minLength: 1 58 | fancy_title: 59 | type: string 60 | minLength: 1 61 | slug: 62 | type: string 63 | minLength: 1 64 | posts_count: 65 | type: number 66 | reply_count: 67 | type: number 68 | highest_post_number: 69 | type: number 70 | image_url: 71 | type: object 72 | created_at: 73 | type: string 74 | minLength: 1 75 | last_posted_at: 76 | type: string 77 | minLength: 1 78 | bumped: 79 | type: boolean 80 | bumped_at: 81 | type: string 82 | minLength: 1 83 | unseen: 84 | type: boolean 85 | last_read_post_number: 86 | type: number 87 | unread: 88 | type: number 89 | new_posts: 90 | type: number 91 | pinned: 92 | type: boolean 93 | unpinned: 94 | type: object 95 | visible: 96 | type: boolean 97 | closed: 98 | type: boolean 99 | archived: 100 | type: boolean 101 | notification_level: 102 | type: number 103 | bookmarked: 104 | type: boolean 105 | liked: 106 | type: boolean 107 | views: 108 | type: number 109 | like_count: 110 | type: number 111 | has_summary: 112 | type: boolean 113 | archetype: 114 | type: string 115 | minLength: 1 116 | last_poster_username: 117 | type: string 118 | minLength: 1 119 | category_id: 120 | type: object 121 | pinned_globally: 122 | type: boolean 123 | posters: 124 | type: array 125 | uniqueItems: true 126 | minItems: 1 127 | items: 128 | required: 129 | - extras 130 | - description 131 | - user_id 132 | properties: 133 | extras: 134 | type: string 135 | minLength: 1 136 | description: 137 | type: string 138 | minLength: 1 139 | user_id: 140 | type: number 141 | participants: 142 | type: array 143 | uniqueItems: true 144 | minItems: 1 145 | items: 146 | required: 147 | - user_id 148 | properties: 149 | extras: 150 | type: object 151 | description: 152 | type: object 153 | user_id: 154 | type: number 155 | required: 156 | - can_create_topic 157 | - draft_key 158 | - draft_sequence 159 | - per_page 160 | - topics 161 | -------------------------------------------------------------------------------- /definitions/topics/top.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | users: 5 | type: array 6 | uniqueItems: true 7 | minItems: 1 8 | items: 9 | required: 10 | - id 11 | - username 12 | - avatar_template 13 | properties: 14 | id: 15 | type: number 16 | username: 17 | type: string 18 | minLength: 1 19 | avatar_template: 20 | type: string 21 | minLength: 1 22 | topic_list: 23 | type: object 24 | properties: 25 | can_create_topic: 26 | type: boolean 27 | draft: 28 | type: object 29 | draft_key: 30 | type: string 31 | minLength: 1 32 | draft_sequence: 33 | type: number 34 | for_period: 35 | type: string 36 | minLength: 1 37 | per_page: 38 | type: number 39 | topics: 40 | type: array 41 | uniqueItems: true 42 | minItems: 1 43 | items: 44 | required: 45 | - id 46 | - title 47 | - fancy_title 48 | - slug 49 | - posts_count 50 | - reply_count 51 | - highest_post_number 52 | - created_at 53 | - last_posted_at 54 | - bumped 55 | - bumped_at 56 | - unseen 57 | - last_read_post_number 58 | - unread 59 | - new_posts 60 | - pinned 61 | - visible 62 | - closed 63 | - archived 64 | - notification_level 65 | - bookmarked 66 | - liked 67 | - views 68 | - like_count 69 | - has_summary 70 | - archetype 71 | - last_poster_username 72 | - category_id 73 | - pinned_globally 74 | properties: 75 | id: 76 | type: number 77 | title: 78 | type: string 79 | minLength: 1 80 | fancy_title: 81 | type: string 82 | minLength: 1 83 | slug: 84 | type: string 85 | minLength: 1 86 | posts_count: 87 | type: number 88 | reply_count: 89 | type: number 90 | highest_post_number: 91 | type: number 92 | image_url: 93 | type: object 94 | created_at: 95 | type: string 96 | minLength: 1 97 | last_posted_at: 98 | type: string 99 | minLength: 1 100 | bumped: 101 | type: boolean 102 | bumped_at: 103 | type: string 104 | minLength: 1 105 | unseen: 106 | type: boolean 107 | last_read_post_number: 108 | type: number 109 | unread: 110 | type: number 111 | new_posts: 112 | type: number 113 | pinned: 114 | type: boolean 115 | unpinned: 116 | type: object 117 | visible: 118 | type: boolean 119 | closed: 120 | type: boolean 121 | archived: 122 | type: boolean 123 | notification_level: 124 | type: number 125 | bookmarked: 126 | type: boolean 127 | liked: 128 | type: boolean 129 | views: 130 | type: number 131 | like_count: 132 | type: number 133 | has_summary: 134 | type: boolean 135 | archetype: 136 | type: string 137 | minLength: 1 138 | last_poster_username: 139 | type: string 140 | minLength: 1 141 | category_id: 142 | type: number 143 | pinned_globally: 144 | type: boolean 145 | posters: 146 | type: array 147 | uniqueItems: true 148 | minItems: 1 149 | items: 150 | required: 151 | - extras 152 | - description 153 | - user_id 154 | properties: 155 | extras: 156 | type: string 157 | minLength: 1 158 | description: 159 | type: string 160 | minLength: 1 161 | user_id: 162 | type: number 163 | required: 164 | - can_create_topic 165 | - draft_key 166 | - draft_sequence 167 | - for_period 168 | - per_page 169 | - topics 170 | -------------------------------------------------------------------------------- /definitions/topics/topic_response.yml: -------------------------------------------------------------------------------- 1 | type: object 2 | properties: 3 | post_stream: 4 | type: object 5 | properties: 6 | posts: 7 | type: array 8 | items: 9 | type: object 10 | properties: 11 | id: 12 | type: number 13 | name: 14 | type: string 15 | username: 16 | type: string 17 | minLength: 1 18 | avatar_template: 19 | type: string 20 | minLength: 1 21 | created_at: 22 | type: string 23 | minLength: 1 24 | cooked: 25 | type: string 26 | minLength: 1 27 | post_number: 28 | type: number 29 | post_type: 30 | type: number 31 | updated_at: 32 | type: string 33 | minLength: 1 34 | reply_count: 35 | type: number 36 | reply_to_post_number: 37 | type: object 38 | quote_count: 39 | type: number 40 | avg_time: 41 | type: object 42 | incoming_link_count: 43 | type: number 44 | reads: 45 | type: number 46 | score: 47 | type: number 48 | yours: 49 | type: boolean 50 | topic_id: 51 | type: number 52 | topic_slug: 53 | type: string 54 | minLength: 1 55 | display_username: 56 | type: string 57 | primary_group_name: 58 | type: object 59 | primary_group_flair_url: 60 | type: object 61 | primary_group_flair_bg_color: 62 | type: object 63 | primary_group_flair_color: 64 | type: object 65 | version: 66 | type: number 67 | can_edit: 68 | type: boolean 69 | can_delete: 70 | type: boolean 71 | can_recover: 72 | type: boolean 73 | can_wiki: 74 | type: boolean 75 | read: 76 | type: boolean 77 | user_title: 78 | type: object 79 | actions_summary: 80 | type: array 81 | uniqueItems: null 82 | minItems: null 83 | items: 84 | type: object 85 | moderator: 86 | type: boolean 87 | admin: 88 | type: boolean 89 | staff: 90 | type: boolean 91 | user_id: 92 | type: number 93 | hidden: 94 | type: boolean 95 | hidden_reason_id: 96 | type: object 97 | trust_level: 98 | type: number 99 | deleted_at: 100 | type: object 101 | user_deleted: 102 | type: boolean 103 | edit_reason: 104 | type: object 105 | can_view_edit_history: 106 | type: boolean 107 | wiki: 108 | type: boolean 109 | polls: 110 | type: object 111 | properties: 112 | poll: 113 | type: object 114 | properties: 115 | options: 116 | type: array 117 | items: 118 | type: object 119 | properties: 120 | id: 121 | type: string 122 | html: 123 | type: string 124 | votes: 125 | type: integer 126 | voters: 127 | type: integer 128 | status: 129 | type: string 130 | name: 131 | type: string 132 | type: 133 | type: string 134 | polls_votes: 135 | type: object 136 | properties: 137 | poll: 138 | type: array 139 | items: 140 | type: string 141 | stream: 142 | type: array 143 | uniqueItems: null 144 | minItems: null 145 | items: 146 | type: object 147 | required: 148 | - posts 149 | - stream 150 | timeline_lookup: 151 | type: array 152 | uniqueItems: null 153 | minItems: null 154 | items: 155 | properties: 156 | '0': 157 | type: array 158 | uniqueItems: true 159 | minItems: null 160 | items: 161 | type: object 162 | id: 163 | type: number 164 | title: 165 | type: string 166 | minLength: 1 167 | fancy_title: 168 | type: string 169 | minLength: 1 170 | posts_count: 171 | type: number 172 | created_at: 173 | type: string 174 | minLength: 1 175 | views: 176 | type: number 177 | reply_count: 178 | type: number 179 | participant_count: 180 | type: number 181 | like_count: 182 | type: number 183 | last_posted_at: 184 | type: object 185 | visible: 186 | type: boolean 187 | closed: 188 | type: boolean 189 | archived: 190 | type: boolean 191 | has_summary: 192 | type: boolean 193 | archetype: 194 | type: string 195 | minLength: 1 196 | slug: 197 | type: string 198 | minLength: 1 199 | category_id: 200 | type: number 201 | word_count: 202 | type: object 203 | deleted_at: 204 | type: object 205 | user_id: 206 | type: number 207 | draft: 208 | type: object 209 | draft_key: 210 | type: string 211 | minLength: 1 212 | draft_sequence: 213 | type: object 214 | unpinned: 215 | type: object 216 | pinned_globally: 217 | type: boolean 218 | pinned: 219 | type: boolean 220 | pinned_at: 221 | type: string 222 | minLength: 1 223 | pinned_until: 224 | type: object 225 | details: 226 | type: object 227 | properties: 228 | auto_close_at: 229 | type: object 230 | auto_close_hours: 231 | type: object 232 | auto_close_based_on_last_post: 233 | type: boolean 234 | created_by: 235 | type: object 236 | properties: 237 | id: 238 | type: number 239 | username: 240 | type: string 241 | minLength: 1 242 | avatar_template: 243 | type: string 244 | minLength: 1 245 | required: 246 | - id 247 | - username 248 | - avatar_template 249 | last_poster: 250 | type: object 251 | properties: 252 | id: 253 | type: number 254 | username: 255 | type: string 256 | minLength: 1 257 | avatar_template: 258 | type: string 259 | minLength: 1 260 | required: 261 | - id 262 | - username 263 | - avatar_template 264 | participants: 265 | type: array 266 | uniqueItems: true 267 | minItems: 1 268 | items: 269 | required: 270 | - id 271 | - username 272 | - avatar_template 273 | - post_count 274 | properties: 275 | id: 276 | type: number 277 | username: 278 | type: string 279 | minLength: 1 280 | avatar_template: 281 | type: string 282 | minLength: 1 283 | post_count: 284 | type: number 285 | suggested_topics: 286 | type: array 287 | uniqueItems: true 288 | minItems: 1 289 | items: 290 | required: 291 | - id 292 | - title 293 | - fancy_title 294 | - slug 295 | - posts_count 296 | - reply_count 297 | - highest_post_number 298 | - image_url 299 | - created_at 300 | - last_posted_at 301 | - bumped 302 | - bumped_at 303 | - unseen 304 | - pinned 305 | - excerpt 306 | - visible 307 | - closed 308 | - archived 309 | - archetype 310 | - like_count 311 | - views 312 | - category_id 313 | properties: 314 | id: 315 | type: number 316 | title: 317 | type: string 318 | minLength: 1 319 | fancy_title: 320 | type: string 321 | minLength: 1 322 | slug: 323 | type: string 324 | minLength: 1 325 | posts_count: 326 | type: number 327 | reply_count: 328 | type: number 329 | highest_post_number: 330 | type: number 331 | image_url: 332 | type: string 333 | minLength: 1 334 | created_at: 335 | type: string 336 | minLength: 1 337 | last_posted_at: 338 | type: string 339 | minLength: 1 340 | bumped: 341 | type: boolean 342 | bumped_at: 343 | type: string 344 | minLength: 1 345 | unseen: 346 | type: boolean 347 | pinned: 348 | type: boolean 349 | unpinned: 350 | type: object 351 | excerpt: 352 | type: string 353 | minLength: 1 354 | visible: 355 | type: boolean 356 | closed: 357 | type: boolean 358 | archived: 359 | type: boolean 360 | bookmarked: 361 | type: object 362 | liked: 363 | type: object 364 | archetype: 365 | type: string 366 | minLength: 1 367 | like_count: 368 | type: number 369 | views: 370 | type: number 371 | category_id: 372 | type: number 373 | posters: 374 | type: array 375 | uniqueItems: true 376 | minItems: 1 377 | items: 378 | required: 379 | - extras 380 | - description 381 | properties: 382 | extras: 383 | type: string 384 | minLength: 1 385 | description: 386 | type: string 387 | minLength: 1 388 | user: 389 | type: object 390 | properties: 391 | id: 392 | type: number 393 | username: 394 | type: string 395 | minLength: 1 396 | avatar_template: 397 | type: string 398 | minLength: 1 399 | required: 400 | - id 401 | - username 402 | - avatar_template 403 | notification_level: 404 | type: number 405 | can_flag_topic: 406 | type: boolean 407 | required: 408 | - auto_close_based_on_last_post 409 | - created_by 410 | - last_poster 411 | - participants 412 | - suggested_topics 413 | - notification_level 414 | - can_flag_topic 415 | highest_post_number: 416 | type: number 417 | deleted_by: 418 | type: object 419 | actions_summary: 420 | type: array 421 | uniqueItems: true 422 | minItems: 1 423 | items: 424 | required: 425 | - id 426 | - count 427 | - hidden 428 | - can_act 429 | properties: 430 | id: 431 | type: number 432 | count: 433 | type: number 434 | hidden: 435 | type: boolean 436 | can_act: 437 | type: boolean 438 | chunk_size: 439 | type: number 440 | bookmarked: 441 | type: object 442 | -------------------------------------------------------------------------------- /definitions/topics/update_topic.yml: -------------------------------------------------------------------------------- 1 | # update_topic 2 | type: object 3 | properties: 4 | title: 5 | type: string 6 | category_id: 7 | type: integer 8 | -------------------------------------------------------------------------------- /definitions/topics/update_topic_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | basic_topic: 5 | type: object 6 | properties: 7 | id: 8 | type: number 9 | title: 10 | type: string 11 | minLength: 1 12 | fancy_title: 13 | type: string 14 | minLength: 1 15 | slug: 16 | type: string 17 | minLength: 1 18 | posts_count: 19 | type: number 20 | required: 21 | - id 22 | - title 23 | - fancy_title 24 | - slug 25 | - posts_count 26 | -------------------------------------------------------------------------------- /definitions/users/directory_items_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | directory_items: 5 | type: array 6 | uniqueItems: true 7 | minItems: 1 8 | items: 9 | required: 10 | - id 11 | - likes_received 12 | - likes_given 13 | - topics_entered 14 | - topic_count 15 | - post_count 16 | - posts_read 17 | - days_visited 18 | properties: 19 | id: 20 | type: number 21 | likes_received: 22 | type: number 23 | likes_given: 24 | type: number 25 | topics_entered: 26 | type: number 27 | topic_count: 28 | type: number 29 | post_count: 30 | type: number 31 | posts_read: 32 | type: number 33 | days_visited: 34 | type: number 35 | user: 36 | type: object 37 | properties: 38 | id: 39 | type: number 40 | username: 41 | type: string 42 | minLength: 1 43 | avatar_template: 44 | type: string 45 | minLength: 1 46 | name: 47 | type: string 48 | minLength: 1 49 | title: 50 | type: object 51 | required: 52 | - id 53 | - username 54 | - avatar_template 55 | - name 56 | total_rows_directory_items: 57 | type: number 58 | load_more_directory_items: 59 | type: string 60 | minLength: 1 61 | -------------------------------------------------------------------------------- /definitions/users/get_user_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | user_badges: 5 | type: array 6 | uniqueItems: null 7 | minItems: null 8 | items: 9 | type: object 10 | user: 11 | type: object 12 | properties: 13 | id: 14 | type: number 15 | username: 16 | type: string 17 | minLength: 1 18 | avatar_template: 19 | type: string 20 | minLength: 1 21 | name: 22 | type: object 23 | last_posted_at: 24 | type: string 25 | minLength: 1 26 | last_seen_at: 27 | type: string 28 | minLength: 1 29 | created_at: 30 | type: string 31 | minLength: 1 32 | website_name: 33 | type: object 34 | can_edit: 35 | type: boolean 36 | can_edit_username: 37 | type: boolean 38 | can_edit_email: 39 | type: boolean 40 | can_edit_name: 41 | type: boolean 42 | can_send_private_messages: 43 | type: boolean 44 | can_send_private_message_to_user: 45 | type: boolean 46 | trust_level: 47 | type: number 48 | moderator: 49 | type: boolean 50 | admin: 51 | type: boolean 52 | title: 53 | type: object 54 | uploaded_avatar_id: 55 | type: object 56 | badge_count: 57 | type: number 58 | custom_fields: 59 | type: object 60 | pending_count: 61 | type: number 62 | profile_view_count: 63 | type: number 64 | primary_group_name: 65 | type: object 66 | primary_group_flair_url: 67 | type: object 68 | primary_group_flair_bg_color: 69 | type: object 70 | primary_group_flair_color: 71 | type: object 72 | invited_by: 73 | type: object 74 | groups: 75 | type: array 76 | uniqueItems: true 77 | minItems: 1 78 | items: 79 | required: 80 | - id 81 | - automatic 82 | - name 83 | - user_count 84 | - alias_level 85 | - visible 86 | - automatic_membership_retroactive 87 | - primary_group 88 | - has_messages 89 | - is_member 90 | - mentionable 91 | properties: 92 | id: 93 | type: number 94 | automatic: 95 | type: boolean 96 | name: 97 | type: string 98 | minLength: 1 99 | user_count: 100 | type: number 101 | alias_level: 102 | type: number 103 | visible: 104 | type: boolean 105 | automatic_membership_email_domains: 106 | type: object 107 | automatic_membership_retroactive: 108 | type: boolean 109 | primary_group: 110 | type: boolean 111 | title: 112 | type: object 113 | grant_trust_level: 114 | type: object 115 | notification_level: 116 | type: object 117 | has_messages: 118 | type: boolean 119 | is_member: 120 | type: boolean 121 | mentionable: 122 | type: boolean 123 | flair_url: 124 | type: object 125 | flair_bg_color: 126 | type: object 127 | flair_color: 128 | type: object 129 | featured_user_badge_ids: 130 | type: array 131 | uniqueItems: null 132 | minItems: null 133 | items: 134 | type: object 135 | card_badge: 136 | type: object 137 | required: 138 | - id 139 | - username 140 | - avatar_template 141 | - last_posted_at 142 | - last_seen_at 143 | - created_at 144 | - can_edit 145 | - can_edit_username 146 | - can_edit_email 147 | - can_edit_name 148 | - can_send_private_messages 149 | - can_send_private_message_to_user 150 | - trust_level 151 | - moderator 152 | - admin 153 | - badge_count 154 | - custom_fields 155 | - pending_count 156 | - profile_view_count 157 | - groups 158 | - featured_user_badge_ids 159 | -------------------------------------------------------------------------------- /definitions/users/list.yml: -------------------------------------------------------------------------------- 1 | type: array 2 | description: "" 3 | minItems: 1 4 | uniqueItems: true 5 | items: 6 | type: object 7 | properties: 8 | id: 9 | type: integer 10 | username: 11 | type: string 12 | minLength: 1 13 | avatar_template: 14 | type: string 15 | minLength: 1 16 | email: 17 | type: string 18 | minLength: 1 19 | active: 20 | type: boolean 21 | admin: 22 | type: boolean 23 | moderator: 24 | type: boolean 25 | last_seen_at: 26 | type: string 27 | minLength: 1 28 | last_emailed_at: 29 | type: string 30 | minLength: 1 31 | created_at: 32 | type: string 33 | minLength: 1 34 | last_seen_age: 35 | type: string 36 | minLength: 1 37 | last_emailed_age: 38 | type: string 39 | minLength: 1 40 | created_at_age: 41 | type: string 42 | minLength: 1 43 | username_lower: 44 | type: string 45 | minLength: 1 46 | trust_level: 47 | type: integer 48 | trust_level_locked: 49 | type: boolean 50 | flag_level: 51 | type: integer 52 | title: 53 | type: string 54 | suspended_at: 55 | type: object 56 | suspended_till: 57 | type: object 58 | suspended: 59 | type: object 60 | blocked: 61 | type: boolean 62 | time_read: 63 | type: string 64 | minLength: 1 65 | staged: 66 | type: boolean 67 | days_visited: 68 | type: integer 69 | posts_read_count: 70 | type: integer 71 | topics_entered: 72 | type: integer 73 | post_count: 74 | type: integer 75 | -------------------------------------------------------------------------------- /definitions/users/new_user.yml: -------------------------------------------------------------------------------- 1 | # new_user 2 | type: object 3 | required: 4 | - name 5 | - email 6 | - password 7 | - username 8 | properties: 9 | name: 10 | type: string 11 | email: 12 | type: string 13 | password: 14 | type: string 15 | username: 16 | type: string 17 | active: 18 | type: boolean 19 | approved: 20 | type: boolean 21 | user_fields[1]: 22 | type: string 23 | -------------------------------------------------------------------------------- /definitions/users/new_user_response.yml: -------------------------------------------------------------------------------- 1 | description: "" 2 | type: object 3 | properties: 4 | success: 5 | type: boolean 6 | active: 7 | type: boolean 8 | message: 9 | type: string 10 | minLength: 1 11 | user_id: 12 | type: number 13 | -------------------------------------------------------------------------------- /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/discourse/discourse_api_docs/b335b8ea894d0901316a15596aa0a9474d35e920/favicon.png -------------------------------------------------------------------------------- /index-versioned.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Discourse API Documentation 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 15 |

16 | Please select the version of Discourse that you are using to view the 17 | version specific API Documentation. 18 |

19 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Discourse API Docs 5 | 6 | 7 | 8 | 9 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | pre-commit: 2 | parallel: true 3 | commands: 4 | openapi-lint: 5 | run: node tojson.js && npx @redocly/openapi-cli lint openapi.json 6 | -------------------------------------------------------------------------------- /local.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ReDoc 5 | 6 | 7 | 8 | 9 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /openapi_changed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | node tojson.js 4 | echo "JSON regenerated from openapi.yml!" 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discourse_api_docs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node server.js" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/discourse/discourse_api_docs.git" 13 | }, 14 | "author": "", 15 | "license": "MIT", 16 | "bugs": { 17 | "url": "https://meta.discourse.org" 18 | }, 19 | "homepage": "https://github.com/discourse/discourse_api_docs#readme", 20 | "dependencies": { 21 | "express": "^4.21.2", 22 | "json-schema-generator": "^2.0.6", 23 | "json-schema-ref-parser": "^6.0.1", 24 | "yamljs": "^0.3.0" 25 | }, 26 | "devDependencies": { 27 | "@arkweid/lefthook": "^0.7.6" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /postman/discourse_local.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "84658f2a-e4c4-a286-175f-53c4397e6f94", 3 | "name": "discourse_local", 4 | "values": [ 5 | { 6 | "key": "base_url", 7 | "value": "http://192.241.255.58", 8 | "type": "text", 9 | "enabled": true 10 | }, 11 | { 12 | "key": "api_key", 13 | "value": "b20187086011a04bd48975c5f2d003591e92d1e44ba78da7a3606f6a118a4d0c", 14 | "type": "text", 15 | "enabled": true 16 | }, 17 | { 18 | "key": "api_username", 19 | "value": "discourse1", 20 | "type": "text", 21 | "enabled": true 22 | } 23 | ], 24 | "timestamp": 1474811514559, 25 | "_postman_variable_scope": "environment", 26 | "_postman_exported_at": "2016-09-25T13:59:23.091Z", 27 | "_postman_exported_using": "Postman/4.7.2" 28 | } 29 | -------------------------------------------------------------------------------- /responses/admin/generate_api_key.json: -------------------------------------------------------------------------------- 1 | { 2 | "api_key": { 3 | "id": 2, 4 | "key": "342397cb620049d4f5b5f66ce9a26cd674de757e3c982cc41125bc47dac29a37", 5 | "user": { 6 | "id": 4, 7 | "username": "discourse2", 8 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/4af34b/{size}.png" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /responses/admin/get_badges.json: -------------------------------------------------------------------------------- 1 | { 2 | "badges": [ 3 | { 4 | "id": 9, 5 | "name": "Autobiographer", 6 | "description": "Filled out profile information", 7 | "grant_count": 0, 8 | "allow_title": false, 9 | "multiple_grant": false, 10 | "icon": "fa-certificate", 11 | "image": null, 12 | "listable": true, 13 | "enabled": true, 14 | "badge_grouping_id": 1, 15 | "system": true, 16 | "long_description": "This badge is granted for filling out your user profile and selecting a profile picture. Letting the community know a bit more about who you are and what you're interested in makes for a better, more connected community. Join us!\n", 17 | "slug": "autobiographer", 18 | "query": " SELECT u.id user_id, current_timestamp granted_at\n FROM users u\n JOIN user_profiles up on u.id = up.user_id\n WHERE bio_raw IS NOT NULL AND LENGTH(TRIM(bio_raw)) > 10 AND\n uploaded_avatar_id IS NOT NULL AND\n (:backfill OR u.id IN (:user_ids) )\n", 19 | "trigger": 8, 20 | "target_posts": false, 21 | "auto_revoke": true, 22 | "show_posts": false, 23 | "badge_type_id": 3 24 | }, 25 | { 26 | "id": 10, 27 | "name": "Editor", 28 | "description": "First post edit", 29 | "grant_count": 1, 30 | "allow_title": false, 31 | "multiple_grant": false, 32 | "icon": "fa-certificate", 33 | "image": null, 34 | "listable": true, 35 | "enabled": true, 36 | "badge_grouping_id": 1, 37 | "system": true, 38 | "long_description": "This badge is granted the first time you edit one of your posts. While you won't be able to edit your posts forever, editing is always a good idea — you can improve your posts, fix small mistakes, or add anything you missed when you originally posted. Edit to make your posts even better!\n", 39 | "slug": "editor", 40 | "query": " SELECT p.user_id, min(p.id) post_id, min(p.created_at) granted_at\n FROM badge_posts p\n WHERE p.self_edits > 0 AND\n (:backfill OR p.id IN (:post_ids) )\n GROUP BY p.user_id\n", 41 | "trigger": 2, 42 | "target_posts": false, 43 | "auto_revoke": true, 44 | "show_posts": false, 45 | "badge_type_id": 3 46 | }, 47 | { 48 | "id": 41, 49 | "name": "First Emoji", 50 | "description": "Used an Emoji in a Post", 51 | "grant_count": 2, 52 | "allow_title": false, 53 | "multiple_grant": false, 54 | "icon": "fa-certificate", 55 | "image": null, 56 | "listable": true, 57 | "enabled": true, 58 | "badge_grouping_id": 1, 59 | "system": true, 60 | "long_description": "This badge is granted the first time you add an Emoji to your post :thumbsup:. Emoji let you convey emotion in your posts, from happiness :smiley: to sadness :anguished: to anger :angry: and everything in between :sunglasses: . Just type a : (colon) or press the Emoji toolbar button in the editor to select from hundreds of choices :ok_hand:\n", 61 | "slug": "first-emoji", 62 | "query": null, 63 | "trigger": 0, 64 | "target_posts": true, 65 | "auto_revoke": true, 66 | "show_posts": true, 67 | "badge_type_id": 3 68 | }, 69 | { 70 | "id": 13, 71 | "name": "First Flag", 72 | "description": "Flagged a post", 73 | "grant_count": 0, 74 | "allow_title": false, 75 | "multiple_grant": false, 76 | "icon": "fa-certificate", 77 | "image": null, 78 | "listable": true, 79 | "enabled": true, 80 | "badge_grouping_id": 1, 81 | "system": true, 82 | "long_description": "This badge is granted the first time you flag a post. Flagging is how we all help keep this a clean, well lit place for everyone. If you notice any posts that require moderator attention for any reason please don't hesitate to flag. You can also flag to send personal messages to fellow users if you see an issue with their post. If you see a problem, :flag_black: flag it!\n", 83 | "slug": "first-flag", 84 | "query": " SELECT pa1.user_id, pa1.created_at granted_at, pa1.post_id\n FROM (\n SELECT pa.user_id, min(pa.id) id\n FROM post_actions pa\n JOIN badge_posts p on p.id = pa.post_id\n WHERE post_action_type_id IN (3,4,7,8) AND\n (:backfill OR pa.post_id IN (:post_ids) )\n GROUP BY pa.user_id\n ) x\n JOIN post_actions pa1 on pa1.id = x.id\n", 85 | "trigger": 1, 86 | "target_posts": true, 87 | "auto_revoke": false, 88 | "show_posts": false, 89 | "badge_type_id": 3 90 | }, 91 | { 92 | "id": 11, 93 | "name": "First Like", 94 | "description": "Liked a post", 95 | "grant_count": 0, 96 | "allow_title": false, 97 | "multiple_grant": false, 98 | "icon": "fa-certificate", 99 | "image": null, 100 | "listable": true, 101 | "enabled": true, 102 | "badge_grouping_id": 1, 103 | "system": true, 104 | "long_description": "This badge is granted the first time you like a post using the :heart: button. Liking posts is a great way to let your fellow community members know that what they posted was interesting, useful, cool, or fun. Share the love!\n", 105 | "slug": "first-like", 106 | "query": " SELECT pa1.user_id, pa1.created_at granted_at, pa1.post_id\n FROM (\n SELECT pa.user_id, min(pa.id) id\n FROM post_actions pa\n JOIN badge_posts p on p.id = pa.post_id\n WHERE post_action_type_id = 2 AND\n (:backfill OR pa.post_id IN (:post_ids) )\n GROUP BY pa.user_id\n ) x\n JOIN post_actions pa1 on pa1.id = x.id\n", 107 | "trigger": 1, 108 | "target_posts": true, 109 | "auto_revoke": true, 110 | "show_posts": true, 111 | "badge_type_id": 3 112 | }, 113 | { 114 | "id": 14, 115 | "name": "First Link", 116 | "description": "Added a link to another topic", 117 | "grant_count": 0, 118 | "allow_title": false, 119 | "multiple_grant": false, 120 | "icon": "fa-certificate", 121 | "image": null, 122 | "listable": true, 123 | "enabled": true, 124 | "badge_grouping_id": 1, 125 | "system": true, 126 | "long_description": "This badge is granted the first time you add a link to another topic. Linking topics helps fellow readers find interesting related conversations, by showing the connections between topics in both directions. Link freely!\n", 127 | "slug": "first-link", 128 | "query": " SELECT l.user_id, l.post_id, l.created_at granted_at\n FROM\n (\n SELECT MIN(l1.id) id\n FROM topic_links l1\n JOIN badge_posts p1 ON p1.id = l1.post_id\n JOIN badge_posts p2 ON p2.id = l1.link_post_id\n WHERE NOT reflection AND p1.topic_id <> p2.topic_id AND not quote AND\n (:backfill OR ( p1.id in (:post_ids) ))\n GROUP BY l1.user_id\n ) ids\n JOIN topic_links l ON l.id = ids.id\n", 129 | "trigger": 2, 130 | "target_posts": true, 131 | "auto_revoke": true, 132 | "show_posts": true, 133 | "badge_type_id": 3 134 | }, 135 | { 136 | "id": 40, 137 | "name": "First Mention", 138 | "description": "Mentioned a user in a Post", 139 | "grant_count": 0, 140 | "allow_title": false, 141 | "multiple_grant": false, 142 | "icon": "fa-certificate", 143 | "image": null, 144 | "listable": true, 145 | "enabled": true, 146 | "badge_grouping_id": 1, 147 | "system": true, 148 | "long_description": "This badge is granted the first time you mention someone's @username in your post. Each mention generates a notification to that person, so they know about your post. Just begin typing @ (at symbol) to mention any user or, if allowed, group – it's a convenient way to bring something to their attention.", 149 | "slug": "first-mention", 150 | "query": " SELECT acting_user_id AS user_id, min(target_post_id) AS post_id, min(p.created_at) AS granted_at\n FROM user_actions\n JOIN posts p ON p.id = target_post_id\n JOIN topics t ON t.id = topic_id\n JOIN categories c on c.id = category_id\n WHERE action_type = 7\n AND NOT read_restricted\n AND p.deleted_at IS NULL\n AND t.deleted_at IS NULL\n AND t.visible\n AND t.archetype <> 'private_message'\n AND (:backfill OR p.id IN (:post_ids))\n GROUP BY acting_user_id\n", 151 | "trigger": 2, 152 | "target_posts": true, 153 | "auto_revoke": true, 154 | "show_posts": true, 155 | "badge_type_id": 3 156 | }, 157 | { 158 | "id": 42, 159 | "name": "First Onebox", 160 | "description": "Posted a link that was oneboxed", 161 | "grant_count": 2, 162 | "allow_title": false, 163 | "multiple_grant": false, 164 | "icon": "fa-certificate", 165 | "image": null, 166 | "listable": true, 167 | "enabled": true, 168 | "badge_grouping_id": 1, 169 | "system": true, 170 | "long_description": "This badge is granted the first time you post a link on a line by itself, which was then automatically expanded into a onebox with a brief summary of the link, a title, and (when available) a picture.", 171 | "slug": "first-onebox", 172 | "query": null, 173 | "trigger": 0, 174 | "target_posts": true, 175 | "auto_revoke": true, 176 | "show_posts": true, 177 | "badge_type_id": 3 178 | }, 179 | { 180 | "id": 15, 181 | "name": "First Quote", 182 | "description": "Quoted a post", 183 | "grant_count": 0, 184 | "allow_title": false, 185 | "multiple_grant": false, 186 | "icon": "fa-certificate", 187 | "image": null, 188 | "listable": true, 189 | "enabled": true, 190 | "badge_grouping_id": 1, 191 | "system": true, 192 | "long_description": "This badge is granted the first time you quote a post in your reply. Quoting relevant sections of earlier posts in your reply helps keep discussions connected together and on topic. The easiest way to quote is to highlight a section of a post, and then press any reply button. Quote generously!\n", 193 | "slug": "first-quote", 194 | "query": " SELECT ids.user_id, q.post_id, q.created_at granted_at\n FROM\n (\n SELECT p1.user_id, MIN(q1.id) id\n FROM quoted_posts q1\n JOIN badge_posts p1 ON p1.id = q1.post_id\n JOIN badge_posts p2 ON p2.id = q1.quoted_post_id\n WHERE (:backfill OR ( p1.id IN (:post_ids) ))\n GROUP BY p1.user_id\n ) ids\n JOIN quoted_posts q ON q.id = ids.id\n", 195 | "trigger": 2, 196 | "target_posts": true, 197 | "auto_revoke": true, 198 | "show_posts": true, 199 | "badge_type_id": 3 200 | }, 201 | { 202 | "id": 43, 203 | "name": "First Reply By Email", 204 | "description": "Replied to a Post via email", 205 | "grant_count": 0, 206 | "allow_title": false, 207 | "multiple_grant": false, 208 | "icon": "fa-certificate", 209 | "image": null, 210 | "listable": true, 211 | "enabled": true, 212 | "badge_grouping_id": 1, 213 | "system": true, 214 | "long_description": "This badge is granted the first time you reply to a post via email :e-mail:.\n", 215 | "slug": "first-reply-by-email", 216 | "query": null, 217 | "trigger": 0, 218 | "target_posts": true, 219 | "auto_revoke": true, 220 | "show_posts": true, 221 | "badge_type_id": 3 222 | }, 223 | { 224 | "id": 12, 225 | "name": "First Share", 226 | "description": "Shared a post", 227 | "grant_count": 0, 228 | "allow_title": false, 229 | "multiple_grant": false, 230 | "icon": "fa-certificate", 231 | "image": null, 232 | "listable": true, 233 | "enabled": true, 234 | "badge_grouping_id": 1, 235 | "system": true, 236 | "long_description": "This badge is granted the first time you share a link to a reply or topic using the share button. Sharing links is a great way to show off interesting discussions with the rest of the world and grow your community.\n", 237 | "slug": "first-share", 238 | "query": " SELECT views.user_id, i2.post_id, i2.created_at granted_at\n FROM\n (\n SELECT i.user_id, MIN(i.id) i_id\n FROM incoming_links i\n JOIN badge_posts p on p.id = i.post_id\n WHERE i.user_id IS NOT NULL\n GROUP BY i.user_id\n ) as views\n JOIN incoming_links i2 ON i2.id = views.i_id\n", 239 | "trigger": 0, 240 | "target_posts": true, 241 | "auto_revoke": true, 242 | "show_posts": true, 243 | "badge_type_id": 3 244 | }, 245 | { 246 | "id": 17, 247 | "name": "Reader", 248 | "description": "Read every reply in a topic with more than 100 replies", 249 | "grant_count": 1, 250 | "allow_title": false, 251 | "multiple_grant": false, 252 | "icon": "fa-certificate", 253 | "image": null, 254 | "listable": true, 255 | "enabled": true, 256 | "badge_grouping_id": 1, 257 | "system": true, 258 | "long_description": "This badge is granted the first time you read a long topic with more than 100 replies. Reading a conversation closely helps you follow the discussion, understand different viewpoints, and leads to more interesting conversations. The more you read, the better the conversation gets. As we like to say, Reading is Fundamental! :slight_smile:\n", 259 | "slug": "reader", 260 | "query": " SELECT id user_id, current_timestamp granted_at\n FROM users\n WHERE id IN\n (\n SELECT pt.user_id\n FROM post_timings pt\n JOIN badge_posts b ON b.post_number = pt.post_number AND\n b.topic_id = pt.topic_id\n JOIN topics t ON t.id = pt.topic_id\n LEFT JOIN user_badges ub ON ub.badge_id = 17 AND ub.user_id = pt.user_id\n WHERE ub.id IS NULL AND t.posts_count > 100\n GROUP BY pt.user_id, pt.topic_id, t.posts_count\n HAVING count(*) >= t.posts_count\n )\n", 261 | "trigger": null, 262 | "target_posts": false, 263 | "auto_revoke": false, 264 | "show_posts": false, 265 | "badge_type_id": 3 266 | }, 267 | { 268 | "id": 16, 269 | "name": "Read Guidelines", 270 | "description": "Read the community guidelines", 271 | "grant_count": 0, 272 | "allow_title": false, 273 | "multiple_grant": false, 274 | "icon": "fa-certificate", 275 | "image": null, 276 | "listable": true, 277 | "enabled": true, 278 | "badge_grouping_id": 1, 279 | "system": true, 280 | "long_description": "This badge is granted for reading the community guidelines. Following and sharing these simple guidelines helps build a safe, fun, and sustainable community for everyone. Always remember there's another human being, one very much like yourself, on the other side of that screen. Be nice!\n", 281 | "slug": "read-guidelines", 282 | "query": " SELECT user_id, read_faq granted_at\n FROM user_stats\n WHERE read_faq IS NOT NULL AND (user_id IN (:user_ids) OR :backfill)\n", 283 | "trigger": 8, 284 | "target_posts": false, 285 | "auto_revoke": true, 286 | "show_posts": false, 287 | "badge_type_id": 3 288 | }, 289 | { 290 | "id": 31, 291 | "name": "Admired", 292 | "description": "Received 5 likes on 300 posts", 293 | "grant_count": 0, 294 | "allow_title": false, 295 | "multiple_grant": false, 296 | "icon": "fa-heart", 297 | "image": null, 298 | "listable": true, 299 | "enabled": true, 300 | "badge_grouping_id": 2, 301 | "system": true, 302 | "long_description": "This badge is granted when you receive at least 5 likes on 300 different posts. Wow! The community admires your frequent, high quality contributions to the conversations here.\n", 303 | "slug": "admired", 304 | "query": " SELECT p.user_id, current_timestamp AS granted_at\n FROM posts AS p\n WHERE p.like_count >= 5\n AND (:backfill OR p.user_id IN (:user_ids))\n GROUP BY p.user_id\n HAVING count(*) > 300\n", 305 | "trigger": 0, 306 | "target_posts": false, 307 | "auto_revoke": false, 308 | "show_posts": false, 309 | "badge_type_id": 1 310 | }, 311 | { 312 | "id": 27, 313 | "name": "Champion", 314 | "description": "Invited 5 members", 315 | "grant_count": 0, 316 | "allow_title": false, 317 | "multiple_grant": false, 318 | "icon": "fa-user-plus", 319 | "image": null, 320 | "listable": true, 321 | "enabled": true, 322 | "badge_grouping_id": 2, 323 | "system": true, 324 | "long_description": "This badge is granted when you've invited 5 people who subsequently spent enough time on the site to become full members. Wow! Thanks for expanding the diversity of our community with new members!\n", 325 | "slug": "champion", 326 | "query": "\n SELECT u.id user_id, current_timestamp granted_at\n FROM users u\n WHERE u.id IN (\n SELECT invited_by_id\n FROM invites i\n JOIN users u2 ON u2.id = i.user_id\n WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 2 AND not u2.blocked\n GROUP BY invited_by_id\n HAVING COUNT(*) >= 5\n ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n (:backfill OR u.id IN (:user_ids) )\n", 327 | "trigger": 0, 328 | "target_posts": false, 329 | "auto_revoke": true, 330 | "show_posts": false, 331 | "badge_type_id": 1 332 | }, 333 | { 334 | "id": 35, 335 | "name": "Crazy in Love", 336 | "description": "Used 50 likes in a day 20 times", 337 | "grant_count": 0, 338 | "allow_title": false, 339 | "multiple_grant": false, 340 | "icon": "fa-heart", 341 | "image": null, 342 | "listable": true, 343 | "enabled": true, 344 | "badge_grouping_id": 2, 345 | "system": true, 346 | "long_description": "This badge is granted when you use all 50 of your daily likes for 20 days. Wow! You're a model of regularly encouraging your fellow community members!\n", 347 | "slug": "crazy-in-love", 348 | "query": " SELECT gdl.user_id, current_timestamp AS granted_at\n FROM given_daily_likes AS gdl\n WHERE gdl.limit_reached\n AND (:backfill OR gdl.user_id IN (:user_ids))\n GROUP BY gdl.user_id\n HAVING COUNT(*) >= 20\n", 349 | "trigger": 0, 350 | "target_posts": false, 351 | "auto_revoke": false, 352 | "show_posts": false, 353 | "badge_type_id": 1 354 | }, 355 | { 356 | "id": 39, 357 | "name": "Empathetic", 358 | "description": "Has 500 liked posts and gave 1000 likes", 359 | "grant_count": 0, 360 | "allow_title": false, 361 | "multiple_grant": false, 362 | "icon": "fa-heart", 363 | "image": null, 364 | "listable": true, 365 | "enabled": true, 366 | "badge_grouping_id": 2, 367 | "system": true, 368 | "long_description": "This badge is granted when you have 500 liked posts and give 1000 or more likes in return. Wow! You're a model of generosity and mutual appreciation :two_hearts:.\n", 369 | "slug": "empathetic", 370 | "query": " SELECT us.user_id, current_timestamp AS granted_at\n FROM user_stats AS us\n INNER JOIN posts AS p ON p.user_id = us.user_id\n WHERE p.like_count > 0\n AND us.likes_given >= 1000\n AND (:backfill OR us.user_id IN (:user_ids))\n GROUP BY us.user_id, us.likes_given\n HAVING COUNT(*) > 500\n", 371 | "trigger": 0, 372 | "target_posts": false, 373 | "auto_revoke": false, 374 | "show_posts": false, 375 | "badge_type_id": 1 376 | }, 377 | { 378 | "id": 23, 379 | "name": "Great Share", 380 | "description": "Shared a post with 1000 unique visitors", 381 | "grant_count": 0, 382 | "allow_title": false, 383 | "multiple_grant": true, 384 | "icon": "fa-certificate", 385 | "image": null, 386 | "listable": true, 387 | "enabled": true, 388 | "badge_grouping_id": 2, 389 | "system": true, 390 | "long_description": "This badge is granted for sharing a link that was clicked by 1000 outside visitors. Wow! You've promoted an interesting discussion to a huge new audience, and helped us grow our community in a big way!\n", 391 | "slug": "great-share", 392 | "query": " SELECT views.user_id, i2.post_id, current_timestamp granted_at\n FROM\n (\n SELECT i.user_id, MIN(i.id) i_id\n FROM incoming_links i\n JOIN badge_posts p on p.id = i.post_id\n WHERE i.user_id IS NOT NULL\n GROUP BY i.user_id,i.post_id\n HAVING COUNT(*) > 1000\n ) as views\n JOIN incoming_links i2 ON i2.id = views.i_id\n", 393 | "trigger": 0, 394 | "target_posts": true, 395 | "auto_revoke": true, 396 | "show_posts": true, 397 | "badge_type_id": 1 398 | }, 399 | { 400 | "id": 24, 401 | "name": "Anniversary", 402 | "description": "Active member for a year, posted at least once", 403 | "grant_count": 0, 404 | "allow_title": false, 405 | "multiple_grant": false, 406 | "icon": "fa-clock-o", 407 | "image": null, 408 | "listable": true, 409 | "enabled": true, 410 | "badge_grouping_id": 2, 411 | "system": true, 412 | "long_description": "This badge is granted when you've been a member for a year with at least one post in that year. Thank you for sticking around and contributing to our community. We couldn't do it without you.\n", 413 | "slug": "anniversary", 414 | "query": " SELECT u.id AS user_id, MIN(u.created_at + interval '1 year') AS granted_at\n FROM users u\n JOIN posts p ON p.user_id = u.id\n WHERE u.id > 0\n AND u.active\n AND NOT u.blocked\n AND u.created_at + interval '1 year' < now()\n AND p.deleted_at IS NULL\n AND NOT p.hidden\n AND p.created_at + interval '1 year' > now()\n AND (:backfill OR u.id IN (:user_ids))\n GROUP BY u.id\n HAVING COUNT(p.id) > 0\n", 415 | "trigger": 0, 416 | "target_posts": false, 417 | "auto_revoke": false, 418 | "show_posts": false, 419 | "badge_type_id": 2 420 | }, 421 | { 422 | "id": 26, 423 | "name": "Campaigner", 424 | "description": "Invited 3 basic users", 425 | "grant_count": 0, 426 | "allow_title": false, 427 | "multiple_grant": false, 428 | "icon": "fa-user-plus", 429 | "image": null, 430 | "listable": true, 431 | "enabled": true, 432 | "badge_grouping_id": 2, 433 | "system": true, 434 | "long_description": "This badge is granted when you've invited 3 people who subsequently spent enough time on the site to become basic users. A vibrant community needs a regular infusion of newcomers who regularly participate and add new voices to the conversations.\n", 435 | "slug": "campaigner", 436 | "query": "\n SELECT u.id user_id, current_timestamp granted_at\n FROM users u\n WHERE u.id IN (\n SELECT invited_by_id\n FROM invites i\n JOIN users u2 ON u2.id = i.user_id\n WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 1 AND not u2.blocked\n GROUP BY invited_by_id\n HAVING COUNT(*) >= 3\n ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n (:backfill OR u.id IN (:user_ids) )\n", 437 | "trigger": 0, 438 | "target_posts": false, 439 | "auto_revoke": true, 440 | "show_posts": false, 441 | "badge_type_id": 2 442 | }, 443 | { 444 | "id": 32, 445 | "name": "Gives Back", 446 | "description": "Has 100 liked posts and gave 100 likes", 447 | "grant_count": 0, 448 | "allow_title": false, 449 | "multiple_grant": false, 450 | "icon": "fa-heart", 451 | "image": null, 452 | "listable": true, 453 | "enabled": true, 454 | "badge_grouping_id": 2, 455 | "system": true, 456 | "long_description": "This badge is granted when you have 100 liked posts and give 100 or more likes in return. Thanks for paying it forward!\n", 457 | "slug": "gives-back", 458 | "query": " SELECT us.user_id, current_timestamp AS granted_at\n FROM user_stats AS us\n INNER JOIN posts AS p ON p.user_id = us.user_id\n WHERE p.like_count > 0\n AND us.likes_given >= 100\n AND (:backfill OR us.user_id IN (:user_ids))\n GROUP BY us.user_id, us.likes_given\n HAVING COUNT(*) > 100\n", 459 | "trigger": 0, 460 | "target_posts": false, 461 | "auto_revoke": false, 462 | "show_posts": false, 463 | "badge_type_id": 2 464 | }, 465 | { 466 | "id": 22, 467 | "name": "Good Share", 468 | "description": "Shared a post with 300 unique visitors", 469 | "grant_count": 0, 470 | "allow_title": false, 471 | "multiple_grant": true, 472 | "icon": "fa-certificate", 473 | "image": null, 474 | "listable": true, 475 | "enabled": true, 476 | "badge_grouping_id": 2, 477 | "system": true, 478 | "long_description": "This badge is granted for sharing a link that was clicked by 300 outside visitors. Good work! You've shown off a great discussion to a bunch of new people and helped this community grow.\n", 479 | "slug": "good-share", 480 | "query": " SELECT views.user_id, i2.post_id, current_timestamp granted_at\n FROM\n (\n SELECT i.user_id, MIN(i.id) i_id\n FROM incoming_links i\n JOIN badge_posts p on p.id = i.post_id\n WHERE i.user_id IS NOT NULL\n GROUP BY i.user_id,i.post_id\n HAVING COUNT(*) > 300\n ) as views\n JOIN incoming_links i2 ON i2.id = views.i_id\n", 481 | "trigger": 0, 482 | "target_posts": true, 483 | "auto_revoke": true, 484 | "show_posts": true, 485 | "badge_type_id": 2 486 | }, 487 | { 488 | "id": 34, 489 | "name": "Higher Love", 490 | "description": "Used 50 likes in a day 5 times", 491 | "grant_count": 0, 492 | "allow_title": false, 493 | "multiple_grant": false, 494 | "icon": "fa-heart", 495 | "image": null, 496 | "listable": true, 497 | "enabled": true, 498 | "badge_grouping_id": 2, 499 | "system": true, 500 | "long_description": "This badge is granted when you use all 50 of your daily likes for 5 days. Thanks for taking the time actively encouraging the best conversations every day!\n", 501 | "slug": "higher-love", 502 | "query": " SELECT gdl.user_id, current_timestamp AS granted_at\n FROM given_daily_likes AS gdl\n WHERE gdl.limit_reached\n AND (:backfill OR gdl.user_id IN (:user_ids))\n GROUP BY gdl.user_id\n HAVING COUNT(*) >= 5\n", 503 | "trigger": 0, 504 | "target_posts": false, 505 | "auto_revoke": false, 506 | "show_posts": false, 507 | "badge_type_id": 2 508 | }, 509 | { 510 | "id": 37, 511 | "name": "Respected", 512 | "description": "Received 2 likes on 100 posts", 513 | "grant_count": 0, 514 | "allow_title": false, 515 | "multiple_grant": false, 516 | "icon": "fa-heart", 517 | "image": null, 518 | "listable": true, 519 | "enabled": true, 520 | "badge_grouping_id": 2, 521 | "system": true, 522 | "long_description": "This badge is granted when you receive at least 2 likes on 100 different posts. The community is growing to respect your many contributions to the conversations here.\n", 523 | "slug": "respected", 524 | "query": " SELECT p.user_id, current_timestamp AS granted_at\n FROM posts AS p\n WHERE p.like_count >= 2\n AND (:backfill OR p.user_id IN (:user_ids))\n GROUP BY p.user_id\n HAVING count(*) > 100\n", 525 | "trigger": 0, 526 | "target_posts": false, 527 | "auto_revoke": false, 528 | "show_posts": false, 529 | "badge_type_id": 2 530 | }, 531 | { 532 | "id": 36, 533 | "name": "Appreciated", 534 | "description": "Received 1 like on 20 posts", 535 | "grant_count": 0, 536 | "allow_title": false, 537 | "multiple_grant": false, 538 | "icon": "fa-heart", 539 | "image": null, 540 | "listable": true, 541 | "enabled": true, 542 | "badge_grouping_id": 2, 543 | "system": true, 544 | "long_description": "This badge is granted when you receive at least one like on 20 different posts. The community is enjoying your contributions to the conversations here!\n", 545 | "slug": "appreciated", 546 | "query": " SELECT p.user_id, current_timestamp AS granted_at\n FROM posts AS p\n WHERE p.like_count >= 1\n AND (:backfill OR p.user_id IN (:user_ids))\n GROUP BY p.user_id\n HAVING count(*) > 20\n", 547 | "trigger": 0, 548 | "target_posts": false, 549 | "auto_revoke": false, 550 | "show_posts": false, 551 | "badge_type_id": 3 552 | }, 553 | { 554 | "id": 21, 555 | "name": "Nice Share", 556 | "description": "Shared a post with 25 unique visitors", 557 | "grant_count": 0, 558 | "allow_title": false, 559 | "multiple_grant": true, 560 | "icon": "fa-certificate", 561 | "image": null, 562 | "listable": true, 563 | "enabled": true, 564 | "badge_grouping_id": 2, 565 | "system": true, 566 | "long_description": "This badge is granted for sharing a link that was clicked by 25 outside visitors. Thanks for spreading the word about our discussions, and this community.\n", 567 | "slug": "nice-share", 568 | "query": " SELECT views.user_id, i2.post_id, current_timestamp granted_at\n FROM\n (\n SELECT i.user_id, MIN(i.id) i_id\n FROM incoming_links i\n JOIN badge_posts p on p.id = i.post_id\n WHERE i.user_id IS NOT NULL\n GROUP BY i.user_id,i.post_id\n HAVING COUNT(*) > 25\n ) as views\n JOIN incoming_links i2 ON i2.id = views.i_id\n", 569 | "trigger": 0, 570 | "target_posts": true, 571 | "auto_revoke": true, 572 | "show_posts": true, 573 | "badge_type_id": 3 574 | }, 575 | { 576 | "id": 33, 577 | "name": "Out of Love", 578 | "description": "Used 50 likes in a day", 579 | "grant_count": 0, 580 | "allow_title": false, 581 | "multiple_grant": false, 582 | "icon": "fa-heart", 583 | "image": null, 584 | "listable": true, 585 | "enabled": true, 586 | "badge_grouping_id": 2, 587 | "system": true, 588 | "long_description": "This badge is granted when you use all 50 of your daily likes. Remembering to take a moment and like the posts you enjoy and appreciate encourages your fellow community members to create even more great discussions in the future.\n", 589 | "slug": "out-of-love", 590 | "query": " SELECT gdl.user_id, current_timestamp AS granted_at\n FROM given_daily_likes AS gdl\n WHERE gdl.limit_reached\n AND (:backfill OR gdl.user_id IN (:user_ids))\n GROUP BY gdl.user_id\n HAVING COUNT(*) >= 1\n", 591 | "trigger": 0, 592 | "target_posts": false, 593 | "auto_revoke": false, 594 | "show_posts": false, 595 | "badge_type_id": 3 596 | }, 597 | { 598 | "id": 25, 599 | "name": "Promoter", 600 | "description": "Invited a user", 601 | "grant_count": 0, 602 | "allow_title": false, 603 | "multiple_grant": false, 604 | "icon": "fa-user-plus", 605 | "image": null, 606 | "listable": true, 607 | "enabled": true, 608 | "badge_grouping_id": 2, 609 | "system": true, 610 | "long_description": "This badge is granted when you invite someone to join the community via the invite button on your user page, or at the bottom of a topic. Inviting friends who might be interested in specific discussions is an great way to introduce new people to our community, so thanks!\n", 611 | "slug": "promoter", 612 | "query": "\n SELECT u.id user_id, current_timestamp granted_at\n FROM users u\n WHERE u.id IN (\n SELECT invited_by_id\n FROM invites i\n JOIN users u2 ON u2.id = i.user_id\n WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 0 AND not u2.blocked\n GROUP BY invited_by_id\n HAVING COUNT(*) >= 1\n ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n (:backfill OR u.id IN (:user_ids) )\n", 613 | "trigger": 0, 614 | "target_posts": false, 615 | "auto_revoke": true, 616 | "show_posts": false, 617 | "badge_type_id": 3 618 | }, 619 | { 620 | "id": 38, 621 | "name": "Thank You", 622 | "description": "Has 20 liked posts and gave 10 likes", 623 | "grant_count": 0, 624 | "allow_title": false, 625 | "multiple_grant": false, 626 | "icon": "fa-heart", 627 | "image": null, 628 | "listable": true, 629 | "enabled": true, 630 | "badge_grouping_id": 2, 631 | "system": true, 632 | "long_description": "This badge is granted when you have 20 liked posts and give 10 or more likes in return. When someone likes your posts, you find the time to like what others are posting, too.\n", 633 | "slug": "thank-you", 634 | "query": " SELECT us.user_id, current_timestamp AS granted_at\n FROM user_stats AS us\n INNER JOIN posts AS p ON p.user_id = us.user_id\n WHERE p.like_count > 0\n AND us.likes_given >= 10\n AND (:backfill OR us.user_id IN (:user_ids))\n GROUP BY us.user_id, us.likes_given\n HAVING COUNT(*) > 20\n", 635 | "trigger": 0, 636 | "target_posts": false, 637 | "auto_revoke": false, 638 | "show_posts": false, 639 | "badge_type_id": 3 640 | }, 641 | { 642 | "id": 5, 643 | "name": "Welcome", 644 | "description": "Received a like", 645 | "grant_count": 0, 646 | "allow_title": false, 647 | "multiple_grant": false, 648 | "icon": "fa-certificate", 649 | "image": null, 650 | "listable": true, 651 | "enabled": true, 652 | "badge_grouping_id": 2, 653 | "system": true, 654 | "long_description": "This badge is granted when you receive your first like on a post. Congratulations, you've posted something that your fellow community members found interesting, cool, or useful!\n", 655 | "slug": "welcome", 656 | "query": " SELECT p.user_id, min(post_id) post_id, min(pa.created_at) granted_at\n FROM post_actions pa\n JOIN badge_posts p on p.id = pa.post_id\n WHERE post_action_type_id = 2 AND\n (:backfill OR pa.post_id IN (:post_ids) )\n GROUP BY p.user_id\n", 657 | "trigger": 1, 658 | "target_posts": true, 659 | "auto_revoke": true, 660 | "show_posts": true, 661 | "badge_type_id": 3 662 | }, 663 | { 664 | "id": 30, 665 | "name": "Famous Link", 666 | "description": "Posted an external link with 1000 clicks", 667 | "grant_count": 0, 668 | "allow_title": false, 669 | "multiple_grant": true, 670 | "icon": "fa-certificate", 671 | "image": null, 672 | "listable": true, 673 | "enabled": true, 674 | "badge_grouping_id": 3, 675 | "system": true, 676 | "long_description": "This badge is granted when a link you shared gets 1000 clicks. Wow! You posted a link that significantly improved the conversation by adding essential detail, context, and information. Great work!\n", 677 | "slug": "famous-link", 678 | "query": " SELECT tl.user_id, post_id, current_timestamp granted_at\n FROM topic_links tl\n JOIN posts p ON p.id = post_id AND p.deleted_at IS NULL\n JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n WHERE NOT tl.internal\n AND tl.clicks >= 1000\n GROUP BY tl.user_id, tl.post_id\n", 679 | "trigger": 0, 680 | "target_posts": true, 681 | "auto_revoke": true, 682 | "show_posts": true, 683 | "badge_type_id": 1 684 | }, 685 | { 686 | "id": 8, 687 | "name": "Great Reply", 688 | "description": "Received 50 likes on a reply", 689 | "grant_count": 0, 690 | "allow_title": false, 691 | "multiple_grant": true, 692 | "icon": "fa-certificate", 693 | "image": null, 694 | "listable": true, 695 | "enabled": true, 696 | "badge_grouping_id": 3, 697 | "system": true, 698 | "long_description": "This badge is granted when your reply gets 50 likes. Wow! Your reply was inspiring, fascinating, hilarious, or insightful and the community loved it.\n", 699 | "slug": "great-reply", 700 | "query": "\n SELECT p.user_id, p.id post_id, p.updated_at granted_at\n FROM badge_posts p\n WHERE p.post_number > 1 AND p.like_count >= 50 AND\n (:backfill OR p.id IN (:post_ids) )\n", 701 | "trigger": 1, 702 | "target_posts": true, 703 | "auto_revoke": true, 704 | "show_posts": true, 705 | "badge_type_id": 1 706 | }, 707 | { 708 | "id": 20, 709 | "name": "Great Topic", 710 | "description": "Received 50 likes on a topic", 711 | "grant_count": 0, 712 | "allow_title": false, 713 | "multiple_grant": true, 714 | "icon": "fa-certificate", 715 | "image": null, 716 | "listable": true, 717 | "enabled": true, 718 | "badge_grouping_id": 3, 719 | "system": true, 720 | "long_description": "This badge is granted when your topic gets 50 likes. You kicked off a fascinating conversation and the community enjoyed the dynamic discussion that resulted!\n", 721 | "slug": "great-topic", 722 | "query": "\n SELECT p.user_id, p.id post_id, p.updated_at granted_at\n FROM badge_posts p\n WHERE p.post_number = 1 AND p.like_count >= 50 AND\n (:backfill OR p.id IN (:post_ids) )\n", 723 | "trigger": 1, 724 | "target_posts": true, 725 | "auto_revoke": true, 726 | "show_posts": true, 727 | "badge_type_id": 1 728 | }, 729 | { 730 | "id": 7, 731 | "name": "Good Reply", 732 | "description": "Received 25 likes on a reply", 733 | "grant_count": 0, 734 | "allow_title": false, 735 | "multiple_grant": true, 736 | "icon": "fa-certificate", 737 | "image": null, 738 | "listable": true, 739 | "enabled": true, 740 | "badge_grouping_id": 3, 741 | "system": true, 742 | "long_description": "This badge is granted when your reply gets 25 likes. Your reply was exceptional and made the conversation a whole lot better for everyone!\n", 743 | "slug": "good-reply", 744 | "query": "\n SELECT p.user_id, p.id post_id, p.updated_at granted_at\n FROM badge_posts p\n WHERE p.post_number > 1 AND p.like_count >= 25 AND\n (:backfill OR p.id IN (:post_ids) )\n", 745 | "trigger": 1, 746 | "target_posts": true, 747 | "auto_revoke": true, 748 | "show_posts": true, 749 | "badge_type_id": 2 750 | }, 751 | { 752 | "id": 19, 753 | "name": "Good Topic", 754 | "description": "Received 25 likes on a topic", 755 | "grant_count": 0, 756 | "allow_title": false, 757 | "multiple_grant": true, 758 | "icon": "fa-certificate", 759 | "image": null, 760 | "listable": true, 761 | "enabled": true, 762 | "badge_grouping_id": 3, 763 | "system": true, 764 | "long_description": "This badge is granted when your topic gets 25 likes. You launched a vibrant conversation that the community rallied around and loved!\n", 765 | "slug": "good-topic", 766 | "query": "\n SELECT p.user_id, p.id post_id, p.updated_at granted_at\n FROM badge_posts p\n WHERE p.post_number = 1 AND p.like_count >= 25 AND\n (:backfill OR p.id IN (:post_ids) )\n", 767 | "trigger": 1, 768 | "target_posts": true, 769 | "auto_revoke": true, 770 | "show_posts": true, 771 | "badge_type_id": 2 772 | }, 773 | { 774 | "id": 29, 775 | "name": "Hot Link", 776 | "description": "Posted an external link with 300 clicks", 777 | "grant_count": 0, 778 | "allow_title": false, 779 | "multiple_grant": true, 780 | "icon": "fa-certificate", 781 | "image": null, 782 | "listable": true, 783 | "enabled": true, 784 | "badge_grouping_id": 3, 785 | "system": true, 786 | "long_description": "This badge is granted when a link you shared gets 300 clicks. Thanks for posting a fascinating link that drove the conversation forward and illuminated the discussion!\n", 787 | "slug": "hot-link", 788 | "query": " SELECT tl.user_id, post_id, current_timestamp granted_at\n FROM topic_links tl\n JOIN posts p ON p.id = post_id AND p.deleted_at IS NULL\n JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n WHERE NOT tl.internal\n AND tl.clicks >= 300\n GROUP BY tl.user_id, tl.post_id\n", 789 | "trigger": 0, 790 | "target_posts": true, 791 | "auto_revoke": true, 792 | "show_posts": true, 793 | "badge_type_id": 2 794 | }, 795 | { 796 | "id": 6, 797 | "name": "Nice Reply", 798 | "description": "Received 10 likes on a reply", 799 | "grant_count": 0, 800 | "allow_title": false, 801 | "multiple_grant": true, 802 | "icon": "fa-certificate", 803 | "image": null, 804 | "listable": true, 805 | "enabled": true, 806 | "badge_grouping_id": 3, 807 | "system": true, 808 | "long_description": "This badge is granted when your reply gets 10 likes. Your reply really made an impression on the community and helped move the conversation forward!\n", 809 | "slug": "nice-reply", 810 | "query": "\n SELECT p.user_id, p.id post_id, p.updated_at granted_at\n FROM badge_posts p\n WHERE p.post_number > 1 AND p.like_count >= 10 AND\n (:backfill OR p.id IN (:post_ids) )\n", 811 | "trigger": 1, 812 | "target_posts": true, 813 | "auto_revoke": true, 814 | "show_posts": true, 815 | "badge_type_id": 3 816 | }, 817 | { 818 | "id": 18, 819 | "name": "Nice Topic", 820 | "description": "Received 10 likes on a topic", 821 | "grant_count": 0, 822 | "allow_title": false, 823 | "multiple_grant": true, 824 | "icon": "fa-certificate", 825 | "image": null, 826 | "listable": true, 827 | "enabled": true, 828 | "badge_grouping_id": 3, 829 | "system": true, 830 | "long_description": "This badge is granted when your topic gets 10 likes. Hey, you started an interesting conversation that the community enjoyed!\n", 831 | "slug": "nice-topic", 832 | "query": "\n SELECT p.user_id, p.id post_id, p.updated_at granted_at\n FROM badge_posts p\n WHERE p.post_number = 1 AND p.like_count >= 10 AND\n (:backfill OR p.id IN (:post_ids) )\n", 833 | "trigger": 1, 834 | "target_posts": true, 835 | "auto_revoke": true, 836 | "show_posts": true, 837 | "badge_type_id": 3 838 | }, 839 | { 840 | "id": 28, 841 | "name": "Popular Link", 842 | "description": "Posted an external link with 50 clicks", 843 | "grant_count": 0, 844 | "allow_title": false, 845 | "multiple_grant": true, 846 | "icon": "fa-certificate", 847 | "image": null, 848 | "listable": true, 849 | "enabled": true, 850 | "badge_grouping_id": 3, 851 | "system": true, 852 | "long_description": "This badge is granted when a link you shared gets 50 clicks. Thanks for posting a useful link that added interesting context to the conversation!\n", 853 | "slug": "popular-link", 854 | "query": " SELECT tl.user_id, post_id, current_timestamp granted_at\n FROM topic_links tl\n JOIN posts p ON p.id = post_id AND p.deleted_at IS NULL\n JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n WHERE NOT tl.internal\n AND tl.clicks >= 50\n GROUP BY tl.user_id, tl.post_id\n", 855 | "trigger": 0, 856 | "target_posts": true, 857 | "auto_revoke": true, 858 | "show_posts": true, 859 | "badge_type_id": 3 860 | }, 861 | { 862 | "id": 4, 863 | "name": "Leader", 864 | "description": "Granted global edit, pin, close, archive, split and merge, more likes", 865 | "grant_count": 0, 866 | "allow_title": true, 867 | "multiple_grant": false, 868 | "icon": "fa-user", 869 | "image": null, 870 | "listable": true, 871 | "enabled": true, 872 | "badge_grouping_id": 4, 873 | "system": true, 874 | "long_description": "This badge is granted when you reach trust level 4. You're a leader in this community as selected by staff, and you set a positive example for the rest of the community in your actions and words here. You have the ability to edit all posts, take common topic moderator actions such as pin, close, unlist, archive, split, and merge, and you have tons of likes per day.\n", 875 | "slug": "leader", 876 | "query": "\n SELECT u.id user_id, current_timestamp granted_at FROM users u\n WHERE trust_level >= 4 AND (\n :backfill OR u.id IN (:user_ids)\n )\n", 877 | "trigger": 4, 878 | "target_posts": false, 879 | "auto_revoke": true, 880 | "show_posts": false, 881 | "badge_type_id": 1 882 | }, 883 | { 884 | "id": 3, 885 | "name": "Regular", 886 | "description": "Granted recategorize, rename, followed links, wiki, more likes", 887 | "grant_count": 0, 888 | "allow_title": true, 889 | "multiple_grant": false, 890 | "icon": "fa-user", 891 | "image": null, 892 | "listable": true, 893 | "enabled": true, 894 | "badge_grouping_id": 4, 895 | "system": true, 896 | "long_description": "This badge is granted when you reach trust level 3. Thanks for being a regular part of our community over a period of months. You're now one of the most active readers, and a reliable contributor that makes our community great. You can now recategorize and rename topics, take advantage of more powerful spam flags, access a private lounge area, and you'll also get lots more likes per day.\n", 897 | "slug": "regular", 898 | "query": "\n SELECT u.id user_id, current_timestamp granted_at FROM users u\n WHERE trust_level >= 3 AND (\n :backfill OR u.id IN (:user_ids)\n )\n", 899 | "trigger": 4, 900 | "target_posts": false, 901 | "auto_revoke": true, 902 | "show_posts": false, 903 | "badge_type_id": 2 904 | }, 905 | { 906 | "id": 1, 907 | "name": "Basic", 908 | "description": "Granted all essential community functions", 909 | "grant_count": 1, 910 | "allow_title": false, 911 | "multiple_grant": false, 912 | "icon": "fa-user", 913 | "image": null, 914 | "listable": true, 915 | "enabled": true, 916 | "badge_grouping_id": 4, 917 | "system": true, 918 | "long_description": "This badge is granted when you reach trust level 1. Thanks for sticking around a little while and reading a few topics to learn what our community is about. Your new user restrictions have been lifted; you've been granted all essential community abilities, such as personal messaging, flagging, wiki editing, and the ability to post multiple images and links.\n", 919 | "slug": "basic", 920 | "query": "\n SELECT u.id user_id, current_timestamp granted_at FROM users u\n WHERE trust_level >= 1 AND (\n :backfill OR u.id IN (:user_ids)\n )\n", 921 | "trigger": 4, 922 | "target_posts": false, 923 | "auto_revoke": true, 924 | "show_posts": false, 925 | "badge_type_id": 3 926 | }, 927 | { 928 | "id": 2, 929 | "name": "Member", 930 | "description": "Granted invitations, group messaging, more likes", 931 | "grant_count": 0, 932 | "allow_title": false, 933 | "multiple_grant": false, 934 | "icon": "fa-user", 935 | "image": null, 936 | "listable": true, 937 | "enabled": true, 938 | "badge_grouping_id": 4, 939 | "system": true, 940 | "long_description": "This badge is granted when you reach trust level 2. Thanks for participating over a period of weeks to truly join our community. You can now send invitations from your user page or individual topics, create group personal messages, and have a few more likes per day.\n", 941 | "slug": "member", 942 | "query": "\n SELECT u.id user_id, current_timestamp granted_at FROM users u\n WHERE trust_level >= 2 AND (\n :backfill OR u.id IN (:user_ids)\n )\n", 943 | "trigger": 4, 944 | "target_posts": false, 945 | "auto_revoke": true, 946 | "show_posts": false, 947 | "badge_type_id": 3 948 | } 949 | ], 950 | "badge_types": [ 951 | { 952 | "id": 3, 953 | "name": "Bronze", 954 | "sort_order": 7 955 | }, 956 | { 957 | "id": 1, 958 | "name": "Gold", 959 | "sort_order": 9 960 | }, 961 | { 962 | "id": 2, 963 | "name": "Silver", 964 | "sort_order": 8 965 | } 966 | ], 967 | "badge_groupings": [ 968 | { 969 | "id": 1, 970 | "name": "Getting Started", 971 | "description": null, 972 | "position": 10, 973 | "system": true 974 | }, 975 | { 976 | "id": 2, 977 | "name": "Community", 978 | "description": null, 979 | "position": 11, 980 | "system": true 981 | }, 982 | { 983 | "id": 3, 984 | "name": "Posting", 985 | "description": null, 986 | "position": 12, 987 | "system": true 988 | }, 989 | { 990 | "id": 4, 991 | "name": "Trust Level", 992 | "description": null, 993 | "position": 13, 994 | "system": true 995 | }, 996 | { 997 | "id": 5, 998 | "name": "Other", 999 | "description": null, 1000 | "position": 14, 1001 | "system": true 1002 | } 1003 | ], 1004 | "admin_badges": { 1005 | "protected_system_fields": [ 1006 | "name", 1007 | "badge_type_id", 1008 | "multiple_grant", 1009 | "target_posts", 1010 | "show_posts", 1011 | "query", 1012 | "trigger", 1013 | "auto_revoke", 1014 | "listable" 1015 | ], 1016 | "triggers": { 1017 | "none": 0, 1018 | "post_action": 1, 1019 | "post_revision": 2, 1020 | "trust_level_change": 4, 1021 | "user_change": 8, 1022 | "post_processed": 16 1023 | }, 1024 | "badge_ids": [ 1025 | 9, 1026 | 10, 1027 | 41, 1028 | 13, 1029 | 11, 1030 | 14, 1031 | 40, 1032 | 42, 1033 | 15, 1034 | 43, 1035 | 12, 1036 | 17, 1037 | 16, 1038 | 31, 1039 | 27, 1040 | 35, 1041 | 39, 1042 | 23, 1043 | 24, 1044 | 26, 1045 | 32, 1046 | 22, 1047 | 34, 1048 | 37, 1049 | 36, 1050 | 21, 1051 | 33, 1052 | 25, 1053 | 38, 1054 | 5, 1055 | 30, 1056 | 8, 1057 | 20, 1058 | 7, 1059 | 19, 1060 | 29, 1061 | 6, 1062 | 18, 1063 | 28, 1064 | 4, 1065 | 3, 1066 | 1, 1067 | 2 1068 | ], 1069 | "badge_grouping_ids": [ 1070 | 1, 1071 | 2, 1072 | 3, 1073 | 4, 1074 | 5 1075 | ], 1076 | "badge_type_ids": [ 1077 | 1, 1078 | 2, 1079 | 3 1080 | ] 1081 | } 1082 | } 1083 | -------------------------------------------------------------------------------- /responses/admin/get_user.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 15, 3 | "username": "bixmytjfsnlwzuvegoh", 4 | "avatar_template": "/letter_avatar_proxy/v2/letter/b/82dd89/{size}.png", 5 | "active": true, 6 | "admin": false, 7 | "moderator": false, 8 | "last_seen_at": "2018-06-01T16:19:46.579Z", 9 | "last_emailed_at": "2018-06-01T16:14:34.736Z", 10 | "created_at": "2018-05-24T20:50:25.197Z", 11 | "last_seen_age": 1904738.168253354, 12 | "last_emailed_age": 1905050.011217868, 13 | "created_at_age": 2579699.550216535, 14 | "username_lower": "bixmytjfsnlwzuvegoh", 15 | "trust_level": 0, 16 | "manual_locked_trust_level": null, 17 | "flag_level": 0, 18 | "title": null, 19 | "suspended_at": "2018-06-22T17:41:17.093Z", 20 | "suspended_till": "2019-06-22T14:00:00.000Z", 21 | "suspended": true, 22 | "time_read": 0, 23 | "staged": false, 24 | "days_visited": 1, 25 | "posts_read_count": 0, 26 | "topics_entered": 0, 27 | "post_count": 0, 28 | "name": "bixmytjfsnlwzuvegoh", 29 | "can_send_activation_email": true, 30 | "can_activate": false, 31 | "can_deactivate": true, 32 | "ip_address": "192.168.56.1", 33 | "registration_ip_address": "127.0.0.1", 34 | "can_grant_admin": true, 35 | "can_revoke_admin": false, 36 | "can_grant_moderation": true, 37 | "can_revoke_moderation": false, 38 | "can_impersonate": true, 39 | "like_count": 0, 40 | "like_given_count": 0, 41 | "topic_count": 0, 42 | "flags_given_count": 0, 43 | "flags_received_count": 0, 44 | "private_topics_count": 1, 45 | "can_delete_all_posts": true, 46 | "can_be_deleted": true, 47 | "can_be_anonymized": true, 48 | "full_suspend_reason": "asdfasdf", 49 | "silence_reason": null, 50 | "primary_group_id": null, 51 | "badge_count": 0, 52 | "warnings_received_count": 0, 53 | "user_fields": { 54 | "1": null 55 | }, 56 | "bounce_score": 0, 57 | "reset_bounce_score_after": null, 58 | "can_view_action_logs": true, 59 | "can_disable_second_factor": true, 60 | "single_sign_on_record": null, 61 | "approved_by": null, 62 | "suspended_by": { 63 | "id": 1, 64 | "username": "blake", 65 | "avatar_template": "/user_avatar/localhost/blake/{size}/2_1.png" 66 | }, 67 | "silenced_by": null, 68 | "groups": [ 69 | { 70 | "id": 10, 71 | "automatic": true, 72 | "name": "trust_level_0", 73 | "display_name": "trust_level_0", 74 | "user_count": 21, 75 | "mentionable_level": 0, 76 | "messageable_level": 0, 77 | "visibility_level": 0, 78 | "automatic_membership_email_domains": null, 79 | "automatic_membership_retroactive": false, 80 | "primary_group": false, 81 | "title": null, 82 | "grant_trust_level": null, 83 | "incoming_email": null, 84 | "has_messages": false, 85 | "flair_url": null, 86 | "flair_bg_color": null, 87 | "flair_color": null, 88 | "bio_raw": null, 89 | "bio_cooked": null, 90 | "public_admission": false, 91 | "public_exit": false, 92 | "allow_membership_requests": false, 93 | "full_name": null, 94 | "default_notification_level": 3, 95 | "membership_request_template": null 96 | } 97 | ] 98 | } 99 | -------------------------------------------------------------------------------- /responses/categories/update_category_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "success": "OK", 3 | "category": { 4 | "id": 5, 5 | "name": "68a61467-6e1f-11af-c329-f0f574cfed43", 6 | "color": "49d9e9", 7 | "text_color": "f0fcfd", 8 | "slug": "224f8a66-485e-3d6d-53f7-45029234a7e3", 9 | "topic_count": 0, 10 | "post_count": 0, 11 | "position": 4, 12 | "description": null, 13 | "description_text": null, 14 | "topic_url": "/t/about-the-224f8a66-485e-3d6d-53f7-45029234a7e3-category/16", 15 | "logo_url": "", 16 | "background_url": "", 17 | "read_restricted": false, 18 | "permission": null, 19 | "notification_level": null, 20 | "can_edit": true, 21 | "topic_template": "", 22 | "has_children": null, 23 | "available_groups": [ 24 | "admins", 25 | "everyone", 26 | "moderators", 27 | "staff", 28 | "trust_level_0", 29 | "trust_level_1", 30 | "trust_level_2", 31 | "trust_level_3", 32 | "trust_level_4" 33 | ], 34 | "auto_close_hours": null, 35 | "auto_close_based_on_last_post": false, 36 | "group_permissions": [ 37 | { 38 | "permission_type": 1, 39 | "group_name": "everyone" 40 | } 41 | ], 42 | "email_in": null, 43 | "email_in_allow_strangers": false, 44 | "suppress_from_homepage": false, 45 | "can_delete": true, 46 | "cannot_delete_reason": null, 47 | "allow_badges": true, 48 | "custom_fields": {} 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /responses/groups/get_groups_response.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "automatic": true, 5 | "name": "admins", 6 | "user_count": 2, 7 | "alias_level": 0, 8 | "visible": true, 9 | "automatic_membership_email_domains": null, 10 | "automatic_membership_retroactive": false, 11 | "primary_group": false, 12 | "title": null, 13 | "grant_trust_level": null, 14 | "incoming_email": null, 15 | "notification_level": 2, 16 | "has_messages": false, 17 | "is_member": true, 18 | "mentionable": false, 19 | "flair_url": null, 20 | "flair_bg_color": null, 21 | "flair_color": null 22 | }, 23 | { 24 | "id": 0, 25 | "automatic": true, 26 | "name": "everyone", 27 | "user_count": 0, 28 | "alias_level": 0, 29 | "visible": true, 30 | "automatic_membership_email_domains": null, 31 | "automatic_membership_retroactive": false, 32 | "primary_group": false, 33 | "title": null, 34 | "grant_trust_level": null, 35 | "incoming_email": null, 36 | "notification_level": null, 37 | "has_messages": false, 38 | "is_member": true, 39 | "mentionable": false, 40 | "flair_url": null, 41 | "flair_bg_color": null, 42 | "flair_color": null 43 | }, 44 | { 45 | "id": 2, 46 | "automatic": true, 47 | "name": "moderators", 48 | "user_count": 1, 49 | "alias_level": 0, 50 | "visible": true, 51 | "automatic_membership_email_domains": null, 52 | "automatic_membership_retroactive": false, 53 | "primary_group": false, 54 | "title": null, 55 | "grant_trust_level": null, 56 | "incoming_email": null, 57 | "notification_level": null, 58 | "has_messages": false, 59 | "is_member": true, 60 | "mentionable": false, 61 | "flair_url": null, 62 | "flair_bg_color": null, 63 | "flair_color": null 64 | }, 65 | { 66 | "id": 3, 67 | "automatic": true, 68 | "name": "staff", 69 | "user_count": 2, 70 | "alias_level": 0, 71 | "visible": true, 72 | "automatic_membership_email_domains": null, 73 | "automatic_membership_retroactive": false, 74 | "primary_group": false, 75 | "title": null, 76 | "grant_trust_level": null, 77 | "incoming_email": null, 78 | "notification_level": 2, 79 | "has_messages": false, 80 | "is_member": true, 81 | "mentionable": false, 82 | "flair_url": null, 83 | "flair_bg_color": null, 84 | "flair_color": null 85 | }, 86 | { 87 | "id": 10, 88 | "automatic": true, 89 | "name": "trust_level_0", 90 | "user_count": 2, 91 | "alias_level": 0, 92 | "visible": true, 93 | "automatic_membership_email_domains": null, 94 | "automatic_membership_retroactive": false, 95 | "primary_group": false, 96 | "title": null, 97 | "grant_trust_level": null, 98 | "incoming_email": null, 99 | "notification_level": 2, 100 | "has_messages": false, 101 | "is_member": true, 102 | "mentionable": false, 103 | "flair_url": null, 104 | "flair_bg_color": null, 105 | "flair_color": null 106 | }, 107 | { 108 | "id": 11, 109 | "automatic": true, 110 | "name": "trust_level_1", 111 | "user_count": 1, 112 | "alias_level": 0, 113 | "visible": true, 114 | "automatic_membership_email_domains": null, 115 | "automatic_membership_retroactive": false, 116 | "primary_group": false, 117 | "title": null, 118 | "grant_trust_level": null, 119 | "incoming_email": null, 120 | "notification_level": null, 121 | "has_messages": false, 122 | "is_member": true, 123 | "mentionable": false, 124 | "flair_url": null, 125 | "flair_bg_color": null, 126 | "flair_color": null 127 | }, 128 | { 129 | "id": 12, 130 | "automatic": true, 131 | "name": "trust_level_2", 132 | "user_count": 1, 133 | "alias_level": 0, 134 | "visible": true, 135 | "automatic_membership_email_domains": null, 136 | "automatic_membership_retroactive": false, 137 | "primary_group": false, 138 | "title": null, 139 | "grant_trust_level": null, 140 | "incoming_email": null, 141 | "notification_level": null, 142 | "has_messages": false, 143 | "is_member": true, 144 | "mentionable": false, 145 | "flair_url": null, 146 | "flair_bg_color": null, 147 | "flair_color": null 148 | }, 149 | { 150 | "id": 13, 151 | "automatic": true, 152 | "name": "trust_level_3", 153 | "user_count": 1, 154 | "alias_level": 0, 155 | "visible": true, 156 | "automatic_membership_email_domains": null, 157 | "automatic_membership_retroactive": false, 158 | "primary_group": false, 159 | "title": null, 160 | "grant_trust_level": null, 161 | "incoming_email": null, 162 | "notification_level": null, 163 | "has_messages": false, 164 | "is_member": true, 165 | "mentionable": false, 166 | "flair_url": null, 167 | "flair_bg_color": null, 168 | "flair_color": null 169 | }, 170 | { 171 | "id": 14, 172 | "automatic": true, 173 | "name": "trust_level_4", 174 | "user_count": 1, 175 | "alias_level": 0, 176 | "visible": true, 177 | "automatic_membership_email_domains": null, 178 | "automatic_membership_retroactive": false, 179 | "primary_group": false, 180 | "title": null, 181 | "grant_trust_level": null, 182 | "incoming_email": null, 183 | "notification_level": null, 184 | "has_messages": false, 185 | "is_member": true, 186 | "mentionable": false, 187 | "flair_url": null, 188 | "flair_bg_color": null, 189 | "flair_color": null 190 | } 191 | ] 192 | -------------------------------------------------------------------------------- /responses/groups/group_members_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "members": [ 3 | { 4 | "id": 1, 5 | "username": "discourse1", 6 | "avatar_template": "\/letter_avatar_proxy\/v2\/letter\/d\/da6949\/{size}.png", 7 | "name": null, 8 | "title": null, 9 | "last_posted_at": null, 10 | "last_seen_at": "2016-10-29T12:53:52.312Z" 11 | } 12 | ], 13 | "owners": [], 14 | "meta": { 15 | "total": 1, 16 | "limit": 50, 17 | "offset": 0 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /responses/groups/new_group_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "basic_group": { 3 | "id": 41, 4 | "automatic": false, 5 | "name": "9upc2wo2w0w130", 6 | "user_count": 0, 7 | "alias_level": 0, 8 | "visible": false, 9 | "automatic_membership_email_domains": null, 10 | "automatic_membership_retroactive": false, 11 | "primary_group": false, 12 | "title": null, 13 | "grant_trust_level": null, 14 | "incoming_email": null, 15 | "notification_level": null, 16 | "has_messages": false, 17 | "is_member": true, 18 | "mentionable": false, 19 | "flair_url": null, 20 | "flair_bg_color": null, 21 | "flair_color": null 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /responses/notifications/get.json: -------------------------------------------------------------------------------- 1 | { 2 | "notifications": [ 3 | { 4 | "id": 3, 5 | "notification_type": 12, 6 | "read": true, 7 | "created_at": "2019-06-17T20:26:05.670Z", 8 | "post_number": null, 9 | "topic_id": null, 10 | "slug": null, 11 | "data": { 12 | "badge_id": 41, 13 | "badge_name": "First Emoji", 14 | "badge_slug": "first-emoji", 15 | "badge_title": false, 16 | "username": "blake.erickson" 17 | } 18 | }, 19 | { 20 | "id": 2, 21 | "notification_type": 6, 22 | "read": true, 23 | "created_at": "2019-06-17T20:26:04.305Z", 24 | "post_number": 1, 25 | "topic_id": 10, 26 | "fancy_title": "Greetings!", 27 | "slug": "greetings", 28 | "data": { 29 | "topic_title": "Greetings!", 30 | "original_post_id": 14, 31 | "original_post_type": 1, 32 | "original_username": "discobot", 33 | "revision_number": null, 34 | "display_username": "discobot" 35 | } 36 | } 37 | ], 38 | "total_rows_notifications": 2, 39 | "seen_notification_id": 3, 40 | "load_more_notifications": "/notifications?offset=60&username=blake.erickson" 41 | } 42 | -------------------------------------------------------------------------------- /responses/posts/get_post_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 33, 3 | "name": "", 4 | "username": "blake", 5 | "avatar_template": "/letter_avatar_proxy/v2/letter/b/a9a28c/{size}.png", 6 | "created_at": "2016-10-03T13:37:16.594Z", 7 | "cooked": "

b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd

", 8 | "post_number": 4, 9 | "post_type": 1, 10 | "updated_at": "2016-10-03T13:37:16.594Z", 11 | "reply_count": 0, 12 | "reply_to_post_number": null, 13 | "quote_count": 0, 14 | "avg_time": null, 15 | "incoming_link_count": 0, 16 | "reads": 1, 17 | "score": 0, 18 | "yours": false, 19 | "topic_id": 8, 20 | "topic_slug": "welcome-to-discourse", 21 | "display_username": "", 22 | "primary_group_name": null, 23 | "primary_group_flair_url": null, 24 | "primary_group_flair_bg_color": null, 25 | "primary_group_flair_color": null, 26 | "version": 1, 27 | "can_edit": false, 28 | "can_delete": false, 29 | "can_recover": false, 30 | "can_wiki": false, 31 | "user_title": null, 32 | "raw": "b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd b15bd65a-527e-1446-e17a-40bcca68fcbd", 33 | "actions_summary": [], 34 | "moderator": false, 35 | "admin": true, 36 | "staff": true, 37 | "user_id": 1, 38 | "hidden": false, 39 | "hidden_reason_id": null, 40 | "trust_level": 0, 41 | "deleted_at": null, 42 | "user_deleted": false, 43 | "edit_reason": null, 44 | "can_view_edit_history": true, 45 | "wiki": false 46 | } 47 | -------------------------------------------------------------------------------- /responses/posts/update_post_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "post": { 3 | "id": 25, 4 | "name": "", 5 | "username": "discourse1", 6 | "avatar_template": "/user_avatar/colloquy.blakeerickson.com/discourse1/{size}/2_1.png", 7 | "created_at": "2016-10-04T12:44:14.372Z", 8 | "cooked": "

07c585ab-b775-f0b8-5d9e-0d9b1aaf94c5 07c585ab-b775-f0b8-5d9e-0d9b1aaf94c5 07c585ab-b775-f0b8-5d9e-0d9b1aaf94c5 07c585ab-b775-f0b8-5d9e-0d9b1aaf94c5 07c585ab-b775-f0b8-5d9e-0d9b1aaf94c5 07c585ab-b775-f0b8-5d9e-0d9b1aaf94c5

", 9 | "post_number": 11, 10 | "post_type": 1, 11 | "updated_at": "2016-10-04T13:02:15.146Z", 12 | "reply_count": 0, 13 | "reply_to_post_number": null, 14 | "quote_count": 0, 15 | "avg_time": null, 16 | "incoming_link_count": 0, 17 | "reads": 1, 18 | "score": 0.2, 19 | "yours": true, 20 | "topic_id": 12, 21 | "topic_slug": "55113baf-3b00-aa2c-f020-643fd8fcebf3", 22 | "display_username": "", 23 | "primary_group_name": null, 24 | "primary_group_flair_url": null, 25 | "primary_group_flair_bg_color": null, 26 | "primary_group_flair_color": null, 27 | "version": 3, 28 | "can_edit": true, 29 | "can_delete": true, 30 | "can_recover": true, 31 | "can_wiki": true, 32 | "user_title": null, 33 | "actions_summary": [ 34 | { 35 | "id": 3, 36 | "can_act": true 37 | }, 38 | { 39 | "id": 4, 40 | "can_act": true 41 | }, 42 | { 43 | "id": 5, 44 | "hidden": true, 45 | "can_act": true 46 | }, 47 | { 48 | "id": 7, 49 | "can_act": true 50 | }, 51 | { 52 | "id": 8, 53 | "can_act": true 54 | } 55 | ], 56 | "moderator": false, 57 | "admin": true, 58 | "staff": true, 59 | "user_id": 1, 60 | "draft_sequence": 22, 61 | "hidden": false, 62 | "hidden_reason_id": null, 63 | "trust_level": 0, 64 | "deleted_at": null, 65 | "user_deleted": false, 66 | "edit_reason": null, 67 | "can_view_edit_history": true, 68 | "wiki": false 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /responses/search/query_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "posts": [ 3 | { 4 | "id": 16, 5 | "name": null, 6 | "username": "discourse1", 7 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/da6949/{size}.png", 8 | "created_at": "2016-10-29T14:14:20.516Z", 9 | "cooked": "

ecf65fcd-1e16-7c4c-4244-a467b46c610becf65fcd-1e16-7c4c-4244-a467b46c610b ecf65fcd-1e16-7c4c-4244-a467b46c610b ecf65fcd-1e16-7c4c-4244-a467b46c610b ecf65fcd-1e16-7c4c-4244-a467b46c610becf65fcd-1e16-7c4c-4244-a467b46c610b ecf65fcd-1e16-7c4c-4244-a467b46c610becf65fcd-1e16-7c4c-4244-a467b46c610b

", 10 | "like_count": 0, 11 | "blurb": "ecf65fcd-1e16-7c4c-4244-a467b46c610becf65fcd-1e16-7c4c-4244-a467b46c610b ecf65fcd-1e16-7c4c-4244-a467b4...", 12 | "post_number": 1, 13 | "topic_id": 13 14 | } 15 | ], 16 | "topics": [ 17 | { 18 | "id": 13, 19 | "title": "2a6aa74e-e341-5e3c-1eaa-78c6331f305f", 20 | "fancy_title": "2a6aa74e-e341-5e3c-1eaa-78c6331f305f", 21 | "slug": "2a6aa74e-e341-5e3c-1eaa-78c6331f305f", 22 | "posts_count": 1, 23 | "reply_count": 0, 24 | "highest_post_number": 1, 25 | "image_url": null, 26 | "created_at": "2016-10-29T14:14:20.321Z", 27 | "last_posted_at": "2016-10-29T14:14:20.516Z", 28 | "bumped": true, 29 | "bumped_at": "2016-10-29T14:14:20.516Z", 30 | "unseen": false, 31 | "pinned": false, 32 | "unpinned": null, 33 | "visible": true, 34 | "closed": false, 35 | "archived": false, 36 | "bookmarked": null, 37 | "liked": null, 38 | "views": 1, 39 | "like_count": 0, 40 | "has_summary": false, 41 | "archetype": "regular", 42 | "last_poster_username": null, 43 | "category_id": 1, 44 | "pinned_globally": false, 45 | "posters": [] 46 | } 47 | ], 48 | "users": [], 49 | "categories": [], 50 | "grouped_search_result": { 51 | "more_posts": null, 52 | "more_users": null, 53 | "more_categories": null, 54 | "post_ids": [ 55 | 16 56 | ], 57 | "user_ids": [], 58 | "category_ids": [] 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /responses/topics/invite.json: -------------------------------------------------------------------------------- 1 | { 2 | "user": { 3 | "id": 3, 4 | "username": "5crsw24c3pggqf", 5 | "avatar_template": "/letter_avatar_proxy/v2/letter/5/b487fb/{size}.png" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /responses/topics/latest_topics_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "users": [ 3 | { 4 | "id": 1, 5 | "username": "discourse1", 6 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/da6949/{size}.png" 7 | }, 8 | { 9 | "id": -1, 10 | "username": "system", 11 | "avatar_template": "/letter_avatar_proxy/v2/letter/s/bcef8e/{size}.png" 12 | } 13 | ], 14 | "topic_list": { 15 | "can_create_topic": false, 16 | "draft": null, 17 | "draft_key": "new_topic", 18 | "draft_sequence": null, 19 | "per_page": 30, 20 | "topics": [ 21 | { 22 | "id": 13, 23 | "title": "2a6aa74e-e341-5e3c-1eaa-78c6331f305f", 24 | "fancy_title": "2a6aa74e-e341-5e3c-1eaa-78c6331f305f", 25 | "slug": "2a6aa74e-e341-5e3c-1eaa-78c6331f305f", 26 | "posts_count": 1, 27 | "reply_count": 0, 28 | "highest_post_number": 1, 29 | "image_url": null, 30 | "created_at": "2016-10-29T14:14:20.321Z", 31 | "last_posted_at": "2016-10-29T14:14:20.516Z", 32 | "bumped": true, 33 | "bumped_at": "2016-10-29T14:14:20.516Z", 34 | "unseen": false, 35 | "pinned": false, 36 | "unpinned": null, 37 | "visible": true, 38 | "closed": false, 39 | "archived": false, 40 | "bookmarked": null, 41 | "liked": null, 42 | "views": 1, 43 | "like_count": 0, 44 | "has_summary": false, 45 | "archetype": "regular", 46 | "last_poster_username": "discourse1", 47 | "category_id": 1, 48 | "pinned_globally": false, 49 | "posters": [ 50 | { 51 | "extras": "latest single", 52 | "description": "Original Poster, Most Recent Poster", 53 | "user_id": 1 54 | } 55 | ] 56 | }, 57 | { 58 | "id": 12, 59 | "title": "E45937e6-b689-b938-f7d1-13f64906b04a", 60 | "fancy_title": "E45937e6-b689-b938-f7d1-13f64906b04a", 61 | "slug": "e45937e6-b689-b938-f7d1-13f64906b04a", 62 | "posts_count": 7, 63 | "reply_count": 0, 64 | "highest_post_number": 7, 65 | "image_url": null, 66 | "created_at": "2016-10-29T14:13:49.614Z", 67 | "last_posted_at": "2016-10-29T14:15:16.236Z", 68 | "bumped": true, 69 | "bumped_at": "2016-10-29T14:15:16.236Z", 70 | "unseen": false, 71 | "pinned": false, 72 | "unpinned": null, 73 | "visible": true, 74 | "closed": false, 75 | "archived": false, 76 | "bookmarked": null, 77 | "liked": null, 78 | "views": 1, 79 | "like_count": 0, 80 | "has_summary": false, 81 | "archetype": "regular", 82 | "last_poster_username": "discourse1", 83 | "category_id": 1, 84 | "pinned_globally": false, 85 | "posters": [ 86 | { 87 | "extras": "latest single", 88 | "description": "Original Poster, Most Recent Poster", 89 | "user_id": 1 90 | } 91 | ] 92 | }, 93 | { 94 | "id": 8, 95 | "title": "Welcome to Discourse", 96 | "fancy_title": "Welcome to Discourse", 97 | "slug": "welcome-to-discourse", 98 | "posts_count": 1, 99 | "reply_count": 0, 100 | "highest_post_number": 1, 101 | "image_url": null, 102 | "created_at": "2016-10-21T02:29:17.537Z", 103 | "last_posted_at": "2016-10-21T02:29:17.587Z", 104 | "bumped": true, 105 | "bumped_at": "2016-10-21T02:29:17.587Z", 106 | "unseen": false, 107 | "pinned": true, 108 | "unpinned": null, 109 | "excerpt": "The first paragraph of this pinned topic will be visible as a welcome message to all new visitors on your homepage. It's important! \n\nEdit this into a brief description of your community: \n\n\nWho is it for?\nWhat can they …", 110 | "visible": true, 111 | "closed": false, 112 | "archived": false, 113 | "bookmarked": null, 114 | "liked": null, 115 | "views": 0, 116 | "like_count": 0, 117 | "has_summary": false, 118 | "archetype": "regular", 119 | "last_poster_username": "system", 120 | "category_id": 1, 121 | "pinned_globally": true, 122 | "posters": [ 123 | { 124 | "extras": "latest single", 125 | "description": "Original Poster, Most Recent Poster", 126 | "user_id": -1 127 | } 128 | ] 129 | } 130 | ] 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /responses/topics/new_topic_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 20, 3 | "name": "", 4 | "username": "discourse1", 5 | "avatar_template": "/user_avatar/colloquy.blakeerickson.com/discourse1/{size}/2_1.png", 6 | "created_at": "2016-09-27T13:04:21.432Z", 7 | "cooked": "

591dcd02-4ba2-4b6a-3044-c0ec6ee031b0591dcd02-4ba2-4b6a-3044-c0ec6ee031b0 591dcd02-4ba2-4b6a-3044-c0ec6ee031b0 591dcd02-4ba2-4b6a-3044-c0ec6ee031b0 591dcd02-4ba2-4b6a-3044-c0ec6ee031b0591dcd02-4ba2-4b6a-3044-c0ec6ee031b0 591dcd02-4ba2-4b6a-3044-c0ec6ee031b0591dcd02-4ba2-4b6a-3044-c0ec6ee031b0

", 8 | "post_number": 1, 9 | "post_type": 1, 10 | "updated_at": "2016-09-27T13:04:21.432Z", 11 | "reply_count": 0, 12 | "reply_to_post_number": null, 13 | "quote_count": 0, 14 | "avg_time": null, 15 | "incoming_link_count": 0, 16 | "reads": 0, 17 | "score": 0, 18 | "yours": true, 19 | "topic_id": 17, 20 | "topic_slug": "b793cb62-e23e-c2da-7e55-9f332f3963d0", 21 | "display_username": "", 22 | "primary_group_name": null, 23 | "primary_group_flair_url": null, 24 | "primary_group_flair_bg_color": null, 25 | "primary_group_flair_color": null, 26 | "version": 1, 27 | "can_edit": true, 28 | "can_delete": false, 29 | "can_recover": true, 30 | "can_wiki": true, 31 | "user_title": null, 32 | "actions_summary": [ 33 | { 34 | "id": 3, 35 | "can_act": true 36 | }, 37 | { 38 | "id": 4, 39 | "can_act": true 40 | }, 41 | { 42 | "id": 5, 43 | "hidden": true, 44 | "can_act": true 45 | }, 46 | { 47 | "id": 7, 48 | "can_act": true 49 | }, 50 | { 51 | "id": 8, 52 | "can_act": true 53 | } 54 | ], 55 | "moderator": false, 56 | "admin": true, 57 | "staff": true, 58 | "user_id": 1, 59 | "draft_sequence": 1, 60 | "hidden": false, 61 | "hidden_reason_id": null, 62 | "trust_level": 0, 63 | "deleted_at": null, 64 | "user_deleted": false, 65 | "edit_reason": null, 66 | "can_view_edit_history": true, 67 | "wiki": false 68 | } 69 | -------------------------------------------------------------------------------- /responses/topics/private-messages-sent.json: -------------------------------------------------------------------------------- 1 | { 2 | "users": [ 3 | { 4 | "id": 1, 5 | "username": "discourse1", 6 | "avatar_template": "\/letter_avatar_proxy\/v2\/letter\/d\/da6949\/{size}.png" 7 | }, 8 | { 9 | "id": -1, 10 | "username": "system", 11 | "avatar_template": "\/letter_avatar_proxy\/v2\/letter\/s\/bcef8e\/{size}.png" 12 | } 13 | ], 14 | "topic_list": { 15 | "can_create_topic": true, 16 | "draft": null, 17 | "draft_key": "new_topic", 18 | "draft_sequence": 2, 19 | "per_page": 30, 20 | "topics": [ 21 | { 22 | "id": 15, 23 | "title": "This is a test topic", 24 | "fancy_title": "This is a test topic", 25 | "slug": "this-is-a-test-topic", 26 | "posts_count": 2, 27 | "reply_count": 0, 28 | "highest_post_number": 2, 29 | "image_url": null, 30 | "created_at": "2016-11-02T12:36:46.270Z", 31 | "last_posted_at": "2016-11-02T12:37:03.103Z", 32 | "bumped": true, 33 | "bumped_at": "2016-11-02T12:37:03.103Z", 34 | "unseen": false, 35 | "last_read_post_number": 2, 36 | "unread": 0, 37 | "new_posts": 0, 38 | "pinned": false, 39 | "unpinned": null, 40 | "visible": true, 41 | "closed": false, 42 | "archived": false, 43 | "notification_level": 3, 44 | "bookmarked": false, 45 | "liked": false, 46 | "views": 1, 47 | "like_count": 0, 48 | "has_summary": false, 49 | "archetype": "private_message", 50 | "last_poster_username": "discourse1", 51 | "category_id": null, 52 | "pinned_globally": false, 53 | "posters": [ 54 | { 55 | "extras": "latest single", 56 | "description": "Original Poster, Most Recent Poster", 57 | "user_id": 1 58 | } 59 | ], 60 | "participants": [ 61 | { 62 | "extras": null, 63 | "description": null, 64 | "user_id": -1 65 | } 66 | ] 67 | } 68 | ] 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /responses/topics/private-messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "topic_list": { 3 | "can_create_topic": true, 4 | "draft": null, 5 | "draft_key": "new_topic", 6 | "draft_sequence": 2, 7 | "per_page": 30, 8 | "topics": [] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /responses/topics/top.json: -------------------------------------------------------------------------------- 1 | { 2 | "users": [ 3 | { 4 | "id": 1, 5 | "username": "discourse1", 6 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/da6949/{size}.png" 7 | } 8 | ], 9 | "topic_list": { 10 | "can_create_topic": true, 11 | "draft": null, 12 | "draft_key": "new_topic", 13 | "draft_sequence": 0, 14 | "for_period": "yearly", 15 | "per_page": 30, 16 | "topics": [ 17 | { 18 | "id": 12, 19 | "title": "E45937e6-b689-b938-f7d1-13f64906b04a", 20 | "fancy_title": "E45937e6-b689-b938-f7d1-13f64906b04a", 21 | "slug": "e45937e6-b689-b938-f7d1-13f64906b04a", 22 | "posts_count": 7, 23 | "reply_count": 0, 24 | "highest_post_number": 7, 25 | "image_url": null, 26 | "created_at": "2016-10-29T14:13:49.614Z", 27 | "last_posted_at": "2016-10-29T14:15:16.236Z", 28 | "bumped": true, 29 | "bumped_at": "2016-10-29T14:15:16.236Z", 30 | "unseen": false, 31 | "last_read_post_number": 4, 32 | "unread": 0, 33 | "new_posts": 0, 34 | "pinned": false, 35 | "unpinned": null, 36 | "visible": true, 37 | "closed": false, 38 | "archived": false, 39 | "notification_level": 1, 40 | "bookmarked": false, 41 | "liked": false, 42 | "views": 3, 43 | "like_count": 0, 44 | "has_summary": false, 45 | "archetype": "regular", 46 | "last_poster_username": "discourse1", 47 | "category_id": 1, 48 | "pinned_globally": false, 49 | "posters": [ 50 | { 51 | "extras": "latest single", 52 | "description": "Original Poster, Most Recent Poster", 53 | "user_id": 1 54 | } 55 | ] 56 | } 57 | ] 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /responses/topics/topic_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "post_stream": { 3 | "posts": [ 4 | { 5 | "id": 16, 6 | "name": "", 7 | "username": "discourse1", 8 | "avatar_template": "/user_avatar/colloquy.blakeerickson.com/discourse1/{size}/2_1.png", 9 | "created_at": "2016-10-01T13:51:26.235Z", 10 | "cooked": "

(Replace this first paragraph with a brief description of your new category. This guidance will appear in the category selection area, so try to keep it below 200 characters. Until you edit this description or create topics, this category won't appear on the categories page.)

\n\n

Use the following paragraphs for a longer description, or to establish category guidelines or rules:

\n\n", 11 | "post_number": 1, 12 | "post_type": 1, 13 | "updated_at": "2016-10-01T13:51:26.235Z", 14 | "reply_count": 0, 15 | "reply_to_post_number": null, 16 | "quote_count": 0, 17 | "avg_time": null, 18 | "incoming_link_count": 0, 19 | "reads": 0, 20 | "score": 0, 21 | "yours": false, 22 | "topic_id": 13, 23 | "topic_slug": "about-the-9bf05639-c1d6-95e0-b5b1-24c75db096e5-category", 24 | "display_username": "", 25 | "primary_group_name": null, 26 | "primary_group_flair_url": null, 27 | "primary_group_flair_bg_color": null, 28 | "primary_group_flair_color": null, 29 | "version": 1, 30 | "can_edit": false, 31 | "can_delete": false, 32 | "can_recover": false, 33 | "can_wiki": false, 34 | "read": true, 35 | "user_title": null, 36 | "actions_summary": [], 37 | "moderator": false, 38 | "admin": true, 39 | "staff": true, 40 | "user_id": 1, 41 | "hidden": false, 42 | "hidden_reason_id": null, 43 | "trust_level": 0, 44 | "deleted_at": null, 45 | "user_deleted": false, 46 | "edit_reason": null, 47 | "can_view_edit_history": true, 48 | "wiki": false 49 | } 50 | ], 51 | "stream": [ 52 | 16 53 | ] 54 | }, 55 | "timeline_lookup": [ 56 | [ 57 | 1, 58 | 0 59 | ] 60 | ], 61 | "id": 13, 62 | "title": "About the 9bf05639-c1d6-95e0-b5b1-24c75db096e5 category", 63 | "fancy_title": "About the 9bf05639-c1d6-95e0-b5b1-24c75db096e5 category", 64 | "posts_count": 1, 65 | "created_at": "2016-10-01T13:51:26.097Z", 66 | "views": 1, 67 | "reply_count": 0, 68 | "participant_count": 1, 69 | "like_count": 0, 70 | "last_posted_at": null, 71 | "visible": true, 72 | "closed": false, 73 | "archived": false, 74 | "has_summary": false, 75 | "archetype": "regular", 76 | "slug": "about-the-9bf05639-c1d6-95e0-b5b1-24c75db096e5-category", 77 | "category_id": 5, 78 | "word_count": null, 79 | "deleted_at": null, 80 | "user_id": 1, 81 | "draft": null, 82 | "draft_key": "topic_13", 83 | "draft_sequence": null, 84 | "unpinned": null, 85 | "pinned_globally": false, 86 | "pinned": true, 87 | "pinned_at": "2016-10-01T13:51:26.093Z", 88 | "pinned_until": null, 89 | "details": { 90 | "auto_close_at": null, 91 | "auto_close_hours": null, 92 | "auto_close_based_on_last_post": false, 93 | "created_by": { 94 | "id": 1, 95 | "username": "discourse1", 96 | "avatar_template": "/user_avatar/colloquy.blakeerickson.com/discourse1/{size}/2_1.png" 97 | }, 98 | "last_poster": { 99 | "id": 1, 100 | "username": "discourse1", 101 | "avatar_template": "/user_avatar/colloquy.blakeerickson.com/discourse1/{size}/2_1.png" 102 | }, 103 | "participants": [ 104 | { 105 | "id": 1, 106 | "username": "discourse1", 107 | "avatar_template": "/user_avatar/colloquy.blakeerickson.com/discourse1/{size}/2_1.png", 108 | "post_count": 1 109 | } 110 | ], 111 | "suggested_topics": [ 112 | { 113 | "id": 8, 114 | "title": "Welcome to Discourse", 115 | "fancy_title": "Welcome to Discourse", 116 | "slug": "welcome-to-discourse", 117 | "posts_count": 1, 118 | "reply_count": 0, 119 | "highest_post_number": 1, 120 | "image_url": "/images/welcome/discourse-edit-post-animated.gif", 121 | "created_at": "2016-10-01T13:23:38.057Z", 122 | "last_posted_at": "2016-10-01T13:23:38.110Z", 123 | "bumped": true, 124 | "bumped_at": "2016-10-01T13:23:38.110Z", 125 | "unseen": false, 126 | "pinned": true, 127 | "unpinned": null, 128 | "excerpt": "The first paragraph of this pinned topic will be visible as a welcome message to all new visitors on your homepage. It's important! \n\nEdit this into a brief description of your community: \n\n\nWho is it for?\nWhat can they …", 129 | "visible": true, 130 | "closed": false, 131 | "archived": false, 132 | "bookmarked": null, 133 | "liked": null, 134 | "archetype": "regular", 135 | "like_count": 0, 136 | "views": 0, 137 | "category_id": 1, 138 | "posters": [ 139 | { 140 | "extras": "latest single", 141 | "description": "Original Poster, Most Recent Poster", 142 | "user": { 143 | "id": -1, 144 | "username": "system", 145 | "avatar_template": "/user_avatar/colloquy.blakeerickson.com/system/{size}/1_1.png" 146 | } 147 | } 148 | ] 149 | }, 150 | { 151 | "id": 12, 152 | "title": "B8f88e76-0aeb-072e-6ec0-76e005a46d6f", 153 | "fancy_title": "B8f88e76-0aeb-072e-6ec0-76e005a46d6f", 154 | "slug": "b8f88e76-0aeb-072e-6ec0-76e005a46d6f", 155 | "posts_count": 1, 156 | "reply_count": 0, 157 | "highest_post_number": 1, 158 | "image_url": null, 159 | "created_at": "2016-10-01T13:51:18.067Z", 160 | "last_posted_at": "2016-10-01T13:51:18.293Z", 161 | "bumped": true, 162 | "bumped_at": "2016-10-01T13:51:18.293Z", 163 | "unseen": false, 164 | "pinned": false, 165 | "unpinned": null, 166 | "visible": true, 167 | "closed": false, 168 | "archived": false, 169 | "bookmarked": null, 170 | "liked": null, 171 | "archetype": "regular", 172 | "like_count": 0, 173 | "views": 0, 174 | "category_id": 1, 175 | "posters": [ 176 | { 177 | "extras": "latest single", 178 | "description": "Original Poster, Most Recent Poster", 179 | "user": { 180 | "id": 1, 181 | "username": "discourse1", 182 | "avatar_template": "/user_avatar/colloquy.blakeerickson.com/discourse1/{size}/2_1.png" 183 | } 184 | } 185 | ] 186 | } 187 | ], 188 | "notification_level": 1, 189 | "can_flag_topic": false 190 | }, 191 | "highest_post_number": 1, 192 | "deleted_by": null, 193 | "actions_summary": [ 194 | { 195 | "id": 4, 196 | "count": 0, 197 | "hidden": false, 198 | "can_act": false 199 | }, 200 | { 201 | "id": 7, 202 | "count": 0, 203 | "hidden": false, 204 | "can_act": false 205 | }, 206 | { 207 | "id": 8, 208 | "count": 0, 209 | "hidden": false, 210 | "can_act": false 211 | } 212 | ], 213 | "chunk_size": 20, 214 | "bookmarked": null 215 | } 216 | -------------------------------------------------------------------------------- /responses/topics/update_topic_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "basic_topic": { 3 | "id": 15, 4 | "title": "C9d2d05c-94e0-84c9-ecaf-ae102bbdbcec", 5 | "fancy_title": "C9d2d05c-94e0-84c9-ecaf-ae102bbdbcec", 6 | "slug": "c9d2d05c-94e0-84c9-ecaf-ae102bbdbcec", 7 | "posts_count": 1 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /responses/users/active_list.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "username": "discourse1", 5 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/da6949/{size}.png", 6 | "email": "user@example.com", 7 | "active": true, 8 | "admin": true, 9 | "moderator": false, 10 | "last_seen_at": "2016-10-29T15:21:21.243Z", 11 | "last_emailed_at": "2016-10-27T11:45:14.045Z", 12 | "created_at": "2016-10-27T11:43:46.817Z", 13 | "last_seen_age": "28m", 14 | "last_emailed_age": "2d", 15 | "created_at_age": "2d", 16 | "username_lower": "discourse1", 17 | "trust_level": 0, 18 | "trust_level_locked": false, 19 | "flag_level": 0, 20 | "title": null, 21 | "suspended_at": null, 22 | "suspended_till": null, 23 | "suspended": null, 24 | "blocked": false, 25 | "time_read": "3m", 26 | "staged": false, 27 | "days_visited": 3, 28 | "posts_read_count": 8, 29 | "topics_entered": 2, 30 | "post_count": 6 31 | }, 32 | { 33 | "id": 3, 34 | "username": "5crsw24c3pggqf", 35 | "avatar_template": "/letter_avatar_proxy/v2/letter/5/b487fb/{size}.png", 36 | "active": false, 37 | "admin": false, 38 | "moderator": false, 39 | "last_seen_at": null, 40 | "last_emailed_at": null, 41 | "created_at": "2016-10-29T15:20:19.173Z", 42 | "last_seen_age": null, 43 | "last_emailed_age": null, 44 | "created_at_age": "29m", 45 | "username_lower": "5crsw24c3pggqf", 46 | "trust_level": 1, 47 | "trust_level_locked": false, 48 | "flag_level": 0, 49 | "title": null, 50 | "suspended_at": null, 51 | "suspended_till": null, 52 | "suspended": null, 53 | "blocked": false, 54 | "time_read": "< 1m", 55 | "staged": false, 56 | "days_visited": 0, 57 | "posts_read_count": 0, 58 | "topics_entered": 0, 59 | "post_count": 0 60 | }, 61 | { 62 | "id": 2, 63 | "username": "5idw7vqszylqrg", 64 | "avatar_template": "/letter_avatar_proxy/v2/letter/5/f6c823/{size}.png", 65 | "active": false, 66 | "admin": false, 67 | "moderator": false, 68 | "last_seen_at": null, 69 | "last_emailed_at": null, 70 | "created_at": "2016-10-29T12:36:44.812Z", 71 | "last_seen_age": null, 72 | "last_emailed_age": null, 73 | "created_at_age": "3h", 74 | "username_lower": "5idw7vqszylqrg", 75 | "trust_level": 1, 76 | "trust_level_locked": false, 77 | "flag_level": 0, 78 | "title": null, 79 | "suspended_at": "2016-10-29T12:37:06.487Z", 80 | "suspended_till": "2016-10-29T12:37:06.486Z", 81 | "suspended": false, 82 | "blocked": false, 83 | "time_read": "< 1m", 84 | "staged": false, 85 | "days_visited": 0, 86 | "posts_read_count": 0, 87 | "topics_entered": 0, 88 | "post_count": 0 89 | }, 90 | { 91 | "id": -1, 92 | "username": "system", 93 | "avatar_template": "/letter_avatar_proxy/v2/letter/s/bcef8e/{size}.png", 94 | "active": true, 95 | "admin": true, 96 | "moderator": true, 97 | "last_seen_at": null, 98 | "last_emailed_at": null, 99 | "created_at": "2016-10-21T02:29:07.851Z", 100 | "last_seen_age": null, 101 | "last_emailed_age": null, 102 | "created_at_age": "9d", 103 | "username_lower": "system", 104 | "trust_level": 4, 105 | "trust_level_locked": false, 106 | "flag_level": 0, 107 | "title": null, 108 | "suspended_at": null, 109 | "suspended_till": null, 110 | "suspended": null, 111 | "blocked": false, 112 | "time_read": "< 1m", 113 | "staged": false, 114 | "days_visited": 0, 115 | "posts_read_count": 14, 116 | "topics_entered": 0, 117 | "post_count": 13 118 | } 119 | ] 120 | -------------------------------------------------------------------------------- /responses/users/directory_items.json: -------------------------------------------------------------------------------- 1 | { 2 | "directory_items": [ 3 | { 4 | "id": 5, 5 | "likes_received": 0, 6 | "likes_given": 0, 7 | "topics_entered": 1, 8 | "topic_count": 1, 9 | "post_count": 0, 10 | "posts_read": 3, 11 | "days_visited": 1, 12 | "user": { 13 | "id": 5, 14 | "username": "foobar", 15 | "avatar_template": "/letter_avatar_proxy/v2/letter/f/f19dbf/{size}.png", 16 | "name": "foo bar", 17 | "title": null 18 | } 19 | }, 20 | { 21 | "id": 4, 22 | "likes_received": 0, 23 | "likes_given": 0, 24 | "topics_entered": 0, 25 | "topic_count": 0, 26 | "post_count": 0, 27 | "posts_read": 0, 28 | "days_visited": 0, 29 | "user": { 30 | "id": 4, 31 | "username": "test2", 32 | "avatar_template": "/letter_avatar_proxy/v2/letter/t/f475e1/{size}.png", 33 | "name": "test2", 34 | "title": null 35 | } 36 | }, 37 | { 38 | "id": 3, 39 | "likes_received": 0, 40 | "likes_given": 0, 41 | "topics_entered": 0, 42 | "topic_count": 0, 43 | "post_count": 0, 44 | "posts_read": 0, 45 | "days_visited": 0, 46 | "user": { 47 | "id": 3, 48 | "username": "discourse4", 49 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/22d042/{size}.png", 50 | "name": "My Name", 51 | "title": null 52 | } 53 | }, 54 | { 55 | "id": 6, 56 | "likes_received": 0, 57 | "likes_given": 0, 58 | "topics_entered": 3, 59 | "topic_count": 1, 60 | "post_count": 0, 61 | "posts_read": 7, 62 | "days_visited": 3, 63 | "user": { 64 | "id": 6, 65 | "username": "blake3", 66 | "avatar_template": "/letter_avatar_proxy/v2/letter/b/e68b1a/{size}.png", 67 | "name": "blake2", 68 | "title": null 69 | } 70 | }, 71 | { 72 | "id": 1, 73 | "likes_received": 0, 74 | "likes_given": 0, 75 | "topics_entered": 6, 76 | "topic_count": 6, 77 | "post_count": 3, 78 | "posts_read": 3, 79 | "days_visited": 5, 80 | "user": { 81 | "id": 1, 82 | "username": "discourse1", 83 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/da6949/{size}.png", 84 | "name": null, 85 | "title": null 86 | } 87 | } 88 | ], 89 | "total_rows_directory_items": 5, 90 | "load_more_directory_items": "/directory_items?order=likes_received&page=1&period=weekly" 91 | } 92 | -------------------------------------------------------------------------------- /responses/users/get_user_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "user_badges": [], 3 | "user": { 4 | "id": 1, 5 | "username": "discourse1", 6 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/da6949/{size}.png", 7 | "name": null, 8 | "last_posted_at": "2016-11-02T12:37:03.103Z", 9 | "last_seen_at": "2016-11-05T13:21:12.505Z", 10 | "created_at": "2016-10-27T11:43:46.817Z", 11 | "website_name": null, 12 | "can_edit": false, 13 | "can_edit_username": false, 14 | "can_edit_email": false, 15 | "can_edit_name": false, 16 | "can_send_private_messages": true, 17 | "can_send_private_message_to_user": true, 18 | "trust_level": 0, 19 | "moderator": false, 20 | "admin": true, 21 | "title": null, 22 | "uploaded_avatar_id": null, 23 | "badge_count": 0, 24 | "custom_fields": {}, 25 | "pending_count": 0, 26 | "profile_view_count": 1, 27 | "primary_group_name": null, 28 | "primary_group_flair_url": null, 29 | "primary_group_flair_bg_color": null, 30 | "primary_group_flair_color": null, 31 | "invited_by": null, 32 | "groups": [ 33 | { 34 | "id": 1, 35 | "automatic": true, 36 | "name": "admins", 37 | "user_count": 2, 38 | "alias_level": 0, 39 | "visible": true, 40 | "automatic_membership_email_domains": null, 41 | "automatic_membership_retroactive": false, 42 | "primary_group": false, 43 | "title": null, 44 | "grant_trust_level": null, 45 | "notification_level": null, 46 | "has_messages": true, 47 | "is_member": false, 48 | "mentionable": false, 49 | "flair_url": null, 50 | "flair_bg_color": null, 51 | "flair_color": null 52 | }, 53 | { 54 | "id": 3, 55 | "automatic": true, 56 | "name": "staff", 57 | "user_count": 2, 58 | "alias_level": 0, 59 | "visible": true, 60 | "automatic_membership_email_domains": null, 61 | "automatic_membership_retroactive": false, 62 | "primary_group": false, 63 | "title": null, 64 | "grant_trust_level": null, 65 | "notification_level": null, 66 | "has_messages": false, 67 | "is_member": false, 68 | "mentionable": false, 69 | "flair_url": null, 70 | "flair_bg_color": null, 71 | "flair_color": null 72 | }, 73 | { 74 | "id": 10, 75 | "automatic": true, 76 | "name": "trust_level_0", 77 | "user_count": 5, 78 | "alias_level": 0, 79 | "visible": true, 80 | "automatic_membership_email_domains": null, 81 | "automatic_membership_retroactive": false, 82 | "primary_group": false, 83 | "title": null, 84 | "grant_trust_level": null, 85 | "notification_level": 2, 86 | "has_messages": false, 87 | "is_member": true, 88 | "mentionable": false, 89 | "flair_url": null, 90 | "flair_bg_color": null, 91 | "flair_color": null 92 | } 93 | ], 94 | "featured_user_badge_ids": [], 95 | "card_badge": null 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /responses/users/new_list.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 3, 4 | "username": "5crsw24c3pggqf", 5 | "avatar_template": "/letter_avatar_proxy/v2/letter/5/b487fb/{size}.png", 6 | "active": false, 7 | "admin": false, 8 | "moderator": false, 9 | "last_seen_at": null, 10 | "last_emailed_at": null, 11 | "created_at": "2016-10-29T15:20:19.173Z", 12 | "last_seen_age": null, 13 | "last_emailed_age": null, 14 | "created_at_age": "24h", 15 | "username_lower": "5crsw24c3pggqf", 16 | "trust_level": 1, 17 | "trust_level_locked": false, 18 | "flag_level": 0, 19 | "title": null, 20 | "suspended_at": null, 21 | "suspended_till": null, 22 | "suspended": null, 23 | "blocked": false, 24 | "time_read": "< 1m", 25 | "staged": false, 26 | "days_visited": 0, 27 | "posts_read_count": 0, 28 | "topics_entered": 0, 29 | "post_count": 0 30 | }, 31 | { 32 | "id": 2, 33 | "username": "5idw7vqszylqrg", 34 | "avatar_template": "/letter_avatar_proxy/v2/letter/5/f6c823/{size}.png", 35 | "active": false, 36 | "admin": false, 37 | "moderator": false, 38 | "last_seen_at": null, 39 | "last_emailed_at": null, 40 | "created_at": "2016-10-29T12:36:44.812Z", 41 | "last_seen_age": null, 42 | "last_emailed_age": null, 43 | "created_at_age": "1d", 44 | "username_lower": "5idw7vqszylqrg", 45 | "trust_level": 1, 46 | "trust_level_locked": false, 47 | "flag_level": 0, 48 | "title": null, 49 | "suspended_at": "2016-10-29T12:37:06.487Z", 50 | "suspended_till": "2016-10-29T12:37:06.486Z", 51 | "suspended": false, 52 | "blocked": false, 53 | "time_read": "< 1m", 54 | "staged": false, 55 | "days_visited": 0, 56 | "posts_read_count": 0, 57 | "topics_entered": 0, 58 | "post_count": 0 59 | }, 60 | { 61 | "id": 1, 62 | "username": "discourse1", 63 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/da6949/{size}.png", 64 | "email": "user@example.com", 65 | "active": true, 66 | "admin": true, 67 | "moderator": false, 68 | "last_seen_at": "2016-10-30T14:49:22.713Z", 69 | "last_emailed_at": "2016-10-27T11:45:14.045Z", 70 | "created_at": "2016-10-27T11:43:46.817Z", 71 | "last_seen_age": "1m", 72 | "last_emailed_age": "3d", 73 | "created_at_age": "3d", 74 | "username_lower": "discourse1", 75 | "trust_level": 0, 76 | "trust_level_locked": false, 77 | "flag_level": 0, 78 | "title": null, 79 | "suspended_at": null, 80 | "suspended_till": null, 81 | "suspended": null, 82 | "blocked": false, 83 | "time_read": "3m", 84 | "staged": false, 85 | "days_visited": 4, 86 | "posts_read_count": 8, 87 | "topics_entered": 2, 88 | "post_count": 6 89 | }, 90 | { 91 | "id": -1, 92 | "username": "system", 93 | "avatar_template": "/letter_avatar_proxy/v2/letter/s/bcef8e/{size}.png", 94 | "active": true, 95 | "admin": true, 96 | "moderator": true, 97 | "last_seen_at": null, 98 | "last_emailed_at": null, 99 | "created_at": "2016-10-21T02:29:07.851Z", 100 | "last_seen_age": null, 101 | "last_emailed_age": null, 102 | "created_at_age": "10d", 103 | "username_lower": "system", 104 | "trust_level": 4, 105 | "trust_level_locked": false, 106 | "flag_level": 0, 107 | "title": null, 108 | "suspended_at": null, 109 | "suspended_till": null, 110 | "suspended": null, 111 | "blocked": false, 112 | "time_read": "< 1m", 113 | "staged": false, 114 | "days_visited": 0, 115 | "posts_read_count": 14, 116 | "topics_entered": 0, 117 | "post_count": 13 118 | } 119 | ] 120 | -------------------------------------------------------------------------------- /responses/users/new_user_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "success": true, 3 | "active": false, 4 | "message": "

You're almost done! We sent an activation mail to weqsl7yieqfz9w@example.com. Please follow the instructions in the email to activate your account.

If it doesn't arrive, check your spam folder, or try to log in again to send another activation mail.

", 5 | "user_id": 25 6 | } 7 | -------------------------------------------------------------------------------- /responses/users/staff_list.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "username": "discourse1", 5 | "avatar_template": "/letter_avatar_proxy/v2/letter/d/da6949/{size}.png", 6 | "email": "user@example.com", 7 | "active": true, 8 | "admin": true, 9 | "moderator": false, 10 | "last_seen_at": "2016-10-31T11:24:16.907Z", 11 | "last_emailed_at": "2016-10-27T11:45:14.045Z", 12 | "created_at": "2016-10-27T11:43:46.817Z", 13 | "last_seen_age": "9m", 14 | "last_emailed_age": "4d", 15 | "created_at_age": "4d", 16 | "username_lower": "discourse1", 17 | "trust_level": 0, 18 | "trust_level_locked": false, 19 | "flag_level": 0, 20 | "title": null, 21 | "suspended_at": null, 22 | "suspended_till": null, 23 | "suspended": null, 24 | "blocked": false, 25 | "time_read": "3m", 26 | "staged": false, 27 | "days_visited": 5, 28 | "posts_read_count": 8, 29 | "topics_entered": 2, 30 | "post_count": 6 31 | }, 32 | { 33 | "id": -1, 34 | "username": "system", 35 | "avatar_template": "/letter_avatar_proxy/v2/letter/s/bcef8e/{size}.png", 36 | "active": true, 37 | "admin": true, 38 | "moderator": true, 39 | "last_seen_at": null, 40 | "last_emailed_at": null, 41 | "created_at": "2016-10-21T02:29:07.851Z", 42 | "last_seen_age": null, 43 | "last_emailed_age": null, 44 | "created_at_age": "10d", 45 | "username_lower": "system", 46 | "trust_level": 4, 47 | "trust_level_locked": false, 48 | "flag_level": 0, 49 | "title": null, 50 | "suspended_at": null, 51 | "suspended_till": null, 52 | "suspended": null, 53 | "blocked": false, 54 | "time_read": "< 1m", 55 | "staged": false, 56 | "days_visited": 0, 57 | "posts_read_count": 14, 58 | "topics_entered": 0, 59 | "post_count": 13 60 | } 61 | ] 62 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var express = require("express"); 2 | var app = express(); 3 | var yaml = require("yamljs"); 4 | var fs = require("fs"); 5 | var refParser = require("json-schema-ref-parser"); 6 | var args = process.argv.slice(2); 7 | 8 | app.get("/", function (req, res) { 9 | res.sendFile(__dirname + "/local.html"); 10 | }); 11 | 12 | app.get("/openapifile", function (req, res) { 13 | if (args[0] == "json") { 14 | fs.readFile("openapi.json", "utf8", function (err, data) { 15 | var json = JSON.parse(data); 16 | if (err) throw err; 17 | refParser.dereference(json, function (err, schema) { 18 | if (err) { 19 | console.error(err); 20 | } else { 21 | res.send(schema); 22 | } 23 | }); 24 | }); 25 | } else { 26 | fs.readFile("openapi.yml", "utf8", function (err, data) { 27 | if (err) throw err; 28 | var json = yaml.parse(data); 29 | refParser.dereference(json, function (err, schema) { 30 | if (err) { 31 | console.error(err); 32 | } else { 33 | res.send(schema); 34 | } 35 | }); 36 | }); 37 | } 38 | }); 39 | 40 | app.listen(3001, function () { 41 | console.log("listening on http://localhost:3001"); 42 | }); 43 | -------------------------------------------------------------------------------- /to_json.rb: -------------------------------------------------------------------------------- 1 | require 'json' 2 | require 'json_schema_ref_parser' 3 | 4 | def read_yml_file(file) 5 | #yml_file = File.open(file, 'r') 6 | #yml = yml_file.read 7 | #yml_file.close 8 | #YAML::load(yml) 9 | YAML.load_file(file) 10 | end 11 | 12 | def write_json_file(json) 13 | File.open('openapi.json', 'w') { |file| file.write(json) } 14 | end 15 | 16 | schema = read_yml_file('openapi.yml') 17 | result = JsonSchemaRefParser::RefParser.dereference(schema) 18 | write_json_file(JSON.pretty_generate(result)) 19 | -------------------------------------------------------------------------------- /tojson.js: -------------------------------------------------------------------------------- 1 | var yaml = require('yamljs'); 2 | var fs = require('fs'); 3 | var refParser = require('json-schema-ref-parser'); 4 | 5 | var ymlFile; 6 | fs.readFile('openapi.yml', 'utf8', function(err, data) { 7 | if (err) throw err; 8 | var json = yaml.parse(data); 9 | refParser.dereference(json, function(err, schema) { 10 | if (err) { 11 | console.error(err); 12 | } else { 13 | fs.writeFile('openapi.json', JSON.stringify(schema, null, 2).concat('\n'), function(err) { 14 | if (err) return console.log(err); 15 | console.log('yml converted to json'); 16 | }); 17 | } 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /toschema.js: -------------------------------------------------------------------------------- 1 | var gen = require('json-schema-generator'); 2 | var yaml = require('yamljs'); 3 | var fs = require('fs'); 4 | var inputFile = ''; 5 | var outputFile = ''; 6 | 7 | if (process.argv.length > 3) { 8 | inputFile = process.argv[2]; 9 | outputFile = process.argv[3]; 10 | } else { 11 | console.log('Please specify input and output files!'); 12 | console.log('node schema.js input.json output.yml'); 13 | } 14 | 15 | var addTypeIfEmptyObject = function(obj) { 16 | for(var i in obj) { 17 | if (typeof obj[i] === "object") { 18 | if (Object.keys(obj[i]).length === 0) { 19 | obj[i] = {type: "object"}; 20 | } else { 21 | addTypeIfEmptyObject(obj[i]); 22 | } 23 | } 24 | } 25 | return null; 26 | } 27 | 28 | fs.readFile(inputFile, 'utf8', function(err, data) { 29 | if (err) throw err; 30 | var json = JSON.parse(data); 31 | var schema = gen(json); 32 | delete schema.required; 33 | 34 | 35 | //there are some properties without types on them(they should just be set to `null`) 36 | addTypeIfEmptyObject(schema.properties); 37 | 38 | var yml = yaml.stringify(schema, 16, 2); 39 | 40 | fs.writeFile(outputFile, yml, function(err) { 41 | if (err) return console.log(err); 42 | console.log('converted json response to yml schema'); 43 | }); 44 | 45 | }); 46 | 47 | --------------------------------------------------------------------------------