From 13288c5626fc336fc01d5b04026bce00f881e8db Mon Sep 17 00:00:00 2001 From: Fernando Valverde Date: Fri, 3 Feb 2023 05:43:48 -0600 Subject: [PATCH] API V1 Users docs (#19046) * /users/me api docs * Updated api_v1.json * Missing users api docs --- spec/requests/api/v1/docs/articles_spec.rb | 8 +- spec/requests/api/v1/docs/users_spec.rb | 72 ++ spec/swagger_helper.rb | 25 + swagger/v1/api_v1.json | 933 ++++++++++++++------- 4 files changed, 733 insertions(+), 305 deletions(-) diff --git a/spec/requests/api/v1/docs/articles_spec.rb b/spec/requests/api/v1/docs/articles_spec.rb index 726324e29..046b21e66 100644 --- a/spec/requests/api/v1/docs/articles_spec.rb +++ b/spec/requests/api/v1/docs/articles_spec.rb @@ -307,7 +307,7 @@ It supports pagination, each page will contain 30 articles by default." describe "GET /articles/me" do path "/api/articles/me" do get "User's articles" do - tags "articles" + tags "articles", "users" description "This endpoint allows the client to retrieve a list of published articles on behalf of an authenticated user. \"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code. @@ -340,7 +340,7 @@ It will return published articles with pagination. By default a page will contai path "/api/articles/me/published" do get "User's published articles" do - tags "articles" + tags "articles", "users" description "This endpoint allows the client to retrieve a list of published articles on behalf of an authenticated user. \"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code. @@ -373,7 +373,7 @@ It will return published articles with pagination. By default a page will contai path "/api/articles/me/unpublished" do get "User's unpublished articles" do - tags "articles" + tags "articles", "users" description "This endpoint allows the client to retrieve a list of unpublished articles on behalf of an authenticated user. \"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code. @@ -406,7 +406,7 @@ It will return unpublished articles with pagination. By default a page will cont path "/api/articles/me/all" do get "User's all articles" do - tags "articles" + tags "articles", "users" description "This endpoint allows the client to retrieve a list of all articles on behalf of an authenticated user. \"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code. diff --git a/spec/requests/api/v1/docs/users_spec.rb b/spec/requests/api/v1/docs/users_spec.rb index 006b08de2..830669aff 100644 --- a/spec/requests/api/v1/docs/users_spec.rb +++ b/spec/requests/api/v1/docs/users_spec.rb @@ -17,6 +17,31 @@ RSpec.describe "Api::V1::Docs::Users" do user.add_role(:admin) end + describe "GET /users/me" do + path "/api/users/me" do + get "The authenticated user" do + tags "users" + description "This endpoint allows the client to retrieve information about the authenticated user" + operationId "getUserMe" + produces "application/json" + + response 200, "successful" do + let(:"api-key") { api_secret.secret } + schema type: :object, + items: { "$ref": "#/components/schemas/User" } + add_examples + run_test! + end + + response "401", "Unauthorized" do + let(:"api-key") { "bad_api_secret" } + add_examples + run_test! + end + end + end + end + describe "GET /users/:id" do path "/api/users/{id}" do get "A User" do @@ -32,6 +57,8 @@ For complete documentation, see the v0 API docs: https://developers.forem.com/ap response(200, "successful") do let(:"api-key") { api_secret.secret } let(:id) { user.id } + schema type: :object, + items: { "$ref": "#/components/schemas/User" } run_test! end @@ -155,6 +182,51 @@ in the UI, so if you want them to know about this, you must notify them." end end end + + describe "POST /api/admin/users" do + before do + user.add_role(:super_admin) + end + + path "/api/admin/users" do + post "Invite a User" do + tags "users" + description "This endpoint allows the client to trigger an invitation to the provided email address. + + It requires a token from a user with `super_admin` privileges." + operationId "postAdminUsersCreate" + produces "application/json" + consumes "application/json" + parameter name: :invitation, + in: :body, + description: "User invite params", + schema: { "$ref": "#/components/schemas/UserInviteParam" } + + response "200", "Successful" do + let(:"api-key") { api_secret.secret } + let(:invitation) { { name: "User McUser", email: "user@mcuser.com" } } + add_examples + run_test! + end + + response "401", "Unauthorized" do + let(:regular_user) { create(:user) } + let(:low_security_api_secret) { create(:api_secret, user: regular_user) } + let(:"api-key") { low_security_api_secret.secret } + let(:invitation) { { name: "User McUser", email: "user@mcuser.com" } } + add_examples + run_test! + end + + response "422", "Unprocessable Entity" do + let(:"api-key") { api_secret.secret } + let(:invitation) { {} } + add_examples + run_test! + end + end + end + end end # rubocop:enable RSpec/VariableName # rubocop:enable RSpec/EmptyExampleGroup diff --git a/spec/swagger_helper.rb b/spec/swagger_helper.rb index 097928251..a7a3acadf 100644 --- a/spec/swagger_helper.rb +++ b/spec/swagger_helper.rb @@ -323,6 +323,31 @@ The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment created_at: { type: :string, format: "date-time" }, image_url: { description: "Podcast image url", type: :string, format: :url } } + }, + User: { + description: "The representation of a user", + type: :object, + properties: { + type_of: { type: :string }, + id: { type: :string }, + username: { type: :string }, + name: { type: :string }, + summary: { type: :string }, + twitter_username: { type: :string }, + github_username: { type: :string }, + website_url: { type: :string }, + location: { type: :string }, + joined_at: { type: :string }, + profile_image: { type: :string } + } + }, + UserInviteParam: { + description: "User invite parameters", + type: :object, + properties: { + email: { type: :string }, + name: { type: :string, nullable: true } + } } } } diff --git a/swagger/v1/api_v1.json b/swagger/v1/api_v1.json index bd2364303..dbe225727 100644 --- a/swagger/v1/api_v1.json +++ b/swagger/v1/api_v1.json @@ -9,10 +9,14 @@ "/api/articles": { "post": { "summary": "Publish article", - "tags": ["articles"], + "tags": [ + "articles" + ], "description": "This endpoint allows the client to create a new article.\n\n\"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.", "operationId": "createArticle", - "parameters": [], + "parameters": [ + + ], "responses": { "201": { "description": "An Article", @@ -20,40 +24,42 @@ "application/json": { "example": { "type_of": "article", - "id": 192, + "id": 9019, "title": "New article", "description": "New post example", - "readable_publish_date": "Feb 1", - "slug": "new-article-3i0b", - "path": "/username383/new-article-3i0b", - "url": "http://localhost:3000/username383/new-article-3i0b", + "readable_publish_date": "Feb 3", + "slug": "new-article-2382", + "path": "/username383/new-article-2382", + "url": "http://localhost:3000/username383/new-article-2382", "comments_count": 0, "public_reactions_count": 0, - "collection_id": 11, - "published_timestamp": "2023-02-01T07:45:11Z", + "collection_id": 272, + "published_timestamp": "2023-02-03T11:22:51Z", "positive_reactions_count": 0, "cover_image": "https://thepracticaldev.s3.amazonaws.com/i/5wfo25724gzgk5e5j50g.jpg", "social_image": "https://thepracticaldev.s3.amazonaws.com/i/5wfo25724gzgk5e5j50g.jpg", "canonical_url": "https://dev.to/fdocr/headless-chrome-dual-mode-tests-for-ruby-on-rails-4p6g", - "created_at": "2023-02-01T07:45:11Z", + "created_at": "2023-02-03T11:22:51Z", "edited_at": null, "crossposted_at": null, - "published_at": "2023-02-01T07:45:11Z", - "last_comment_at": "2023-02-01T07:45:11Z", + "published_at": "2023-02-03T11:22:51Z", + "last_comment_at": "2023-02-03T11:22:51Z", "reading_time_minutes": 1, "tag_list": "", - "tags": [], + "tags": [ + + ], "body_html": "

New body for the article

\n\n", "body_markdown": "**New** body for the article", "user": { - "name": "Glinda \"Odell\" \\:/ Sanford", + "name": "Derrick \"Mikaela\" \\:/ Johnson", "username": "username383", "twitter_username": "twitter383", "github_username": "github383", - "user_id": 384, + "user_id": 20437, "website_url": null, - "profile_image": "/uploads/user/profile_image/384/85fbb265-2078-409e-8234-01c7156da84c.jpeg", - "profile_image_90": "/uploads/user/profile_image/384/85fbb265-2078-409e-8234-01c7156da84c.jpeg" + "profile_image": "/uploads/user/profile_image/20437/d95ec3fd-44c0-488b-8c9f-1ef678861960.jpeg", + "profile_image_90": "/uploads/user/profile_image/20437/d95ec3fd-44c0-488b-8c9f-1ef678861960.jpeg" } } } @@ -94,8 +100,12 @@ }, "get": { "summary": "Published articles", - "security": [], - "tags": ["articles"], + "security": [ + + ], + "tags": [ + "articles" + ], "description": "This endpoint allows the client to retrieve a list of articles.\n\n\"Articles\" are all the posts that users create on DEV that typically\nshow up in the feed. They can be a blog post, a discussion question,\na help thread etc. but is referred to as article within the code.\n\nBy default it will return featured, published articles ordered\nby descending popularity.\n\nIt supports pagination, each page will contain `30` articles by default.", "operationId": "getArticles", "parameters": [ @@ -152,7 +162,11 @@ "description": "Using this parameter will allow the client to check which articles are fresh or rising.\n If `state=fresh` the server will return fresh articles.\n If `state=rising` the server will return rising articles.\n This param can be used in conjuction with `username`, only if set to `all`.", "schema": { "type": "string", - "enum": ["fresh", "rising", "all"] + "enum": [ + "fresh", + "rising", + "all" + ] }, "example": "fresh" }, @@ -188,45 +202,47 @@ "example": [ { "type_of": "article", - "id": 195, - "title": "A Swiftly Tilting Planet175", - "description": "Pork belly neutra williamsburg jean shorts 8-bit sustainable marfa. Tousled beard cray wolf. Photo...", - "readable_publish_date": "Feb 1", - "slug": "a-swiftly-tilting-planet175-2l84", - "path": "/username387/a-swiftly-tilting-planet175-2l84", - "url": "http://localhost:3000/username387/a-swiftly-tilting-planet175-2l84", + "id": 9022, + "title": "Fame Is the Spur175", + "description": "Portland helvetica butcher pour-over blue bottle truffaut tote bag. Distillery wayfarers bitters...", + "readable_publish_date": "Feb 3", + "slug": "fame-is-the-spur175-49d8", + "path": "/username387/fame-is-the-spur175-49d8", + "url": "http://localhost:3000/username387/fame-is-the-spur175-49d8", "comments_count": 0, "public_reactions_count": 0, "collection_id": null, - "published_timestamp": "2023-02-01T07:45:11Z", + "published_timestamp": "2023-02-03T11:22:51Z", "positive_reactions_count": 0, - "cover_image": "http://localhost:3000/assets/6-52ee7e994a1369d112d656dfffbf324d1f209a7372a761776f77aeea47b0e4a8.png", - "social_image": "http://localhost:3000/assets/6-52ee7e994a1369d112d656dfffbf324d1f209a7372a761776f77aeea47b0e4a8.png", - "canonical_url": "http://localhost:3000/username387/a-swiftly-tilting-planet175-2l84", - "created_at": "2023-02-01T07:45:11Z", + "cover_image": "http://localhost:3000/assets/4-dcfcc4d8dd259bc0751c2de24b1cf244b181c789934368ca1cb471f0944b695d.png", + "social_image": "http://localhost:3000/assets/4-dcfcc4d8dd259bc0751c2de24b1cf244b181c789934368ca1cb471f0944b695d.png", + "canonical_url": "http://localhost:3000/username387/fame-is-the-spur175-49d8", + "created_at": "2023-02-03T11:22:51Z", "edited_at": null, "crossposted_at": null, - "published_at": "2023-02-01T07:45:11Z", - "last_comment_at": "2023-02-01T07:45:11Z", + "published_at": "2023-02-03T11:22:51Z", + "last_comment_at": "2023-02-03T11:22:51Z", "reading_time_minutes": 1, - "tag_list": ["discuss"], + "tag_list": [ + "discuss" + ], "tags": "discuss", "user": { - "name": "Ned \"Lauren\" \\:/ Fay", + "name": "Randy \"Archie\" \\:/ Williamson", "username": "username387", "twitter_username": "twitter387", "github_username": "github387", - "user_id": 388, + "user_id": 20441, "website_url": null, - "profile_image": "/uploads/user/profile_image/388/72ded4e4-2e21-405a-8d04-2a0b4a468441.jpeg", - "profile_image_90": "/uploads/user/profile_image/388/72ded4e4-2e21-405a-8d04-2a0b4a468441.jpeg" + "profile_image": "/uploads/user/profile_image/20441/6b7108e1-5ef1-43dd-aafb-7605870df614.jpeg", + "profile_image_90": "/uploads/user/profile_image/20441/6b7108e1-5ef1-43dd-aafb-7605870df614.jpeg" }, "organization": { - "name": "Schaefer-Pouros", + "name": "Skiles-Waelchi", "username": "org70", "slug": "org70", - "profile_image": "/uploads/organization/profile_image/70/c63f61d0-73a5-434f-ae81-d450b17c9940.png", - "profile_image_90": "/uploads/organization/profile_image/70/c63f61d0-73a5-434f-ae81-d450b17c9940.png" + "profile_image": "/uploads/organization/profile_image/3600/3ba3748d-cd3f-45a8-b23a-f8a7bebb46b8.png", + "profile_image_90": "/uploads/organization/profile_image/3600/3ba3748d-cd3f-45a8-b23a-f8a7bebb46b8.png" }, "flare_tag": { "name": "discuss", @@ -250,8 +266,12 @@ "/api/articles/latest": { "get": { "summary": "Published articles sorted by published date", - "security": [], - "tags": ["articles"], + "security": [ + + ], + "tags": [ + "articles" + ], "description": "This endpoint allows the client to retrieve a list of articles. ordered by descending publish date.\n\nIt supports pagination, each page will contain 30 articles by default.", "operationId": "getLatestArticles", "parameters": [ @@ -270,38 +290,42 @@ "example": [ { "type_of": "article", - "id": 198, - "title": "The Widening Gyre178", - "description": "Ennui muggle magic helvetica shabby chic jean shorts. Ugh messenger bag mustache meh quinoa 3 wolf...", - "readable_publish_date": "Feb 1", - "slug": "the-widening-gyre178-3cfj", - "path": "/username390/the-widening-gyre178-3cfj", - "url": "http://localhost:3000/username390/the-widening-gyre178-3cfj", + "id": 9025, + "title": "An Instant In The Wind178", + "description": "Vhs drinking hammock. Kitsch vhs master pour-over five dollar toast. Chambray chia ethical iphone...", + "readable_publish_date": "Feb 3", + "slug": "an-instant-in-the-wind178-132o", + "path": "/username390/an-instant-in-the-wind178-132o", + "url": "http://localhost:3000/username390/an-instant-in-the-wind178-132o", "comments_count": 0, "public_reactions_count": 0, "collection_id": null, - "published_timestamp": "2023-02-01T07:45:11Z", + "published_timestamp": "2023-02-03T11:22:51Z", "positive_reactions_count": 0, - "cover_image": "http://localhost:3000/assets/2-1a96ae446ded018b65b215cce3aecc40a00e701642da521fdd6edd3c593ff6c1.png", - "social_image": "http://localhost:3000/assets/2-1a96ae446ded018b65b215cce3aecc40a00e701642da521fdd6edd3c593ff6c1.png", - "canonical_url": "http://localhost:3000/username390/the-widening-gyre178-3cfj", - "created_at": "2023-02-01T07:45:11Z", + "cover_image": "http://localhost:3000/assets/6-52ee7e994a1369d112d656dfffbf324d1f209a7372a761776f77aeea47b0e4a8.png", + "social_image": "http://localhost:3000/assets/6-52ee7e994a1369d112d656dfffbf324d1f209a7372a761776f77aeea47b0e4a8.png", + "canonical_url": "http://localhost:3000/username390/an-instant-in-the-wind178-132o", + "created_at": "2023-02-03T11:22:51Z", "edited_at": null, "crossposted_at": null, - "published_at": "2023-02-01T07:45:11Z", - "last_comment_at": "2023-02-01T07:45:11Z", + "published_at": "2023-02-03T11:22:51Z", + "last_comment_at": "2023-02-03T11:22:51Z", "reading_time_minutes": 1, - "tag_list": ["javascript", "html", "discuss"], + "tag_list": [ + "javascript", + "html", + "discuss" + ], "tags": "javascript, html, discuss", "user": { - "name": "Hermelinda \"Elmer\" \\:/ Padberg", + "name": "Malisa \"Krissy\" \\:/ Metz", "username": "username390", "twitter_username": "twitter390", "github_username": "github390", - "user_id": 391, + "user_id": 20444, "website_url": null, - "profile_image": "/uploads/user/profile_image/391/cf64cdd9-6db4-4ed7-8c11-7c589dfbd5f4.jpeg", - "profile_image_90": "/uploads/user/profile_image/391/cf64cdd9-6db4-4ed7-8c11-7c589dfbd5f4.jpeg" + "profile_image": "/uploads/user/profile_image/20444/a2b538b2-c915-4309-8446-1ee87eb9ad81.jpeg", + "profile_image_90": "/uploads/user/profile_image/20444/a2b538b2-c915-4309-8446-1ee87eb9ad81.jpeg" }, "flare_tag": { "name": "discuss", @@ -311,38 +335,42 @@ }, { "type_of": "article", - "id": 197, - "title": "I Know Why the Caged Bird Sings177", - "description": "Bicycle rights muggle magic gastropub celiac. Jean shorts letterpress umami irony. Yolo celiac...", - "readable_publish_date": "Feb 1", - "slug": "i-know-why-the-caged-bird-sings177-31i7", - "path": "/username389/i-know-why-the-caged-bird-sings177-31i7", - "url": "http://localhost:3000/username389/i-know-why-the-caged-bird-sings177-31i7", + "id": 9024, + "title": "A Darkling Plain177", + "description": "Scenester venmo chia. Pabst keytar shoreditch vice. Pop-up sartorial readymade aesthetic chia...", + "readable_publish_date": "Feb 3", + "slug": "a-darkling-plain177-e3n", + "path": "/username389/a-darkling-plain177-e3n", + "url": "http://localhost:3000/username389/a-darkling-plain177-e3n", "comments_count": 0, "public_reactions_count": 0, "collection_id": null, - "published_timestamp": "2023-02-01T07:45:11Z", + "published_timestamp": "2023-02-03T11:22:51Z", "positive_reactions_count": 0, - "cover_image": "http://localhost:3000/assets/16-77521848e7b5fcc073ac3e0bb004826e97f737238194e4c79330f662cc946ab2.png", - "social_image": "http://localhost:3000/assets/16-77521848e7b5fcc073ac3e0bb004826e97f737238194e4c79330f662cc946ab2.png", - "canonical_url": "http://localhost:3000/username389/i-know-why-the-caged-bird-sings177-31i7", - "created_at": "2023-02-01T07:45:11Z", + "cover_image": "http://localhost:3000/assets/9-1fea7c7f07002fc02de9c2962ca140942c9ad3c92c5e5c1c7bd51fd6025800c0.png", + "social_image": "http://localhost:3000/assets/9-1fea7c7f07002fc02de9c2962ca140942c9ad3c92c5e5c1c7bd51fd6025800c0.png", + "canonical_url": "http://localhost:3000/username389/a-darkling-plain177-e3n", + "created_at": "2023-02-03T11:22:51Z", "edited_at": null, "crossposted_at": null, - "published_at": "2023-02-01T07:45:11Z", - "last_comment_at": "2023-02-01T07:45:11Z", + "published_at": "2023-02-03T11:22:51Z", + "last_comment_at": "2023-02-03T11:22:51Z", "reading_time_minutes": 1, - "tag_list": ["javascript", "html", "discuss"], + "tag_list": [ + "javascript", + "html", + "discuss" + ], "tags": "javascript, html, discuss", "user": { - "name": "Ahmad \"Deonna\" \\:/ Leffler", + "name": "Abraham \"Aldo\" \\:/ Toy", "username": "username389", "twitter_username": "twitter389", "github_username": "github389", - "user_id": 390, + "user_id": 20443, "website_url": null, - "profile_image": "/uploads/user/profile_image/390/856f2d2e-ba5d-4bcc-a11d-a10c5b3ad002.jpeg", - "profile_image_90": "/uploads/user/profile_image/390/856f2d2e-ba5d-4bcc-a11d-a10c5b3ad002.jpeg" + "profile_image": "/uploads/user/profile_image/20443/8fe2d830-a4bd-4feb-ae20-a0ada272c45e.jpeg", + "profile_image_90": "/uploads/user/profile_image/20443/8fe2d830-a4bd-4feb-ae20-a0ada272c45e.jpeg" }, "flare_tag": { "name": "discuss", @@ -352,38 +380,42 @@ }, { "type_of": "article", - "id": 196, - "title": "A Catskill Eagle176", - "description": "Art party pour-over next level sartorial pitchfork single-origin coffee cliche hoodie. Chicharrones...", - "readable_publish_date": "Feb 1", - "slug": "a-catskill-eagle176-2k1h", - "path": "/username388/a-catskill-eagle176-2k1h", - "url": "http://localhost:3000/username388/a-catskill-eagle176-2k1h", + "id": 9023, + "title": "The Way Through the Woods176", + "description": "Craft beer normcore wolf chia. Franzen food truck knausgaard cliche plaid leggings literally. Quinoa...", + "readable_publish_date": "Feb 3", + "slug": "the-way-through-the-woods176-2j8m", + "path": "/username388/the-way-through-the-woods176-2j8m", + "url": "http://localhost:3000/username388/the-way-through-the-woods176-2j8m", "comments_count": 0, "public_reactions_count": 0, "collection_id": null, - "published_timestamp": "2023-02-01T07:45:11Z", + "published_timestamp": "2023-02-03T11:22:51Z", "positive_reactions_count": 0, - "cover_image": "http://localhost:3000/assets/21-8c16e6ef44da175a1e51f1ba9d0cb55af8a920db6aacbf1e4b7a055afc1b3d30.png", - "social_image": "http://localhost:3000/assets/21-8c16e6ef44da175a1e51f1ba9d0cb55af8a920db6aacbf1e4b7a055afc1b3d30.png", - "canonical_url": "http://localhost:3000/username388/a-catskill-eagle176-2k1h", - "created_at": "2023-02-01T07:45:11Z", + "cover_image": "http://localhost:3000/assets/34-d27f3a4a9f6f1f373003c74b31749764691f510b2a18b55039478583864a067e.png", + "social_image": "http://localhost:3000/assets/34-d27f3a4a9f6f1f373003c74b31749764691f510b2a18b55039478583864a067e.png", + "canonical_url": "http://localhost:3000/username388/the-way-through-the-woods176-2j8m", + "created_at": "2023-02-03T11:22:51Z", "edited_at": null, "crossposted_at": null, - "published_at": "2023-02-01T07:45:11Z", - "last_comment_at": "2023-02-01T07:45:11Z", + "published_at": "2023-02-03T11:22:51Z", + "last_comment_at": "2023-02-03T11:22:51Z", "reading_time_minutes": 1, - "tag_list": ["javascript", "html", "discuss"], + "tag_list": [ + "javascript", + "html", + "discuss" + ], "tags": "javascript, html, discuss", "user": { - "name": "Jamey \"Gilbert\" \\:/ Gottlieb", + "name": "Ethan \"Nicolle\" \\:/ Leannon", "username": "username388", "twitter_username": "twitter388", "github_username": "github388", - "user_id": 389, + "user_id": 20442, "website_url": null, - "profile_image": "/uploads/user/profile_image/389/66dc3733-ec90-40cf-9a80-3385c6b35a9e.jpeg", - "profile_image_90": "/uploads/user/profile_image/389/66dc3733-ec90-40cf-9a80-3385c6b35a9e.jpeg" + "profile_image": "/uploads/user/profile_image/20442/37fea229-974d-4314-93b8-028f946d0012.jpeg", + "profile_image_90": "/uploads/user/profile_image/20442/37fea229-974d-4314-93b8-028f946d0012.jpeg" }, "flare_tag": { "name": "discuss", @@ -407,8 +439,12 @@ "/api/articles/{id}": { "get": { "summary": "Published article by id", - "security": [], - "tags": ["articles"], + "security": [ + + ], + "tags": [ + "articles" + ], "description": "This endpoint allows the client to retrieve a single published article given its `id`.", "operationId": "getArticleById", "parameters": [ @@ -428,40 +464,42 @@ "application/json": { "example": { "type_of": "article", - "id": 199, - "title": "The Mirror Crack'd from Side to Side179", - "description": "Banh mi schlitz forage narwhal knausgaard bitters. Crucifix aesthetic chartreuse skateboard...", - "readable_publish_date": "Feb 1", - "slug": "the-mirror-crackd-from-side-to-side179-oih", - "path": "/username391/the-mirror-crackd-from-side-to-side179-oih", - "url": "http://localhost:3000/username391/the-mirror-crackd-from-side-to-side179-oih", + "id": 9026, + "title": "The Violent Bear It Away179", + "description": "Chartreuse waistcoat bitters. Pour-over dreamcatcher whatever marfa. Letterpress everyday bitters...", + "readable_publish_date": "Feb 3", + "slug": "the-violent-bear-it-away179-14e2", + "path": "/username391/the-violent-bear-it-away179-14e2", + "url": "http://localhost:3000/username391/the-violent-bear-it-away179-14e2", "comments_count": 0, "public_reactions_count": 0, "collection_id": null, - "published_timestamp": "2023-02-01T07:45:12Z", + "published_timestamp": "2023-02-03T11:22:51Z", "positive_reactions_count": 0, - "cover_image": "http://localhost:3000/assets/32-543e7c7f0a939e829c37aab48d705350b855c887dc16dfab30fd9a0825c09291.png", - "social_image": "http://localhost:3000/assets/32-543e7c7f0a939e829c37aab48d705350b855c887dc16dfab30fd9a0825c09291.png", - "canonical_url": "http://localhost:3000/username391/the-mirror-crackd-from-side-to-side179-oih", - "created_at": "2023-02-01T07:45:12Z", + "cover_image": "http://localhost:3000/assets/40-57aabe055a9fc60491e0fca9a4dade362141764e7ad214956bbfc9c9e69763b0.png", + "social_image": "http://localhost:3000/assets/40-57aabe055a9fc60491e0fca9a4dade362141764e7ad214956bbfc9c9e69763b0.png", + "canonical_url": "http://localhost:3000/username391/the-violent-bear-it-away179-14e2", + "created_at": "2023-02-03T11:22:51Z", "edited_at": null, "crossposted_at": null, - "published_at": "2023-02-01T07:45:12Z", - "last_comment_at": "2023-02-01T07:45:12Z", + "published_at": "2023-02-03T11:22:51Z", + "last_comment_at": "2023-02-03T11:22:51Z", "reading_time_minutes": 1, "tag_list": "discuss", - "tags": ["discuss"], - "body_html": "

Banh mi schlitz forage narwhal knausgaard bitters. Crucifix aesthetic chartreuse skateboard single-origin coffee lo-fi +1 poutine. Church-key whatever vhs master shabby chic kitsch.

\n\n

Humblebrag marfa authentic crucifix bicycle rights. Flexitarian lomo ugh. Plaid ugh blue bottle seitan umami chicharrones.

\n\n", - "body_markdown": "---\ntitle: The Mirror Crack'd from Side to Side179\npublished: true\ntags: discuss\ndate: \nseries: \ncanonical_url: \n\n---\n\nBanh mi schlitz forage narwhal knausgaard bitters. Crucifix aesthetic chartreuse skateboard single-origin coffee lo-fi +1 poutine. Church-key whatever vhs master shabby chic kitsch.\n\n\nHumblebrag marfa authentic crucifix bicycle rights. Flexitarian lomo ugh. Plaid ugh blue bottle seitan umami chicharrones.\n\n", + "tags": [ + "discuss" + ], + "body_html": "

Chartreuse waistcoat bitters. Pour-over dreamcatcher whatever marfa. Letterpress everyday bitters venmo readymade sartorial.

\n\n

Diy farm-to-table street venmo vice readymade direct trade fixie.

\n\n", + "body_markdown": "---\ntitle: The Violent Bear It Away179\npublished: true\ntags: discuss\ndate: \nseries: \ncanonical_url: \n\n---\n\nChartreuse waistcoat bitters. Pour-over dreamcatcher whatever marfa. Letterpress everyday bitters venmo readymade sartorial.\n\n\nDiy farm-to-table street venmo vice readymade direct trade fixie.\n\n", "user": { - "name": "Deshawn \"Frederica\" \\:/ Lynch", + "name": "Eugene \"Columbus\" \\:/ Schuster", "username": "username391", "twitter_username": "twitter391", "github_username": "github391", - "user_id": 392, + "user_id": 20445, "website_url": null, - "profile_image": "/uploads/user/profile_image/392/cc436845-964b-445e-a84a-10a6e1d1bc20.jpeg", - "profile_image_90": "/uploads/user/profile_image/392/cc436845-964b-445e-a84a-10a6e1d1bc20.jpeg" + "profile_image": "/uploads/user/profile_image/20445/186ee58d-02b2-4854-8766-aee69186204c.jpeg", + "profile_image_90": "/uploads/user/profile_image/20445/186ee58d-02b2-4854-8766-aee69186204c.jpeg" }, "flare_tag": { "name": "discuss", @@ -493,7 +531,9 @@ }, "put": { "summary": "Update an article by id", - "tags": ["articles"], + "tags": [ + "articles" + ], "description": "This endpoint allows the client to update an existing article.\n\n\"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.", "operationId": "updateArticle", "parameters": [ @@ -517,40 +557,42 @@ "application/json": { "example": { "type_of": "article", - "id": 200, - "title": "Many Waters180", - "description": "Austin vinyl cold-pressed yr tumblr. Marfa locavore etsy seitan gluten-free lomo. Street viral diy...", - "readable_publish_date": "Feb 1", - "slug": "many-waters180-3fge", - "path": "/username392/many-waters180-3fge", - "url": "http://localhost:3000/username392/many-waters180-3fge", + "id": 9027, + "title": "A Farewell to Arms180", + "description": "Meh cray vinegar twee meggings. Yuccie waistcoat quinoa squid blog kickstarter artisan loko. Hoodie...", + "readable_publish_date": "Feb 3", + "slug": "a-farewell-to-arms180-234n", + "path": "/username392/a-farewell-to-arms180-234n", + "url": "http://localhost:3000/username392/a-farewell-to-arms180-234n", "comments_count": 0, "public_reactions_count": 0, "collection_id": null, - "published_timestamp": "2023-02-01T07:45:12Z", + "published_timestamp": "2023-02-03T11:22:51Z", "positive_reactions_count": 0, - "cover_image": "http://localhost:3000/assets/5-ae4b452d58aedebf5435dbbd1978ea4acacf8657e6bef44304a3fccde0dd04ea.png", - "social_image": "http://localhost:3000/assets/5-ae4b452d58aedebf5435dbbd1978ea4acacf8657e6bef44304a3fccde0dd04ea.png", - "canonical_url": "http://localhost:3000/username392/many-waters180-3fge", - "created_at": "2023-02-01T07:45:12Z", - "edited_at": "2023-02-01T07:45:12Z", + "cover_image": "http://localhost:3000/assets/21-8c16e6ef44da175a1e51f1ba9d0cb55af8a920db6aacbf1e4b7a055afc1b3d30.png", + "social_image": "http://localhost:3000/assets/21-8c16e6ef44da175a1e51f1ba9d0cb55af8a920db6aacbf1e4b7a055afc1b3d30.png", + "canonical_url": "http://localhost:3000/username392/a-farewell-to-arms180-234n", + "created_at": "2023-02-03T11:22:51Z", + "edited_at": "2023-02-03T11:22:52Z", "crossposted_at": null, - "published_at": "2023-02-01T07:45:12Z", - "last_comment_at": "2023-02-01T07:45:12Z", + "published_at": "2023-02-03T11:22:51Z", + "last_comment_at": "2023-02-03T11:22:51Z", "reading_time_minutes": 1, "tag_list": "", - "tags": [], + "tags": [ + + ], "body_html": "

New body for the article

\n\n", "body_markdown": "**New** body for the article", "user": { - "name": "Rodrick \"Melany\" \\:/ Wiegand", + "name": "Angelyn \"Ismael\" \\:/ King", "username": "username392", "twitter_username": "twitter392", "github_username": "github392", - "user_id": 393, + "user_id": 20446, "website_url": null, - "profile_image": "/uploads/user/profile_image/393/1bf91da9-6287-4f19-813b-174926e3dc21.jpeg", - "profile_image_90": "/uploads/user/profile_image/393/1bf91da9-6287-4f19-813b-174926e3dc21.jpeg" + "profile_image": "/uploads/user/profile_image/20446/c3bc98cc-bb94-4bb2-99c4-f9d2234e8ca3.jpeg", + "profile_image_90": "/uploads/user/profile_image/20446/c3bc98cc-bb94-4bb2-99c4-f9d2234e8ca3.jpeg" } } } @@ -604,8 +646,12 @@ "/api/articles/{username}/{slug}": { "get": { "summary": "Published article by path", - "security": [], - "tags": ["articles"], + "security": [ + + ], + "tags": [ + "articles" + ], "description": "This endpoint allows the client to retrieve a single published article given its `path`.", "operationId": "getArticleByPath", "parameters": [ @@ -633,40 +679,42 @@ "application/json": { "example": { "type_of": "article", - "id": 203, - "title": "The Cricket on the Hearth183", - "description": "Brooklyn chillwave mlkshk stumptown carry goth post-ironic pabst. Small batch butcher tumblr normcore...", - "readable_publish_date": "Feb 1", - "slug": "the-cricket-on-the-hearth183-1pld", - "path": "/username396/the-cricket-on-the-hearth183-1pld", - "url": "http://localhost:3000/username396/the-cricket-on-the-hearth183-1pld", + "id": 9030, + "title": "The Soldier's Art183", + "description": "Green juice meggings quinoa keffiyeh knausgaard kickstarter fashion axe. Sustainable lo-fi artisan...", + "readable_publish_date": "Feb 3", + "slug": "the-soldiers-art183-10j9", + "path": "/username396/the-soldiers-art183-10j9", + "url": "http://localhost:3000/username396/the-soldiers-art183-10j9", "comments_count": 0, "public_reactions_count": 0, "collection_id": null, - "published_timestamp": "2023-02-01T07:45:12Z", + "published_timestamp": "2023-02-03T11:22:52Z", "positive_reactions_count": 0, - "cover_image": "http://localhost:3000/assets/16-77521848e7b5fcc073ac3e0bb004826e97f737238194e4c79330f662cc946ab2.png", - "social_image": "http://localhost:3000/assets/16-77521848e7b5fcc073ac3e0bb004826e97f737238194e4c79330f662cc946ab2.png", - "canonical_url": "http://localhost:3000/username396/the-cricket-on-the-hearth183-1pld", - "created_at": "2023-02-01T07:45:12Z", + "cover_image": "http://localhost:3000/assets/39-20fc2599938fbd7c41146577147aa7c6925e3b8ff069aba58c9304bc1b944cf1.png", + "social_image": "http://localhost:3000/assets/39-20fc2599938fbd7c41146577147aa7c6925e3b8ff069aba58c9304bc1b944cf1.png", + "canonical_url": "http://localhost:3000/username396/the-soldiers-art183-10j9", + "created_at": "2023-02-03T11:22:52Z", "edited_at": null, "crossposted_at": null, - "published_at": "2023-02-01T07:45:12Z", - "last_comment_at": "2023-02-01T07:45:12Z", + "published_at": "2023-02-03T11:22:52Z", + "last_comment_at": "2023-02-03T11:22:52Z", "reading_time_minutes": 1, "tag_list": "discuss", - "tags": ["discuss"], - "body_html": "

Brooklyn chillwave mlkshk stumptown carry goth post-ironic pabst. Small batch butcher tumblr normcore sriracha letterpress try-hard cred. Chartreuse xoxo selvage wolf pour-over celiac cred mixtape.

\n\n

Actually skateboard whatever authentic. 3 wolf moon beard narwhal heirloom chambray park whatever.

\n\n", - "body_markdown": "---\ntitle: The Cricket on the Hearth183\npublished: true\ntags: discuss\ndate: \nseries: \ncanonical_url: \n\n---\n\nBrooklyn chillwave mlkshk stumptown carry goth post-ironic pabst. Small batch butcher tumblr normcore sriracha letterpress try-hard cred. Chartreuse xoxo selvage wolf pour-over celiac cred mixtape.\n\n\nActually skateboard whatever authentic. 3 wolf moon beard narwhal heirloom chambray park whatever.\n\n", + "tags": [ + "discuss" + ], + "body_html": "

Green juice meggings quinoa keffiyeh knausgaard kickstarter fashion axe. Sustainable lo-fi artisan lumbersexual etsy whatever. Chambray carry cornhole.

\n\n

Sartorial single-origin coffee forage pabst waistcoat fixie lumbersexual mumblecore. Bushwick drinking knausgaard.

\n\n", + "body_markdown": "---\ntitle: The Soldier's Art183\npublished: true\ntags: discuss\ndate: \nseries: \ncanonical_url: \n\n---\n\nGreen juice meggings quinoa keffiyeh knausgaard kickstarter fashion axe. Sustainable lo-fi artisan lumbersexual etsy whatever. Chambray carry cornhole.\n\n\nSartorial single-origin coffee forage pabst waistcoat fixie lumbersexual mumblecore. Bushwick drinking knausgaard.\n\n", "user": { - "name": "Joaquina \"Valerie\" \\:/ Lynch", + "name": "Pearle \"Antoinette\" \\:/ Hansen", "username": "username396", "twitter_username": "twitter396", "github_username": "github396", - "user_id": 397, + "user_id": 20450, "website_url": null, - "profile_image": "/uploads/user/profile_image/397/766523f4-71de-4144-8038-384d248db779.jpeg", - "profile_image_90": "/uploads/user/profile_image/397/766523f4-71de-4144-8038-384d248db779.jpeg" + "profile_image": "/uploads/user/profile_image/20450/efdcc053-b6be-48ce-9415-4e70b612484b.jpeg", + "profile_image_90": "/uploads/user/profile_image/20450/efdcc053-b6be-48ce-9415-4e70b612484b.jpeg" }, "flare_tag": { "name": "discuss", @@ -700,7 +748,10 @@ "/api/articles/me": { "get": { "summary": "User's articles", - "tags": ["articles"], + "tags": [ + "articles", + "users" + ], "description": "This endpoint allows the client to retrieve a list of published articles on behalf of an authenticated user.\n\n\"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.\n\nPublished articles will be in reverse chronological publication order.\n\nIt will return published articles with pagination. By default a page will contain 30 articles.", "operationId": "getUserArticles", "parameters": [ @@ -727,7 +778,9 @@ "description": "A List of the authenticated user's Articles", "content": { "application/json": { - "example": [], + "example": [ + + ], "schema": { "type": "array", "items": { @@ -743,7 +796,10 @@ "/api/articles/me/published": { "get": { "summary": "User's published articles", - "tags": ["articles"], + "tags": [ + "articles", + "users" + ], "description": "This endpoint allows the client to retrieve a list of published articles on behalf of an authenticated user.\n\n\"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.\n\nPublished articles will be in reverse chronological publication order.\n\nIt will return published articles with pagination. By default a page will contain 30 articles.", "operationId": "getUserPublishedArticles", "parameters": [ @@ -770,7 +826,9 @@ "description": "A List of the authenticated user's Articles", "content": { "application/json": { - "example": [], + "example": [ + + ], "schema": { "type": "array", "items": { @@ -786,7 +844,10 @@ "/api/articles/me/unpublished": { "get": { "summary": "User's unpublished articles", - "tags": ["articles"], + "tags": [ + "articles", + "users" + ], "description": "This endpoint allows the client to retrieve a list of unpublished articles on behalf of an authenticated user.\n\n\"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.\n\nUnpublished articles will be in reverse chronological creation order.\n\nIt will return unpublished articles with pagination. By default a page will contain 30 articles.", "operationId": "getUserUnpublishedArticles", "parameters": [ @@ -813,7 +874,9 @@ "description": "A List of the authenticated user's Articles", "content": { "application/json": { - "example": [], + "example": [ + + ], "schema": { "type": "array", "items": { @@ -829,7 +892,10 @@ "/api/articles/me/all": { "get": { "summary": "User's all articles", - "tags": ["articles"], + "tags": [ + "articles", + "users" + ], "description": "This endpoint allows the client to retrieve a list of all articles on behalf of an authenticated user.\n\n\"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code.\n\nIt will return both published and unpublished articles with pagination.\n\nUnpublished articles will be at the top of the list in reverse chronological creation order. Published articles will follow in reverse chronological publication order.\n\nBy default a page will contain 30 articles.", "operationId": "getUserAllArticles", "parameters": [ @@ -856,7 +922,9 @@ "description": "A List of the authenticated user's Articles", "content": { "application/json": { - "example": [], + "example": [ + + ], "schema": { "type": "array", "items": { @@ -872,7 +940,9 @@ "/api/articles/{id}/unpublish": { "put": { "summary": "Unpublish an article", - "tags": ["articles"], + "tags": [ + "articles" + ], "description": "This endpoint allows the client to unpublish an article.\n\nThe user associated with the API key must have any 'admin' or 'moderator' role.\n\nThe article will be unpublished and will no longer be visible to the public. It will remain\nin the database and will set back to draft status on the author's posts dashboard. Any\nnotifications associated with the article will be deleted. Any comments on the article\nwill remain.", "operationId": "unpublishArticle", "parameters": [ @@ -931,8 +1001,12 @@ "/api/comments": { "get": { "summary": "Comments", - "security": [], - "tags": ["comments"], + "security": [ + + ], + "tags": [ + "comments" + ], "description": "This endpoint allows the client to retrieve all comments belonging to an article or podcast episode as threaded conversations.\n\nIt will return the all top level comments with their nested comments as threads. See the format specification for further details.", "operationId": "getCommentsByArticleId", "parameters": [ @@ -965,20 +1039,22 @@ "example": [ { "type_of": "comment", - "id_code": "52", - "created_at": "2023-02-01T07:45:13Z", - "body_html": "

Occupy butcher vinegar tacos bitters marfa bicycle rights. Franzen godard hoodie try-hard wolf. Loko brunch sartorial fashion axe seitan.

\n\n", + "id_code": "6kc", + "created_at": "2023-02-03T11:22:53Z", + "body_html": "

Selfies before they sold out cleanse hella freegan muggle magic fashion axe. Polaroid authentic green juice pbr&b tilde plaid kogi.

\n\n", "user": { - "name": "Maynard \"Elvia\" \\:/ Rowe", + "name": "Brandon \"Ronald\" \\:/ Mohr", "username": "username410", "twitter_username": "twitter410", "github_username": "github410", - "user_id": 411, + "user_id": 20464, "website_url": null, - "profile_image": "/uploads/user/profile_image/411/0e38b986-02ff-42f9-8b35-1693ec000fd4.jpeg", - "profile_image_90": "/uploads/user/profile_image/411/0e38b986-02ff-42f9-8b35-1693ec000fd4.jpeg" + "profile_image": "/uploads/user/profile_image/20464/3445bead-6593-47c3-905c-ad9f4496fac7.jpeg", + "profile_image_90": "/uploads/user/profile_image/20464/3445bead-6593-47c3-905c-ad9f4496fac7.jpeg" }, - "children": [] + "children": [ + + ] } ], "schema": { @@ -1007,8 +1083,12 @@ "/api/comments/{id}": { "get": { "summary": "Comment by id", - "security": [], - "tags": ["comments"], + "security": [ + + ], + "tags": [ + "comments" + ], "description": "This endpoint allows the client to retrieve a comment as well as his descendants comments.\n\n It will return the required comment (the root) with its nested descendants as a thread.\n\n See the format specification for further details.", "operationId": "getCommentById", "parameters": [ @@ -1030,20 +1110,22 @@ "application/json": { "example": { "type_of": "comment", - "id_code": "54", - "created_at": "2023-02-01T07:45:13Z", - "body_html": "

Selfies paleo diy marfa wes anderson. Franzen schlitz kale chips.

\n\n", + "id_code": "6ke", + "created_at": "2023-02-03T11:22:53Z", + "body_html": "

Letterpress health banjo farm-to-table.

\n\n", "user": { - "name": "Jimmie \"Nicholle\" \\:/ Ritchie", + "name": "Garland \"Fay\" \\:/ Osinski", "username": "username414", "twitter_username": "twitter414", "github_username": "github414", - "user_id": 415, + "user_id": 20468, "website_url": null, - "profile_image": "/uploads/user/profile_image/415/cbcc4007-d206-4b6f-a09f-325b5292e39e.jpeg", - "profile_image_90": "/uploads/user/profile_image/415/cbcc4007-d206-4b6f-a09f-325b5292e39e.jpeg" + "profile_image": "/uploads/user/profile_image/20468/1a8f5335-824b-434c-af42-6706128f1101.jpeg", + "profile_image_90": "/uploads/user/profile_image/20468/1a8f5335-824b-434c-af42-6706128f1101.jpeg" }, - "children": [] + "children": [ + + ] } } } @@ -1065,14 +1147,18 @@ "/api/display_ads": { "get": { "summary": "display ads", - "tags": ["display ads"], + "tags": [ + "display ads" + ], "description": "This endpoint allows the client to retrieve a list of all display ads.", "responses": { "200": { "description": "successful", "content": { "application/json": { - "example": [] + "example": [ + + ] } } }, @@ -1091,21 +1177,25 @@ }, "post": { "summary": "display ads", - "tags": ["display ads"], + "tags": [ + "display ads" + ], "description": "This endpoint allows the client to create a new display ad.", - "parameters": [], + "parameters": [ + + ], "responses": { "200": { "description": "successful", "content": { "application/json": { "example": { - "id": 10, + "id": 388, "approved": true, "body_markdown": "# Hi, this is ad\nYep, it's an ad", "cached_tag_list": "", "clicks_count": 0, - "created_at": "2023-02-01T16:45:13.837+09:00", + "created_at": "2023-02-03T18:22:53.621+07:00", "display_to": "all", "impressions_count": 0, "name": "Example Ad", @@ -1115,7 +1205,7 @@ "published": true, "success_rate": 0.0, "type_of": "in_house", - "updated_at": "2023-02-01T16:45:13.837+09:00", + "updated_at": "2023-02-03T18:22:53.621+07:00", "tag_list": "" } } @@ -1187,7 +1277,11 @@ }, "display_to": { "type": "string", - "enum": ["all", "logged_in", "logged_out"], + "enum": [ + "all", + "logged_in", + "logged_out" + ], "default": "all", "description": "Potentially limits visitors to whom the ad is visible" }, @@ -1207,7 +1301,11 @@ "description": "Tags on which this ad can be displayed (blank is all/any tags)" } }, - "required": ["name", "body_markdown", "placement_area"] + "required": [ + "name", + "body_markdown", + "placement_area" + ] } } } @@ -1217,7 +1315,9 @@ "/api/display_ads/{id}": { "get": { "summary": "display ad", - "tags": ["display ads"], + "tags": [ + "display ads" + ], "description": "This endpoint allows the client to retrieve a single display ad, via its id.", "parameters": [ { @@ -1239,22 +1339,22 @@ "content": { "application/json": { "example": { - "id": 11, + "id": 389, "approved": false, "body_markdown": "Hello _hey_ Hey hey 9", "cached_tag_list": "", "clicks_count": 0, - "created_at": "2023-02-01T16:45:13.974+09:00", + "created_at": "2023-02-03T18:22:53.751+07:00", "display_to": "all", "impressions_count": 0, - "name": "Display Ad 11", - "organization_id": 71, + "name": "Display Ad 389", + "organization_id": 3601, "placement_area": "sidebar_left", "processed_html": "

Hello hey Hey hey 9

", "published": false, "success_rate": 0.0, "type_of": "in_house", - "updated_at": "2023-02-01T16:45:13.977+09:00", + "updated_at": "2023-02-03T18:22:53.753+07:00", "tag_list": "" } } @@ -1286,7 +1386,9 @@ }, "put": { "summary": "display ads", - "tags": ["display ads"], + "tags": [ + "display ads" + ], "description": "This endpoint allows the client to update the attributes of a single display ad, via its id.", "parameters": [ { @@ -1311,19 +1413,19 @@ "approved": false, "body_markdown": "Hello _hey_ Hey hey 10", "display_to": "all", - "name": "Display Ad 12", - "organization_id": 72, + "name": "Display Ad 390", + "organization_id": 3602, "placement_area": "sidebar_left", "published": false, "processed_html": "

Hello hey Hey hey 10

", "cached_tag_list": "", - "id": 12, + "id": 390, "clicks_count": 0, - "created_at": "2023-02-01T16:45:14.138+09:00", + "created_at": "2023-02-03T18:22:53.900+07:00", "impressions_count": 0, "success_rate": 0.0, "type_of": "in_house", - "updated_at": "2023-02-01T16:45:14.140+09:00", + "updated_at": "2023-02-03T18:22:53.902+07:00", "tag_list": "" } } @@ -1380,7 +1482,11 @@ }, "display_to": { "type": "string", - "enum": ["all", "logged_in", "logged_out"], + "enum": [ + "all", + "logged_in", + "logged_out" + ], "default": "all", "description": "Potentially limits visitors to whom the ad is visible" }, @@ -1400,7 +1506,11 @@ "description": "Tags on which this ad can be displayed (blank is all/any tags)" } }, - "required": ["name", "body_markdown", "placement_area"] + "required": [ + "name", + "body_markdown", + "placement_area" + ] } } } @@ -1410,7 +1520,9 @@ "/api/display_ads/{id}/unpublish": { "put": { "summary": "unpublish", - "tags": ["display ads"], + "tags": [ + "display ads" + ], "description": "This endpoint allows the client to remove a display ad from rotation by un-publishing it.", "parameters": [ { @@ -1458,7 +1570,9 @@ "/api/follows/tags": { "get": { "summary": "Followed Tags", - "tags": ["followed_tags"], + "tags": [ + "followed_tags" + ], "description": "This endpoint allows the client to retrieve a list of the tags they follow.", "operationId": "getFollowedTags", "responses": { @@ -1479,12 +1593,12 @@ "application/json": { "example": [ { - "id": 428, + "id": 14543, "name": "tag3", "points": 1.0 }, { - "id": 429, + "id": 14544, "name": "tag4", "points": 1.0 } @@ -1504,7 +1618,9 @@ "/api/followers/users": { "get": { "summary": "Followers", - "tags": ["followers"], + "tags": [ + "followers" + ], "description": "This endpoint allows the client to retrieve a list of the followers they have.\n \"Followers\" are users that are following other users on the website.\n It supports pagination, each page will contain 80 followers by default.", "operationId": "getFollowers", "parameters": [ @@ -1533,23 +1649,23 @@ "example": [ { "type_of": "user_follower", - "id": 6, - "created_at": "2023-02-01T07:45:14Z", - "user_id": 436, - "name": "Wilford \"Boyd\" \\:/ Orn", + "id": 492, + "created_at": "2023-02-03T11:22:54Z", + "user_id": 20489, + "name": "Aurea \"Rolland\" \\:/ Mills", "path": "/username435", "username": "username435", - "profile_image": "/uploads/user/profile_image/436/1c62ef4e-d691-4a43-927c-e124af8da25c.jpeg" + "profile_image": "/uploads/user/profile_image/20489/25cf0ba1-4759-473b-a020-21da28576cfd.jpeg" }, { "type_of": "user_follower", - "id": 5, - "created_at": "2023-02-01T07:45:14Z", - "user_id": 434, - "name": "Cristie \"Ashely\" \\:/ Kuhic", + "id": 491, + "created_at": "2023-02-03T11:22:54Z", + "user_id": 20487, + "name": "Adrianne \"Azzie\" \\:/ White", "path": "/username433", "username": "username433", - "profile_image": "/uploads/user/profile_image/434/ed6441bc-589b-4a4b-a795-2a55ccbd3b73.jpeg" + "profile_image": "/uploads/user/profile_image/20487/0f5fbcdc-9df1-4b1a-a676-86465704c8ed.jpeg" } ], "schema": { @@ -1606,8 +1722,12 @@ "/api/pages": { "get": { "summary": "show details for all pages", - "security": [], - "tags": ["pages"], + "security": [ + + ], + "tags": [ + "pages" + ], "description": "This endpoint allows the client to retrieve details for all Page objects.", "responses": { "200": { @@ -1616,16 +1736,16 @@ "application/json": { "example": [ { - "id": 1, - "title": "That Good Night", - "slug": "outside-turkey", - "description": "In libero ratione sit.", + "id": 336, + "title": "What's Become of Waring", + "slug": "capital-seller", + "description": "Consequuntur eligendi rerum et.", "is_top_level_path": false, "landing_page": false, "body_html": null, "body_json": null, - "body_markdown": "Quo voluptatem et iusto.", - "processed_html": "

Quo voluptatem et iusto.

\n\n", + "body_markdown": "Nesciunt eveniet quasi voluptatum.", + "processed_html": "

Nesciunt eveniet quasi voluptatum.

\n\n", "social_image": { "url": null }, @@ -1645,16 +1765,20 @@ }, "post": { "summary": "pages", - "tags": ["pages"], + "tags": [ + "pages" + ], "description": "This endpoint allows the client to create a new page.", - "parameters": [], + "parameters": [ + + ], "responses": { "200": { "description": "successful", "content": { "application/json": { "example": { - "id": 3, + "id": 338, "title": "Example Page", "slug": "example1", "description": "a new page", @@ -1758,8 +1882,12 @@ "/api/pages/{id}": { "get": { "summary": "show details for a page", - "security": [], - "tags": ["pages"], + "security": [ + + ], + "tags": [ + "pages" + ], "description": "This endpoint allows the client to retrieve details for a single Page object, specified by ID.", "parameters": [ { @@ -1781,16 +1909,16 @@ "content": { "application/json": { "example": { - "id": 6, - "title": "Time To Murder And Create", - "slug": "award_plain", - "description": "Ducimus architecto non et.", + "id": 341, + "title": "The Millstone", + "slug": "seller-minister", + "description": "Eum debitis ea incidunt.", "is_top_level_path": false, "landing_page": false, "body_html": null, "body_json": null, - "body_markdown": "Qui deleniti quibusdam alias.", - "processed_html": "

Qui deleniti quibusdam alias.

\n\n", + "body_markdown": "Et nam excepturi maiores.", + "processed_html": "

Et nam excepturi maiores.

\n\n", "social_image": { "url": null }, @@ -1806,7 +1934,9 @@ }, "put": { "summary": "update details for a page", - "tags": ["pages"], + "tags": [ + "pages" + ], "description": "This endpoint allows the client to retrieve details for a single Page object, specified by ID.", "parameters": [ { @@ -1828,16 +1958,16 @@ "content": { "application/json": { "example": { - "id": 7, + "id": 342, "title": "New Title", - "slug": "confuse_distant", - "description": "Et nobis ipsa ex.", + "slug": "provision-premium", + "description": "Id nam sunt et.", "is_top_level_path": false, "landing_page": false, "body_html": null, "body_json": null, - "body_markdown": "Aut rerum accusamus quaerat.", - "processed_html": "

Aut rerum accusamus quaerat.

\n\n", + "body_markdown": "Quo quae ab quo.", + "processed_html": "

Quo quae ab quo.

\n\n", "social_image": { "url": null }, @@ -1865,16 +1995,16 @@ "content": { "application/json": { "example": { - "id": 9, - "title": "The Moving Toyshop", - "slug": "deport-marine", - "description": "Possimus sit quae et.", + "id": 344, + "title": "I Know Why the Caged Bird Sings", + "slug": "thirsty-perception", + "description": "Sed qui qui illo.", "is_top_level_path": false, "landing_page": false, "body_html": null, "body_json": null, - "body_markdown": "Sint accusantium totam quia.", - "processed_html": "

Rerum ipsa iusto sint.

\n\n", + "body_markdown": "Commodi praesentium quod libero.", + "processed_html": "

Dolorem et perspiciatis et.

\n\n", "social_image": { "url": null }, @@ -1896,7 +2026,9 @@ }, "delete": { "summary": "remove a page", - "tags": ["pages"], + "tags": [ + "pages" + ], "description": "This endpoint allows the client to delete a single Page object, specified by ID.", "parameters": [ { @@ -1918,16 +2050,16 @@ "content": { "application/json": { "example": { - "id": 10, - "title": "Fame Is the Spur", - "slug": "plain-design", - "description": "Autem dignissimos sed est.", + "id": 345, + "title": "Fair Stood the Wind for France", + "slug": "transfer_freckle", + "description": "Ut expedita iure velit.", "is_top_level_path": false, "landing_page": false, "body_html": null, "body_json": null, - "body_markdown": "Enim delectus repellendus quaerat.", - "processed_html": "

Enim delectus repellendus quaerat.

\n\n", + "body_markdown": "Error doloribus nobis sequi.", + "processed_html": "

Error doloribus nobis sequi.

\n\n", "social_image": { "url": null }, @@ -1972,8 +2104,12 @@ "/api/podcast_episodes": { "get": { "summary": "Podcast Episodes", - "security": [], - "tags": ["podcast_episodes"], + "security": [ + + ], + "tags": [ + "podcast_episodes" + ], "description": "This endpoint allows the client to retrieve a list of podcast episodes.\n \"Podcast episodes\" are episodes belonging to podcasts.\n It will only return active (reachable) podcast episodes that belong to published podcasts available on the platform, ordered by descending publication date.\n It supports pagination, each page will contain 30 articles by default.", "operationId": "getPodcastEpisodes", "parameters": [ @@ -2003,14 +2139,14 @@ { "type_of": "podcast_episodes", "class_name": "PodcastEpisode", - "id": 4, + "id": 530, "path": "/codenewbie/slug-4", - "title": "0", - "image_url": "/uploads/podcast/image/4/a4db8eca-f73d-4e7b-b853-bc15a0f8ec93.jpeg", + "title": "4", + "image_url": "/uploads/podcast/image/410/8b0fadd5-e785-42e4-9692-a35df481772c.jpeg", "podcast": { - "title": "Brooklyn Black", + "title": "Old Rasputin Russian Imperial Stout", "slug": "codenewbie", - "image_url": "/uploads/podcast/image/4/a4db8eca-f73d-4e7b-b853-bc15a0f8ec93.jpeg" + "image_url": "/uploads/podcast/image/410/8b0fadd5-e785-42e4-9692-a35df481772c.jpeg" } } ], @@ -2040,7 +2176,9 @@ "/api/profile_images/{username}": { "get": { "summary": "A Users or organizations profile image", - "tags": ["profile images"], + "tags": [ + "profile images" + ], "description": "This endpoint allows the client to retrieve a user or organization profile image information by its\n corresponding username.", "operationId": "getProfileImage", "parameters": [ @@ -2063,8 +2201,8 @@ "example": { "type_of": "profile_image", "image_of": "user", - "profile_image": "/uploads/user/profile_image/451/80ee2523-ba5e-4b0b-b181-caa402f757be.jpeg", - "profile_image_90": "/uploads/user/profile_image/451/80ee2523-ba5e-4b0b-b181-caa402f757be.jpeg" + "profile_image": "/uploads/user/profile_image/20504/18abf8da-b517-4806-a67a-f71be84669d8.jpeg", + "profile_image_90": "/uploads/user/profile_image/20504/18abf8da-b517-4806-a67a-f71be84669d8.jpeg" }, "schema": { "type": "object", @@ -2092,7 +2230,9 @@ "/api/reactions/toggle": { "post": { "summary": "toggle reaction", - "tags": ["reactions"], + "tags": [ + "reactions" + ], "description": "This endpoint allows the client to toggle the user's reaction to a specified reactable (eg, Article, Comment, or User). For examples:\n * \"Like\"ing an Article will create a new \"like\" Reaction from the user for that Articles\n * \"Like\"ing that Article a second time will remove the \"like\" from the user", "parameters": [ { @@ -2125,7 +2265,11 @@ "required": true, "schema": { "type": "string", - "enum": ["Comment", "Article", "User"] + "enum": [ + "Comment", + "Article", + "User" + ] } } ], @@ -2137,8 +2281,8 @@ "example": { "result": "create", "category": "like", - "id": 1, - "reactable_id": 211, + "id": 334, + "reactable_id": 9038, "reactable_type": "Article" } } @@ -2161,7 +2305,9 @@ "/api/reactions": { "post": { "summary": "create reaction", - "tags": ["reactions"], + "tags": [ + "reactions" + ], "description": "This endpoint allows the client to create a reaction to a specified reactable (eg, Article, Comment, or User). For examples:\n * \"Like\"ing an Article will create a new \"like\" Reaction from the user for that Articles\n * \"Like\"ing that Article a second time will return the previous \"like\"", "parameters": [ { @@ -2194,7 +2340,11 @@ "required": true, "schema": { "type": "string", - "enum": ["Comment", "Article", "User"] + "enum": [ + "Comment", + "Article", + "User" + ] } } ], @@ -2206,8 +2356,8 @@ "example": { "result": "none", "category": "like", - "id": 3, - "reactable_id": 213, + "id": 336, + "reactable_id": 9040, "reactable_type": "Article" } } @@ -2230,7 +2380,9 @@ "/api/readinglist": { "get": { "summary": "Readinglist", - "tags": ["readinglist"], + "tags": [ + "readinglist" + ], "description": "This endpoint allows the client to retrieve a list of articles that were saved to a Users readinglist.\n It supports pagination, each page will contain `30` articles by default", "operationId": "getReadinglist", "parameters": [ @@ -2257,7 +2409,9 @@ "description": "A list of articles in the users readinglist", "content": { "application/json": { - "example": [], + "example": [ + + ], "schema": { "type": "array", "items": { @@ -2270,10 +2424,61 @@ } } }, + "/api/users/me": { + "get": { + "summary": "The authenticated user", + "tags": [ + "users" + ], + "description": "This endpoint allows the client to retrieve information about the authenticated user", + "operationId": "getUserMe", + "responses": { + "200": { + "description": "successful", + "content": { + "application/json": { + "example": { + "type_of": "user", + "id": 20516, + "username": "username462", + "name": "Alonzo \"Bruna\" \\:/ Okuneva", + "twitter_username": "twitter462", + "github_username": "github462", + "summary": null, + "location": null, + "website_url": null, + "joined_at": "Feb 3, 2023", + "profile_image": "/uploads/user/profile_image/20516/1694cc8e-6ee5-43c4-a65d-89898e6e1af7.jpeg" + }, + "schema": { + "type": "object", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "example": { + "error": "unauthorized", + "status": 401 + } + } + } + } + } + } + }, "/api/users/{id}": { "get": { "summary": "A User", - "tags": ["users"], + "tags": [ + "users" + ], "description": "This endpoint allows the client to retrieve a single user, either by id\nor by the user's username.\n\nFor complete documentation, see the v0 API docs: https://developers.forem.com/api/v0#tag/users/operation/getUser", "operationId": "getUser", "parameters": [ @@ -2288,7 +2493,17 @@ ], "responses": { "200": { - "description": "successful" + "description": "successful", + "content": { + "application/json": { + "schema": { + "type": "object", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + } } } } @@ -2296,7 +2511,9 @@ "/api/users/{id}/unpublish": { "put": { "summary": "Unpublish a User's Articles and Comments", - "tags": ["users"], + "tags": [ + "users" + ], "description": "This endpoint allows the client to unpublish all of the articles and\ncomments created by a user.\n\nThe user associated with the API key must have any 'admin' or 'moderator' role.\n\nThis specified user's articles and comments will be unpublished and will no longer be\nvisible to the public. They will remain in the database and will set back to draft status\non the specified user's dashboard. Any notifications associated with the specified user's\narticles and comments will be deleted.\n\nNote this endpoint unpublishes articles and comments asychronously: it will return a 204 NO CONTENT\nstatus code immediately, but the articles and comments will not be unpublished until the\nrequest is completed on the server.", "operationId": "unpublishUser", "parameters": [ @@ -2345,7 +2562,9 @@ "/api/users/{id}/suspend": { "put": { "summary": "Suspend a User", - "tags": ["users"], + "tags": [ + "users" + ], "description": "This endpoint allows the client to suspend a user.\n\nThe user associated with the API key must have any 'admin' or 'moderator' role.\n\nThis specified user will be assigned the 'suspended' role. Suspending a user will stop the\nuser from posting new posts and comments. It doesn't delete any of the user's content, just\nprevents them from creating new content while suspended. Users are not notified of their suspension\nin the UI, so if you want them to know about this, you must notify them.", "operationId": "suspendUser", "parameters": [ @@ -2390,6 +2609,55 @@ } } } + }, + "/api/admin/users": { + "post": { + "summary": "Invite a User", + "tags": [ + "users" + ], + "description": "This endpoint allows the client to trigger an invitation to the provided email address.\n\n It requires a token from a user with `super_admin` privileges.", + "operationId": "postAdminUsersCreate", + "parameters": [ + + ], + "responses": { + "200": { + "description": "Successful" + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "example": { + "error": "unauthorized", + "status": 401 + } + } + } + }, + "422": { + "description": "Unprocessable Entity", + "content": { + "application/json": { + "example": { + "error": "param is missing or the value is empty: email", + "status": 422 + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserInviteParam" + } + } + } + } + } } }, "servers": [ @@ -2400,7 +2668,9 @@ ], "security": [ { - "api-key": [] + "api-key": [ + + ] } ], "components": { @@ -2708,7 +2978,11 @@ "format": "float" } }, - "required": ["id", "name", "points"] + "required": [ + "id", + "name", + "points" + ] }, "Page": { "description": "Representation of a page object", @@ -2756,7 +3030,12 @@ "description": "Controls what kind of layout the page is rendered in" } }, - "required": ["title", "slug", "description", "template"] + "required": [ + "title", + "slug", + "description", + "template" + ] }, "PodcastEpisodeIndex": { "description": "Representation of a podcast episode returned in a list", @@ -2915,7 +3194,59 @@ "format": "url" } } + }, + "User": { + "description": "The representation of a user", + "type": "object", + "properties": { + "type_of": { + "type": "string" + }, + "id": { + "type": "string" + }, + "username": { + "type": "string" + }, + "name": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "twitter_username": { + "type": "string" + }, + "github_username": { + "type": "string" + }, + "website_url": { + "type": "string" + }, + "location": { + "type": "string" + }, + "joined_at": { + "type": "string" + }, + "profile_image": { + "type": "string" + } + } + }, + "UserInviteParam": { + "description": "User invite parameters", + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + } + } } } } -} +} \ No newline at end of file