* define api routes and create controllers, sketch out index and create actions * add api v1 organizations CRUD spec and docs spec, need to run swagger * swagger dry run on admin organizations routes, typo fix in api.rb * flesh out specs and sketch out admin actions * move actions out of concerns/include pattern and into v1 inline * remove private constant call * add v1 accept header to doc spec, fix syntax in a before block * update controllers to address failing specs * simplify controller and clarify route config * flesh out tests for errors * fix long line * add missing commas * return username show route to v0 concern controller * create separate show route and action name, remove nesting from create/update params requirement * clean up syntax in controller params and update show path in specs; move routes * fix up syntax in params permit * create organization in index spec * one more syntax tweak for org params * refactoring to one show route that handles username or id * tweak spec syntax to expect the right array * tweak controller and specs, simplify routing to show * remove create route, action, and specs from this branch * add clarifying comment in show controller action * add explicit not found return to show route * fix controller formatting causing 404 errors * remove comment, update specs * remove commment and fix id show response and specs * fix show route and request spec for username param * update unauthorized user specs to use put for now instead of post, regenerate swagger docs * adjust update 422 spec to break org validity * fix admin update spec, rerun swagger * reorganiza controller actions, update specs, ensure authorized update and delete * improve spec, handle finding one org more gracefully, delete via worker * copy routes into api namespace instead of moving them from general namespace * update param in v0 show route to fit more general naming * regenerate v1 swagger docs * use profile image url getter in update controller response * update swagger docs and remove unneeded comment from org' model * configure organizations destroy action for super admins only (for now)
4314 lines
149 KiB
JSON
4314 lines
149 KiB
JSON
{
|
|
"openapi": "3.0.3",
|
|
"info": {
|
|
"title": "Forem API V1",
|
|
"version": "1.0.0",
|
|
"description": "Access Forem articles, users and other resources via API.\n For a real-world example of Forem in action, check out [DEV](https://www.dev.to).\n All endpoints can be accessed with the 'api-key' header and a accept header, but\n some of them are accessible publicly without authentication.\n\n Dates and date times, unless otherwise specified, must be in\n the [RFC 3339](https://tools.ietf.org/html/rfc3339) format."
|
|
},
|
|
"paths": {
|
|
"/api/articles": {
|
|
"post": {
|
|
"summary": "Publish article",
|
|
"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": [],
|
|
"responses": {
|
|
"201": {
|
|
"description": "An Article",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"type_of": "article",
|
|
"id": 20823,
|
|
"title": "New article",
|
|
"description": "New post example",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "new-article-4kgg",
|
|
"path": "/username533/new-article-4kgg",
|
|
"url": "http://localhost:3000/username533/new-article-4kgg",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": 493,
|
|
"published_timestamp": "2023-07-18T20:15:01Z",
|
|
"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-07-18T20:15:01Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:01Z",
|
|
"last_comment_at": "2023-07-18T20:15:01Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": "",
|
|
"tags": [],
|
|
"body_html": "<p><strong>New</strong> body for the article</p>\n\n",
|
|
"body_markdown": "**New** body for the article",
|
|
"user": {
|
|
"name": "Laurence \"Donovan\" \\:/ Roberts",
|
|
"username": "username533",
|
|
"twitter_username": "twitter533",
|
|
"github_username": "github533",
|
|
"user_id": 56415,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56415/598f6058-33a6-4bf7-aab3-a0f985153cce.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56415/598f6058-33a6-4bf7-aab3-a0f985153cce.jpeg"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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: article",
|
|
"status": 422
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Article"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "Published 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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
},
|
|
{
|
|
"name": "tag",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Using this parameter will retrieve articles that contain the requested tag. Articles\nwill be ordered by descending popularity.This parameter can be used in conjuction with `top`.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "discuss"
|
|
},
|
|
{
|
|
"name": "tags",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Using this parameter will retrieve articles with any of the comma-separated tags.\nArticles will be ordered by descending popularity.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "javascript, css"
|
|
},
|
|
{
|
|
"name": "tags_exclude",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Using this parameter will retrieve articles that do _not_ contain _any_\nof comma-separated tags. Articles will be ordered by descending popularity.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "node, java"
|
|
},
|
|
{
|
|
"name": "username",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Using this parameter will retrieve articles belonging\n to a User or Organization ordered by descending publication date.\n If `state=all` the number of items returned will be `1000` instead of the default `30`.\n This parameter can be used in conjuction with `state`.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "ben"
|
|
},
|
|
{
|
|
"name": "state",
|
|
"in": "query",
|
|
"required": false,
|
|
"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"]
|
|
},
|
|
"example": "fresh"
|
|
},
|
|
{
|
|
"name": "top",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Using this parameter will allow the client to return the most popular articles\nin the last `N` days.\n`top` indicates the number of days since publication of the articles returned.\nThis param can be used in conjuction with `tag`.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 2
|
|
},
|
|
{
|
|
"name": "collection_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Adding this will allow the client to return the list of articles\nbelonging to the requested collection, ordered by ascending publication date.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"example": 99
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of Articles",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "article",
|
|
"id": 20826,
|
|
"title": "Vile Bodies188",
|
|
"description": "90's truffaut yuccie helvetica lumbersexual 3 wolf moon. Pickled 8-bit twee hashtag carry taxidermy....",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "vile-bodies188-1mp",
|
|
"path": "/username537/vile-bodies188-1mp",
|
|
"url": "http://localhost:3000/username537/vile-bodies188-1mp",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-07-18T20:15:01Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/11-f4a704eef06d25d2d2fa2026ef08f1089754beaf5b6ee01160115d3c36ed3d34.png",
|
|
"social_image": "http://localhost:3000/assets/11-f4a704eef06d25d2d2fa2026ef08f1089754beaf5b6ee01160115d3c36ed3d34.png",
|
|
"canonical_url": "http://localhost:3000/username537/vile-bodies188-1mp",
|
|
"created_at": "2023-07-18T20:15:01Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:01Z",
|
|
"last_comment_at": "2023-07-18T20:15:01Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["discuss"],
|
|
"tags": "discuss",
|
|
"user": {
|
|
"name": "Dominique \"Melva\" \\:/ Kilback",
|
|
"username": "username537",
|
|
"twitter_username": "twitter537",
|
|
"github_username": "github537",
|
|
"user_id": 56419,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56419/a20d38b0-90b8-4c15-9703-598cd792d97d.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56419/a20d38b0-90b8-4c15-9703-598cd792d97d.jpeg"
|
|
},
|
|
"organization": {
|
|
"name": "Kling, Blanda and Hintz",
|
|
"username": "org73",
|
|
"slug": "org73",
|
|
"profile_image": "/uploads/organization/profile_image/10242/8d6159db-7973-44d9-9760-0e731fa0ff56.png",
|
|
"profile_image_90": "/uploads/organization/profile_image/10242/8d6159db-7973-44d9-9760-0e731fa0ff56.png"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/articles/latest": {
|
|
"get": {
|
|
"summary": "Published articles sorted by published date",
|
|
"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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of Articles",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "article",
|
|
"id": 20829,
|
|
"title": "Dulce et Decorum Est191",
|
|
"description": "+1 8-bit yolo. Flannel xoxo salvia food truck keffiyeh schlitz knausgaard. Pop-up letterpress tote...",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "dulce-et-decorum-est191-200k",
|
|
"path": "/username540/dulce-et-decorum-est191-200k",
|
|
"url": "http://localhost:3000/username540/dulce-et-decorum-est191-200k",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-07-18T20:15:02Z",
|
|
"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/username540/dulce-et-decorum-est191-200k",
|
|
"created_at": "2023-07-18T20:15:02Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:02Z",
|
|
"last_comment_at": "2023-07-18T20:15:02Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["javascript", "html", "discuss"],
|
|
"tags": "javascript, html, discuss",
|
|
"user": {
|
|
"name": "Maximo \"Rema\" \\:/ Franecki",
|
|
"username": "username540",
|
|
"twitter_username": "twitter540",
|
|
"github_username": "github540",
|
|
"user_id": 56422,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56422/2d815065-8564-4095-8c29-ef4a22725203.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56422/2d815065-8564-4095-8c29-ef4a22725203.jpeg"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
},
|
|
{
|
|
"type_of": "article",
|
|
"id": 20828,
|
|
"title": "For a Breath I Tarry190",
|
|
"description": "Muggle magic normcore venmo. +1 direct trade tacos wolf. Actually 8-bit yr aesthetic cray selvage...",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "for-a-breath-i-tarry190-5c4k",
|
|
"path": "/username539/for-a-breath-i-tarry190-5c4k",
|
|
"url": "http://localhost:3000/username539/for-a-breath-i-tarry190-5c4k",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-07-18T20:15:02Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/28-45c03a7ee6bce4cd3ddd541bd942a0c7995fa77e4b680563681529e9dd14a676.png",
|
|
"social_image": "http://localhost:3000/assets/28-45c03a7ee6bce4cd3ddd541bd942a0c7995fa77e4b680563681529e9dd14a676.png",
|
|
"canonical_url": "http://localhost:3000/username539/for-a-breath-i-tarry190-5c4k",
|
|
"created_at": "2023-07-18T20:15:02Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:02Z",
|
|
"last_comment_at": "2023-07-18T20:15:02Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["javascript", "html", "discuss"],
|
|
"tags": "javascript, html, discuss",
|
|
"user": {
|
|
"name": "Sylvester \"Zoila\" \\:/ Schinner",
|
|
"username": "username539",
|
|
"twitter_username": "twitter539",
|
|
"github_username": "github539",
|
|
"user_id": 56421,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56421/01d2cfbc-24c0-40bf-bbff-745858c55878.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56421/01d2cfbc-24c0-40bf-bbff-745858c55878.jpeg"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
},
|
|
{
|
|
"type_of": "article",
|
|
"id": 20827,
|
|
"title": "Death Be Not Proud189",
|
|
"description": "Fingerstache tousled beard whatever lumbersexual taxidermy celiac yr. Plaid church-key mustache...",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "death-be-not-proud189-4f0d",
|
|
"path": "/username538/death-be-not-proud189-4f0d",
|
|
"url": "http://localhost:3000/username538/death-be-not-proud189-4f0d",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-07-18T20:15:02Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/11-f4a704eef06d25d2d2fa2026ef08f1089754beaf5b6ee01160115d3c36ed3d34.png",
|
|
"social_image": "http://localhost:3000/assets/11-f4a704eef06d25d2d2fa2026ef08f1089754beaf5b6ee01160115d3c36ed3d34.png",
|
|
"canonical_url": "http://localhost:3000/username538/death-be-not-proud189-4f0d",
|
|
"created_at": "2023-07-18T20:15:02Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:02Z",
|
|
"last_comment_at": "2023-07-18T20:15:02Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["javascript", "html", "discuss"],
|
|
"tags": "javascript, html, discuss",
|
|
"user": {
|
|
"name": "Vashti \"Jacques\" \\:/ Stehr",
|
|
"username": "username538",
|
|
"twitter_username": "twitter538",
|
|
"github_username": "github538",
|
|
"user_id": 56420,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56420/0b996ddc-f0be-4d80-9c8f-ac76ae77b391.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56420/0b996ddc-f0be-4d80-9c8f-ac76ae77b391.jpeg"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/articles/{id}": {
|
|
"get": {
|
|
"summary": "Published article by id",
|
|
"security": [],
|
|
"tags": ["articles"],
|
|
"description": "This endpoint allows the client to retrieve a single published article given its `id`.",
|
|
"operationId": "getArticleById",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An Article",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"type_of": "article",
|
|
"id": 20830,
|
|
"title": "Alone on a Wide, Wide Sea192",
|
|
"description": "Cliche fanny pack five dollar toast cred. Pitchfork kogi +1 heirloom asymmetrical. Squid migas park...",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "alone-on-a-wide-wide-sea192-178m",
|
|
"path": "/username541/alone-on-a-wide-wide-sea192-178m",
|
|
"url": "http://localhost:3000/username541/alone-on-a-wide-wide-sea192-178m",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-07-18T20:15:02Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/14-5e64731cc7cd63e3b689647d9d3c3e4e1d907690c716d3dd1e356466726a2c2d.png",
|
|
"social_image": "http://localhost:3000/assets/14-5e64731cc7cd63e3b689647d9d3c3e4e1d907690c716d3dd1e356466726a2c2d.png",
|
|
"canonical_url": "http://localhost:3000/username541/alone-on-a-wide-wide-sea192-178m",
|
|
"created_at": "2023-07-18T20:15:02Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:02Z",
|
|
"last_comment_at": "2023-07-18T20:15:02Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": "discuss",
|
|
"tags": ["discuss"],
|
|
"body_html": "<p>Cliche fanny pack five dollar toast cred. Pitchfork kogi +1 heirloom asymmetrical. Squid migas park chillwave.</p>\n\n<p>Typewriter bicycle rights heirloom green juice. Intelligentsia bushwick franzen shoreditch helvetica carry plaid. Single-origin coffee tofu offal forage vinyl fingerstache banjo.</p>\n\n",
|
|
"body_markdown": "---\ntitle: Alone on a Wide, Wide Sea192\npublished: true\ntags: discuss\ndate: \nseries: \ncanonical_url: \n\n---\n\nCliche fanny pack five dollar toast cred. Pitchfork kogi +1 heirloom asymmetrical. Squid migas park chillwave.\n\n\nTypewriter bicycle rights heirloom green juice. Intelligentsia bushwick franzen shoreditch helvetica carry plaid. Single-origin coffee tofu offal forage vinyl fingerstache banjo.\n\n",
|
|
"user": {
|
|
"name": "Kim \"Coleman\" \\:/ Emard",
|
|
"username": "username541",
|
|
"twitter_username": "twitter541",
|
|
"github_username": "github541",
|
|
"user_id": 56423,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56423/a0fda667-3b6e-459d-b7a8-6fb99b5f9024.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56423/a0fda667-3b6e-459d-b7a8-6fb99b5f9024.jpeg"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Article Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "Update an article by id",
|
|
"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": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the user to unpublish.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 123
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An Article",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"type_of": "article",
|
|
"id": 20831,
|
|
"title": "Blue Remembered Earth193",
|
|
"description": "Migas locavore bicycle rights before they sold out semiotics disrupt banh mi. Tattooed direct trade...",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "blue-remembered-earth193-44b1",
|
|
"path": "/username542/blue-remembered-earth193-44b1",
|
|
"url": "http://localhost:3000/username542/blue-remembered-earth193-44b1",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-07-18T20:15:02Z",
|
|
"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/username542/blue-remembered-earth193-44b1",
|
|
"created_at": "2023-07-18T20:15:02Z",
|
|
"edited_at": "2023-07-18T20:15:02Z",
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:02Z",
|
|
"last_comment_at": "2023-07-18T20:15:02Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": "",
|
|
"tags": [],
|
|
"body_html": "<p><strong>New</strong> body for the article</p>\n\n",
|
|
"body_markdown": "**New** body for the article",
|
|
"user": {
|
|
"name": "Mitchell \"Andrew\" \\:/ Greenfelder",
|
|
"username": "username542",
|
|
"twitter_username": "twitter542",
|
|
"github_username": "github542",
|
|
"user_id": 56424,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56424/9b9054d0-f998-4d8d-b3b0-ab063001cb09.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56424/9b9054d0-f998-4d8d-b3b0-ab063001cb09.jpeg"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Article Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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: article",
|
|
"status": 422
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Article"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/articles/{username}/{slug}": {
|
|
"get": {
|
|
"summary": "Published article by path",
|
|
"security": [],
|
|
"tags": ["articles"],
|
|
"description": "This endpoint allows the client to retrieve a single published article given its `path`.",
|
|
"operationId": "getArticleByPath",
|
|
"parameters": [
|
|
{
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "slug",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An Article",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"type_of": "article",
|
|
"id": 20834,
|
|
"title": "Surprised by Joy196",
|
|
"description": "Messenger bag tattooed ugh. Authentic phlogiston cold-pressed venmo. Art party organic plaid try-hard...",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "surprised-by-joy196-4m6k",
|
|
"path": "/username546/surprised-by-joy196-4m6k",
|
|
"url": "http://localhost:3000/username546/surprised-by-joy196-4m6k",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-07-18T20:15:02Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/23-33ea5a2b5af3dc15b9ed90de0b850f67e2390eaec3361d6687d3b9750c699f84.png",
|
|
"social_image": "http://localhost:3000/assets/23-33ea5a2b5af3dc15b9ed90de0b850f67e2390eaec3361d6687d3b9750c699f84.png",
|
|
"canonical_url": "http://localhost:3000/username546/surprised-by-joy196-4m6k",
|
|
"created_at": "2023-07-18T20:15:02Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:02Z",
|
|
"last_comment_at": "2023-07-18T20:15:02Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": "discuss",
|
|
"tags": ["discuss"],
|
|
"body_html": "<p>Messenger bag tattooed ugh. Authentic phlogiston cold-pressed venmo. Art party organic plaid try-hard you probably haven't heard of them bushwick. Pitchfork humblebrag taxidermy mlkshk crucifix kinfolk.</p>\n\n<p>Kale chips kickstarter chia ennui pickled hashtag drinking sartorial.</p>\n\n",
|
|
"body_markdown": "---\ntitle: Surprised by Joy196\npublished: true\ntags: discuss\ndate: \nseries: \ncanonical_url: \n\n---\n\nMessenger bag tattooed ugh. Authentic phlogiston cold-pressed venmo. Art party organic plaid try-hard you probably haven't heard of them bushwick. Pitchfork humblebrag taxidermy mlkshk crucifix kinfolk.\n\n\nKale chips kickstarter chia ennui pickled hashtag drinking sartorial.\n\n",
|
|
"user": {
|
|
"name": "Davis \"Nestor\" \\:/ Franecki",
|
|
"username": "username546",
|
|
"twitter_username": "twitter546",
|
|
"github_username": "github546",
|
|
"user_id": 56428,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56428/536cf2ce-51f8-405c-8144-cc36cea15504.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56428/536cf2ce-51f8-405c-8144-cc36cea15504.jpeg"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Article Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/articles/me": {
|
|
"get": {
|
|
"summary": "User's 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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"200": {
|
|
"description": "A List of the authenticated user's Articles",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/articles/me/published": {
|
|
"get": {
|
|
"summary": "User's published 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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"200": {
|
|
"description": "A List of the authenticated user's Articles",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/articles/me/unpublished": {
|
|
"get": {
|
|
"summary": "User's unpublished 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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"200": {
|
|
"description": "A List of the authenticated user's Articles",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/articles/me/all": {
|
|
"get": {
|
|
"summary": "User's all 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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"200": {
|
|
"description": "A List of the authenticated user's Articles",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/articles/{id}/unpublish": {
|
|
"put": {
|
|
"summary": "Unpublish an article",
|
|
"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": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the article to unpublish.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 1
|
|
},
|
|
{
|
|
"name": "note",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Content for the note that's created along with unpublishing",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "Admin requested unpublishing all articles via API"
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "Article successfully unpublished"
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Article Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/segments": {
|
|
"get": {
|
|
"summary": "Manually managed audience segments",
|
|
"tags": ["segments"],
|
|
"description": "This endpoint allows the client to retrieve a list of audience segments.\n\nAn audience segment is a group of users that can be targeted by a Billboard. This API only permits managing segments you create and maintain yourself.\n\nThe endpoint supports pagination, and each page will contain `30` segments by default.",
|
|
"operationId": "getSegments",
|
|
"parameters": [
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of manually managed audience segments",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"id": 2660,
|
|
"created_at": "2023-07-18T15:15:03.242-05:00",
|
|
"type_of": "manual",
|
|
"updated_at": "2023-07-18T15:15:03.242-05:00",
|
|
"user_count": 1
|
|
},
|
|
{
|
|
"id": 2659,
|
|
"created_at": "2023-07-18T15:15:03.199-05:00",
|
|
"type_of": "manual",
|
|
"updated_at": "2023-07-18T15:15:03.199-05:00",
|
|
"user_count": 3
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Segment"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create a manually managed audience segment",
|
|
"tags": ["segments"],
|
|
"description": "This endpoint allows the client to create a new audience segment.\n\nAn audience segment is a group of users that can be targeted by a Billboard. This API only permits managing segments you create and maintain yourself.",
|
|
"operationId": "createSegment",
|
|
"responses": {
|
|
"201": {
|
|
"description": "A manually managed audience segment",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 2661,
|
|
"created_at": "2023-07-18T15:15:03.434-05:00",
|
|
"type_of": "manual",
|
|
"updated_at": "2023-07-18T15:15:03.434-05:00"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/segments/{id}": {
|
|
"get": {
|
|
"summary": "A manually managed audience segment",
|
|
"tags": ["segments"],
|
|
"description": "This endpoint allows the client to retrieve a single manually-managed audience segment specified by ID.",
|
|
"operationId": "getSegment",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "The audience segment",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 2662,
|
|
"created_at": "2023-07-18T15:15:03.561-05:00",
|
|
"type_of": "manual",
|
|
"updated_at": "2023-07-18T15:15:03.561-05:00",
|
|
"user_count": 3
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Segment"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Audience Segment Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete a manually managed audience segment",
|
|
"tags": ["segments"],
|
|
"description": "This endpoint allows the client to delete an audience segment specified by ID.\n\nAudience segments cannot be deleted if there are still any Billboards using them.",
|
|
"operationId": "deleteSegment",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "The deleted audience segment",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 2666,
|
|
"created_at": "2023-07-18T15:15:03.794-05:00",
|
|
"type_of": "manual",
|
|
"updated_at": "2023-07-18T15:15:03.794-05:00"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Audience Segment Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Audience segment could not be deleted",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "Segments cannot be deleted while in use by any billboards"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/segments/{id}/users": {
|
|
"get": {
|
|
"summary": "Users in a manually managed audience segment",
|
|
"tags": ["segments"],
|
|
"description": "This endpoint allows the client to retrieve a list of the users in an audience segment specified by ID. The endpoint supports pagination, and each page will contain `30` users by default.",
|
|
"operationId": "getUsersInSegment",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
}
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of users in the audience segment",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "user",
|
|
"id": 56468,
|
|
"username": "username586",
|
|
"name": "Mindy \"Isidro\" \\:/ Schroeder",
|
|
"twitter_username": "twitter586",
|
|
"github_username": "github586",
|
|
"summary": null,
|
|
"location": null,
|
|
"website_url": null,
|
|
"joined_at": "Jul 18, 2023",
|
|
"profile_image": "/uploads/user/profile_image/56468/e8338360-b8d7-4a38-a03a-028cc9bbc249.jpeg"
|
|
},
|
|
{
|
|
"type_of": "user",
|
|
"id": 56469,
|
|
"username": "username587",
|
|
"name": "Benito \"Yvonne\" \\:/ Walsh",
|
|
"twitter_username": "twitter587",
|
|
"github_username": "github587",
|
|
"summary": null,
|
|
"location": null,
|
|
"website_url": null,
|
|
"joined_at": "Jul 18, 2023",
|
|
"profile_image": "/uploads/user/profile_image/56469/aefc3ddc-d4c2-4f17-9385-722dbbbff946.jpeg"
|
|
},
|
|
{
|
|
"type_of": "user",
|
|
"id": 56470,
|
|
"username": "username588",
|
|
"name": "Carl \"Eliseo\" \\:/ Murray",
|
|
"twitter_username": "twitter588",
|
|
"github_username": "github588",
|
|
"summary": null,
|
|
"location": null,
|
|
"website_url": null,
|
|
"joined_at": "Jul 18, 2023",
|
|
"profile_image": "/uploads/user/profile_image/56470/ec8302b1-922a-415c-abdc-08a623d83b6d.jpeg"
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Audience Segment Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/segments/{id}/add_users": {
|
|
"put": {
|
|
"summary": "Add users to a manually managed audience segment",
|
|
"tags": ["segments"],
|
|
"description": "This endpoint allows the client to add users in bulk to an audience segment specified by ID.\n\nSuccesses are users that were included in the segment (even if they were already in it), and failures are users that could not be added to the segment.",
|
|
"operationId": "addUsersToSegment",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Result of adding the users to the segment.",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"succeeded": [56476, 56477, 56478],
|
|
"failed": []
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Audience Segment Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Unprocessable Entity",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "param is missing or the value is empty: user_ids",
|
|
"status": 422
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SegmentUserIds"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/segments/{id}/remove_users": {
|
|
"put": {
|
|
"summary": "Remove users from a manually managed audience segment",
|
|
"tags": ["segments"],
|
|
"description": "This endpoint allows the client to remove users in bulk from an audience segment specified by ID.\n\nSuccesses are users that were removed; failures are users that weren't a part of the segment.",
|
|
"operationId": "removeUsersFromSegment",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Result of removing the users to the segment.",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"succeeded": [56495, 56496, 56497],
|
|
"failed": []
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Audience Segment Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Unprocessable Entity",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "param is missing or the value is empty: user_ids",
|
|
"status": 422
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/SegmentUserIds"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/comments": {
|
|
"get": {
|
|
"summary": "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": [
|
|
{
|
|
"name": "a_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Article identifier.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "321"
|
|
},
|
|
{
|
|
"name": "p_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Podcast Episode identifier.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "321"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of Comments",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "comment",
|
|
"id_code": "bdj",
|
|
"created_at": "2023-07-18T20:15:05Z",
|
|
"body_html": "<p>Forage scenester authentic kitsch franzen readymade. Kogi viral typewriter kinfolk locavore williamsburg.</p>\n\n",
|
|
"user": {
|
|
"name": "Garnet \"Bruce\" \\:/ Kemmer",
|
|
"username": "username638",
|
|
"twitter_username": "twitter638",
|
|
"github_username": "github638",
|
|
"user_id": 56520,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56520/bc3d91c0-9a1b-4f1c-80cf-2ce28c038393.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56520/bc3d91c0-9a1b-4f1c-80cf-2ce28c038393.jpeg"
|
|
},
|
|
"children": []
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Comment"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Resource Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/comments/{id}": {
|
|
"get": {
|
|
"summary": "Comment by id",
|
|
"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": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "Comment identifier.",
|
|
"schema": {
|
|
"type": "integer"
|
|
},
|
|
"example": "321"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of the Comments",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"type_of": "comment",
|
|
"id_code": "bdl",
|
|
"created_at": "2023-07-18T20:15:05Z",
|
|
"body_html": "<p>Truffaut lumbersexual retro humblebrag.</p>\n\n",
|
|
"user": {
|
|
"name": "Elina \"Samatha\" \\:/ Schamberger",
|
|
"username": "username642",
|
|
"twitter_username": "twitter642",
|
|
"github_username": "github642",
|
|
"user_id": 56524,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56524/018b51b7-44d1-49cc-801d-c363b7da49ff.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56524/018b51b7-44d1-49cc-801d-c363b7da49ff.jpeg"
|
|
},
|
|
"children": []
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Comment Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/display_ads": {
|
|
"get": {
|
|
"summary": "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": [],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/DisplayAd"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "display ads",
|
|
"tags": ["display ads"],
|
|
"description": "This endpoint allows the client to create a new display ad.",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 1018,
|
|
"approved": true,
|
|
"audience_segment_id": null,
|
|
"body_markdown": "# Hi, this is ad\nYep, it's an ad",
|
|
"cached_tag_list": "",
|
|
"clicks_count": 0,
|
|
"created_at": "2023-07-18T15:15:05.727-05:00",
|
|
"creator_id": null,
|
|
"display_to": "all",
|
|
"exclude_article_ids": "",
|
|
"impressions_count": 0,
|
|
"name": "Example Ad",
|
|
"organization_id": null,
|
|
"placement_area": "post_comments",
|
|
"priority": false,
|
|
"processed_html": "<h1> <a href=\"#hi-this-is-ad\" class=\"anchor\"> </a> Hi, this is ad</h1><p>Yep, it's an ad</p>",
|
|
"published": true,
|
|
"success_rate": 0.0,
|
|
"type_of": "in_house",
|
|
"updated_at": "2023-07-18T15:15:05.727-05:00",
|
|
"audience_segment_type": null,
|
|
"tag_list": ""
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/DisplayAd"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "unprocessable",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": null,
|
|
"approved": true,
|
|
"audience_segment_id": null,
|
|
"body_markdown": "# Hi, this is ad\nYep, it's an ad",
|
|
"cached_tag_list": null,
|
|
"clicks_count": 0,
|
|
"created_at": null,
|
|
"creator_id": null,
|
|
"display_to": "all",
|
|
"exclude_article_ids": "",
|
|
"impressions_count": 0,
|
|
"name": "Example Ad",
|
|
"organization_id": null,
|
|
"placement_area": "moon",
|
|
"priority": false,
|
|
"processed_html": null,
|
|
"published": true,
|
|
"success_rate": 0.0,
|
|
"type_of": "in_house",
|
|
"updated_at": null,
|
|
"audience_segment_type": null,
|
|
"tag_list": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/DisplayAd"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/display_ads/{id}": {
|
|
"get": {
|
|
"summary": "display ad",
|
|
"tags": ["display ads"],
|
|
"description": "This endpoint allows the client to retrieve a single display ad, via its id.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the display ad.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 123
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 1019,
|
|
"approved": false,
|
|
"audience_segment_id": null,
|
|
"body_markdown": "Hello _hey_ Hey hey 11",
|
|
"cached_tag_list": "",
|
|
"clicks_count": 0,
|
|
"created_at": "2023-07-18T15:15:05.849-05:00",
|
|
"creator_id": null,
|
|
"display_to": "all",
|
|
"exclude_article_ids": "",
|
|
"impressions_count": 0,
|
|
"name": "Display Ad 1019",
|
|
"organization_id": 10244,
|
|
"placement_area": "sidebar_left",
|
|
"priority": false,
|
|
"processed_html": "<p>Hello <em>hey</em> Hey hey 11</p>",
|
|
"published": false,
|
|
"success_rate": 0.0,
|
|
"type_of": "in_house",
|
|
"updated_at": "2023-07-18T15:15:05.850-05:00",
|
|
"audience_segment_type": null,
|
|
"tag_list": ""
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Unknown DisplayAd ID",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "display ads",
|
|
"tags": ["display ads"],
|
|
"description": "This endpoint allows the client to update the attributes of a single display ad, via its id.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the display ad.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 123
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"approved": false,
|
|
"body_markdown": "Hello _hey_ Hey hey 12",
|
|
"creator_id": null,
|
|
"display_to": "all",
|
|
"name": "Display Ad 1020",
|
|
"organization_id": 10245,
|
|
"placement_area": "sidebar_left",
|
|
"published": false,
|
|
"type_of": "in_house",
|
|
"exclude_article_ids": "",
|
|
"audience_segment_id": null,
|
|
"priority": false,
|
|
"cached_tag_list": "",
|
|
"id": 1020,
|
|
"clicks_count": 0,
|
|
"created_at": "2023-07-18T15:15:05.994-05:00",
|
|
"impressions_count": 0,
|
|
"processed_html": "<p>Hello <em>hey</em> Hey hey 12</p>",
|
|
"success_rate": 0.0,
|
|
"updated_at": "2023-07-18T15:15:05.995-05:00",
|
|
"audience_segment_type": null,
|
|
"tag_list": ""
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/DisplayAd"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "not found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/DisplayAd"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/display_ads/{id}/unpublish": {
|
|
"put": {
|
|
"summary": "unpublish",
|
|
"tags": ["display ads"],
|
|
"description": "This endpoint allows the client to remove a display ad from rotation by un-publishing it.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the display ad to unpublish.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 123
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "no content"
|
|
},
|
|
"404": {
|
|
"description": "not found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/follows/tags": {
|
|
"get": {
|
|
"summary": "Followed Tags",
|
|
"tags": ["followed_tags", "tags"],
|
|
"description": "This endpoint allows the client to retrieve a list of the tags they follow.",
|
|
"operationId": "getFollowedTags",
|
|
"responses": {
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"200": {
|
|
"description": "A List of followed tags",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"id": 38684,
|
|
"name": "tag3",
|
|
"points": 1.0
|
|
},
|
|
{
|
|
"id": 38685,
|
|
"name": "tag4",
|
|
"points": 1.0
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/FollowedTag"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/followers/users": {
|
|
"get": {
|
|
"summary": "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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
},
|
|
{
|
|
"name": "sort",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Default is 'created_at'. Specifies the sort order for the created_at param of the follow\n relationship. To sort by newest followers first (descending order) specify\n ?sort=-created_at.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "created_at"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of followers",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "user_follower",
|
|
"id": 1398,
|
|
"created_at": "2023-07-18T20:15:06Z",
|
|
"user_id": 56545,
|
|
"name": "Ahmed \"Dustin\" \\:/ Kunze",
|
|
"path": "/username663",
|
|
"username": "username663",
|
|
"profile_image": "/uploads/user/profile_image/56545/1dc6cc07-658f-4387-81bd-5a9660dda3fc.jpeg"
|
|
},
|
|
{
|
|
"type_of": "user_follower",
|
|
"id": 1397,
|
|
"created_at": "2023-07-18T20:15:06Z",
|
|
"user_id": 56543,
|
|
"name": "Yon \"Kesha\" \\:/ Kuhn",
|
|
"path": "/username661",
|
|
"username": "username661",
|
|
"profile_image": "/uploads/user/profile_image/56543/d69d90ee-4ab8-4aee-8113-eb2ff602741a.jpeg"
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"description": "A follower",
|
|
"type": "object",
|
|
"properties": {
|
|
"type_of": {
|
|
"description": "user_follower by default",
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"user_id": {
|
|
"description": "The follower's user id",
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"name": {
|
|
"description": "The follower's name",
|
|
"type": "string"
|
|
},
|
|
"path": {
|
|
"description": "A path to the follower's profile",
|
|
"type": "string"
|
|
},
|
|
"profile_image": {
|
|
"description": "Profile image (640x640)",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/organizations/{username}": {
|
|
"get": {
|
|
"summary": "An organization (by username)",
|
|
"tags": ["organizations"],
|
|
"security": [],
|
|
"description": "This endpoint allows the client to retrieve a single organization by their username",
|
|
"operationId": "getOrganization",
|
|
"parameters": [
|
|
{
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An Organization",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"type_of": "organization",
|
|
"id": 10250,
|
|
"username": "org81",
|
|
"name": "Cole, Senger and Kertzmann",
|
|
"summary": "Keffiyeh occupy raw denim godard put a bird on it street truffaut biodiesel. Celiac tote bag squid echo.",
|
|
"twitter_username": "org1638",
|
|
"github_username": "org5333",
|
|
"url": "http://shanahan-casper.net/roosevelt_armstrong",
|
|
"location": null,
|
|
"tech_stack": null,
|
|
"tag_line": null,
|
|
"story": null,
|
|
"joined_at": "2023-07-18T20:15:06Z",
|
|
"profile_image": "/uploads/organization/profile_image/10250/5b9089a5-98c6-4718-bcc8-1afbcd04bade.png"
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Organization"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/organizations/{username}/users": {
|
|
"get": {
|
|
"summary": "Organization's users",
|
|
"tags": ["organizations", "users"],
|
|
"security": [],
|
|
"description": "This endpoint allows the client to retrieve a list of users belonging to the organization\n\nIt supports pagination, each page will contain `30` users by default.",
|
|
"operationId": "getOrgUsers",
|
|
"parameters": [
|
|
{
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An Organization's users",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "user",
|
|
"id": 56555,
|
|
"username": "username673",
|
|
"name": "Shandra \"Kizzy\" \\:/ Wiza",
|
|
"twitter_username": "twitter673",
|
|
"github_username": "github673",
|
|
"summary": null,
|
|
"location": null,
|
|
"website_url": null,
|
|
"joined_at": "Jul 18, 2023",
|
|
"profile_image": "/uploads/user/profile_image/56555/e8b72d88-10e2-481b-b539-763ab50f1a66.jpeg"
|
|
},
|
|
{
|
|
"type_of": "user",
|
|
"id": 56556,
|
|
"username": "username674",
|
|
"name": "Brad \"Nelly\" \\:/ Dibbert",
|
|
"twitter_username": "twitter674",
|
|
"github_username": "github674",
|
|
"summary": null,
|
|
"location": null,
|
|
"website_url": null,
|
|
"joined_at": "Jul 18, 2023",
|
|
"profile_image": "/uploads/user/profile_image/56556/b75abf15-d993-4dcf-a9b9-86243691afdd.jpeg"
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/organizations/{username}/articles": {
|
|
"get": {
|
|
"summary": "Organization's Articles",
|
|
"tags": ["organizations", "articles"],
|
|
"security": [],
|
|
"description": "This endpoint allows the client to retrieve a list of Articles belonging to the organization\n\nIt supports pagination, each page will contain `30` users by default.",
|
|
"operationId": "getOrgArticles",
|
|
"parameters": [
|
|
{
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An Organization's Articles",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "article",
|
|
"id": 20846,
|
|
"title": "Waiting for the Barbarians208",
|
|
"description": "3 wolf moon twee selvage bushwick. Cardigan fashion axe kogi pitchfork viral semiotics venmo....",
|
|
"readable_publish_date": "Jul 18",
|
|
"slug": "waiting-for-the-barbarians208-2a61",
|
|
"path": "/org85/waiting-for-the-barbarians208-2a61",
|
|
"url": "http://localhost:3000/org85/waiting-for-the-barbarians208-2a61",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-07-18T20:15:07Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/33-dc66b0d3c291181013c8bc7a6eb3b26755d85e90b63c9c589cb6c161624cc410.png",
|
|
"social_image": "http://localhost:3000/assets/33-dc66b0d3c291181013c8bc7a6eb3b26755d85e90b63c9c589cb6c161624cc410.png",
|
|
"canonical_url": "http://localhost:3000/org85/waiting-for-the-barbarians208-2a61",
|
|
"created_at": "2023-07-18T20:15:07Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-07-18T20:15:07Z",
|
|
"last_comment_at": "2023-07-18T20:15:07Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["javascript", "html", "discuss"],
|
|
"tags": "javascript, html, discuss",
|
|
"user": {
|
|
"name": "Fausto \"Ana\" \\:/ Renner",
|
|
"username": "username681",
|
|
"twitter_username": "twitter681",
|
|
"github_username": "github681",
|
|
"user_id": 56563,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/56563/5ecc7ee2-c72c-46d5-bbd5-bd348f7f01e6.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56563/5ecc7ee2-c72c-46d5-bbd5-bd348f7f01e6.jpeg"
|
|
},
|
|
"organization": {
|
|
"name": "Deckow Inc",
|
|
"username": "org85",
|
|
"slug": "org85",
|
|
"profile_image": "/uploads/organization/profile_image/10254/a3890d00-d5f6-4819-87a4-6de922903a51.png",
|
|
"profile_image_90": "/uploads/organization/profile_image/10254/a3890d00-d5f6-4819-87a4-6de922903a51.png"
|
|
}
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/organizations": {
|
|
"get": {
|
|
"summary": "Organizations",
|
|
"tags": ["organizations"],
|
|
"security": [],
|
|
"description": "This endpoint allows the client to retrieve a list of Dev organizations.\n\n It supports pagination, each page will contain 10 tags by default.",
|
|
"operationId": "getOrganizations",
|
|
"parameters": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam10to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A list of all organizations",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"id": 10256,
|
|
"name": "Hansen, Keebler and Schuster",
|
|
"profile_image": {
|
|
"url": "/uploads/organization/profile_image/10256/18ed2fa9-c917-4576-8f76-dc16689044cb.png"
|
|
},
|
|
"slug": "org87",
|
|
"summary": "Selfies squid green juice mumblecore asymmetrical marfa. You probably haven't heard of them thundercats cleanse gentrify.",
|
|
"tag_line": null,
|
|
"url": "http://robel.org/errol"
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Organization"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/organizations/{id}": {
|
|
"get": {
|
|
"summary": "An organization (by id)",
|
|
"tags": ["organizations"],
|
|
"security": [],
|
|
"description": "This endpoint allows the client to retrieve a single organization by their id",
|
|
"operationId": "getOrganizationById",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An Organization",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"type_of": "organization",
|
|
"id": 10257,
|
|
"username": "org88",
|
|
"name": "Crona-Kohler",
|
|
"summary": "Kinfolk hashtag gentrify master thundercats marfa bitters. Synth banh mi mlkshk offal xoxo cold-pressed photo booth.",
|
|
"twitter_username": "org7940",
|
|
"github_username": "org6040",
|
|
"url": "http://leannon.io/lovella_schmidt",
|
|
"location": null,
|
|
"tech_stack": null,
|
|
"tag_line": null,
|
|
"story": null,
|
|
"joined_at": "2023-07-18T20:15:07Z",
|
|
"profile_image": "/uploads/organization/profile_image/10257/c151d0e7-d567-4025-8994-3c5fabf11f02.png"
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Organization"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "Update an organization by id",
|
|
"tags": ["organizations"],
|
|
"description": "This endpoint allows the client to update an existing organization.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the organization to update.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 123
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An Organization",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 10259,
|
|
"name": "Fritsch, Kling and Moore",
|
|
"profile_image": "/uploads/organization/profile_image/10259/47023bbb-c086-49ae-84e0-01123c0c998d.png",
|
|
"slug": "org90",
|
|
"summary": "An updated summary for the organization.",
|
|
"tag_line": null,
|
|
"url": "http://raynor-krajcik.com/roger.jacobi"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "organization Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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: organization",
|
|
"status": 422
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Organization"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete an Organization by id",
|
|
"tags": ["organizations"],
|
|
"description": "This endpoint allows the client to delete a single organization, specified by id",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the organization.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 1
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"message": "deletion scheduled for organization with ID 10263",
|
|
"status": 200
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/pages": {
|
|
"get": {
|
|
"summary": "show details for all pages",
|
|
"security": [],
|
|
"tags": ["pages"],
|
|
"description": "This endpoint allows the client to retrieve details for all Page objects.",
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"id": 902,
|
|
"title": "Dulce et Decorum Est",
|
|
"slug": "marine-theorist",
|
|
"description": "Perferendis sint voluptas rerum.",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "Beatae molestiae dolor et.",
|
|
"processed_html": "<p>Beatae molestiae dolor et.</p>\n\n",
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "contained"
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Page"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "pages",
|
|
"tags": ["pages"],
|
|
"description": "This endpoint allows the client to create a new page.",
|
|
"parameters": [],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 904,
|
|
"title": "Example Page",
|
|
"slug": "example1",
|
|
"description": "a new page",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "# Hi, this is a New Page\nYep, it's an a new page",
|
|
"processed_html": "<h1>\n <a name=\"hi-this-is-a-new-page\" href=\"#hi-this-is-a-new-page\">\n </a>\n Hi, this is a New Page\n</h1>\n\n<p>Yep, it's an a new page</p>\n\n",
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "contained"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "unprocessable",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": null,
|
|
"title": "Example Page",
|
|
"slug": "example1",
|
|
"description": "a new page",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "# Hi, this is a New Page\nYep, it's an a new page",
|
|
"processed_html": null,
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "moon"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "Title of the page"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "Used to link to this page in URLs, must be unique and URL-safe"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "For internal use, helps similar pages from one another"
|
|
},
|
|
"body_markdown": {
|
|
"type": "string",
|
|
"description": "The text (in markdown) of the ad (required)"
|
|
},
|
|
"body_json": {
|
|
"type": "string",
|
|
"description": "For JSON pages, the JSON body"
|
|
},
|
|
"is_top_level_path": {
|
|
"type": "boolean",
|
|
"description": "If true, the page is available at '/{slug}' instead of '/page/{slug}', use with caution"
|
|
},
|
|
"template": {
|
|
"type": "string",
|
|
"enum": [
|
|
"contained",
|
|
"full_within_layout",
|
|
"nav_bar_included",
|
|
"json"
|
|
],
|
|
"default": "contained",
|
|
"description": "Controls what kind of layout the page is rendered in"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/pages/{id}": {
|
|
"get": {
|
|
"summary": "show details for a page",
|
|
"security": [],
|
|
"tags": ["pages"],
|
|
"description": "This endpoint allows the client to retrieve details for a single Page object, specified by ID.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the page.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 1
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 907,
|
|
"title": "A Confederacy of Dunces",
|
|
"slug": "drill_scale",
|
|
"description": "Assumenda eum ipsa necessitatibus.",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "Suscipit sint ullam voluptatem.",
|
|
"processed_html": "<p>Suscipit sint ullam voluptatem.</p>\n\n",
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "contained"
|
|
},
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"summary": "update details for a page",
|
|
"tags": ["pages"],
|
|
"description": "This endpoint allows the client to retrieve details for a single Page object, specified by ID.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the page.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 1
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 908,
|
|
"title": "New Title",
|
|
"slug": "design-perception",
|
|
"description": "Quaerat facilis rerum sint.",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "Et possimus iste deleniti.",
|
|
"processed_html": "<p>Et possimus iste deleniti.</p>\n\n",
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "contained"
|
|
},
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "unprocessable",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 910,
|
|
"title": "I Sing the Body Electric",
|
|
"slug": "design_glow",
|
|
"description": "Incidunt omnis quis at.",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "Ratione repellendus voluptatem ipsum.",
|
|
"processed_html": "<p>Necessitatibus eius odio minus.</p>\n\n",
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "moon"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "remove a page",
|
|
"tags": ["pages"],
|
|
"description": "This endpoint allows the client to delete a single Page object, specified by ID.",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the page.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 1
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 911,
|
|
"title": "Dying of the Light",
|
|
"slug": "thank_shock",
|
|
"description": "Ratione labore enim voluptas.",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "Quis natus impedit illum.",
|
|
"processed_html": "<p>Quis natus impedit illum.</p>\n\n",
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "contained"
|
|
},
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "unprocessable",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"doubled_module": {
|
|
"const_name": "Page",
|
|
"object": "Page"
|
|
},
|
|
"__expired": false,
|
|
"name": null,
|
|
"__sending_message": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/podcast_episodes": {
|
|
"get": {
|
|
"summary": "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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
},
|
|
{
|
|
"name": "username",
|
|
"in": "query",
|
|
"required": false,
|
|
"description": "Using this parameter will retrieve episodes belonging to a specific podcast.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "codenewbie"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of Podcast episodes filtered by username",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "podcast_episodes",
|
|
"class_name": "PodcastEpisode",
|
|
"id": 1166,
|
|
"path": "/codenewbie/slug-4",
|
|
"title": "22",
|
|
"image_url": "/uploads/podcast/image/1210/49f5caba-27a1-48f6-80ff-33f47b7ca5e1.jpeg",
|
|
"podcast": {
|
|
"title": "Bourbon County Stout",
|
|
"slug": "codenewbie",
|
|
"image_url": "/uploads/podcast/image/1210/49f5caba-27a1-48f6-80ff-33f47b7ca5e1.jpeg"
|
|
}
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/PodcastEpisodeIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Unknown Podcast username",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/profile_images/{username}": {
|
|
"get": {
|
|
"summary": "A Users or organizations profile image",
|
|
"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": [
|
|
{
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The parameter is the username of the user or the username of the organization.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "janedoe"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "An object containing profile image details",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"type_of": "profile_image",
|
|
"image_of": "user",
|
|
"profile_image": "/uploads/user/profile_image/56584/d63e2f44-99a2-4d70-880f-391f9e5123d8.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/56584/d63e2f44-99a2-4d70-880f-391f9e5123d8.jpeg"
|
|
},
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ProfileImage"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Resource Not Found",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/reactions/toggle": {
|
|
"post": {
|
|
"summary": "toggle reaction",
|
|
"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": [
|
|
{
|
|
"name": "category",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"like",
|
|
"unicorn",
|
|
"exploding_head",
|
|
"raised_hands",
|
|
"fire"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "reactable_id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
},
|
|
{
|
|
"name": "reactable_type",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["Comment", "Article", "User"]
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"result": "create",
|
|
"category": "like",
|
|
"id": 2068,
|
|
"reactable_id": 20848,
|
|
"reactable_type": "Article"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/reactions": {
|
|
"post": {
|
|
"summary": "create reaction",
|
|
"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": [
|
|
{
|
|
"name": "category",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"like",
|
|
"unicorn",
|
|
"exploding_head",
|
|
"raised_hands",
|
|
"fire"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "reactable_id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
},
|
|
{
|
|
"name": "reactable_type",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["Comment", "Article", "User"]
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"result": "none",
|
|
"category": "like",
|
|
"id": 2070,
|
|
"reactable_id": 20850,
|
|
"reactable_type": "Article"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/readinglist": {
|
|
"get": {
|
|
"summary": "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": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam30to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"200": {
|
|
"description": "A list of articles in the users readinglist",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/tags": {
|
|
"get": {
|
|
"summary": "Tags",
|
|
"tags": ["tags"],
|
|
"security": [],
|
|
"description": "This endpoint allows the client to retrieve a list of tags that can be used to tag articles.\n\nIt will return tags ordered by popularity.\n\nIt supports pagination, each page will contain 10 tags by default.",
|
|
"operationId": "getTags",
|
|
"parameters": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam10to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of all tags",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"id": 38716,
|
|
"name": "tag5",
|
|
"bg_color_hex": null,
|
|
"text_color_hex": null
|
|
},
|
|
{
|
|
"id": 38717,
|
|
"name": "tag6",
|
|
"bg_color_hex": null,
|
|
"text_color_hex": null
|
|
},
|
|
{
|
|
"id": 38718,
|
|
"name": "tag7",
|
|
"bg_color_hex": null,
|
|
"text_color_hex": null
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Tag"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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": 56596,
|
|
"username": "username714",
|
|
"name": "Angie \"Deon\" \\:/ Streich",
|
|
"twitter_username": "twitter714",
|
|
"github_username": "github714",
|
|
"summary": null,
|
|
"location": null,
|
|
"website_url": null,
|
|
"joined_at": "Jul 18, 2023",
|
|
"profile_image": "/uploads/user/profile_image/56596/a2db253e-9d79-4cb1-bdbb-9b45aefb0610.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"],
|
|
"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": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"items": {
|
|
"$ref": "#/components/schemas/User"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{id}/unpublish": {
|
|
"put": {
|
|
"summary": "Unpublish a User's Articles and Comments",
|
|
"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": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the user to unpublish.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 1
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "User's articles and comments successfully unpublished"
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Unknown User ID (still accepted for async processing)",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/users/{id}/suspend": {
|
|
"put": {
|
|
"summary": "Suspend a User",
|
|
"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": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true,
|
|
"description": "The ID of the user to suspend.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 1
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "User successfully unpublished"
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Unknown User ID",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "not found",
|
|
"status": 404
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/videos": {
|
|
"get": {
|
|
"summary": "Articles with a video",
|
|
"tags": ["videos", "articles"],
|
|
"security": [],
|
|
"description": "This endpoint allows the client to retrieve a list of articles that are uploaded with a video.\n\nIt will only return published video articles ordered by descending popularity.\n\nIt supports pagination, each page will contain 24 articles by default.",
|
|
"operationId": "videos",
|
|
"parameters": [
|
|
{
|
|
"$ref": "#/components/parameters/pageParam"
|
|
},
|
|
{
|
|
"$ref": "#/components/parameters/perPageParam24to1000"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A List of all articles with videos",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"type_of": "video_article",
|
|
"id": 20852,
|
|
"path": "/username733/everything-is-illuminated214-2e2p",
|
|
"cloudinary_video_url": "https://dw71fyauz7yz9.cloudfront.net/video-upload__1e42eb0bab4abb3c63baeb5e8bdfe69f/thumbs-video-upload__1e42eb0bab4abb3c63baeb5e8bdfe69f-00001.png",
|
|
"title": "Everything is Illuminated214",
|
|
"user_id": 56616,
|
|
"video_duration_in_minutes": "00:00",
|
|
"video_source_url": "https://dw71fyauz7yz9.cloudfront.net/video-upload__1e42eb0bab4abb3c63baeb5e8bdfe69f/video-upload__1e42eb0bab4abb3c63baeb5e8bdfe69f.m3u8",
|
|
"user": {
|
|
"name": "Chet \"Drema\" \\:/ Watsica"
|
|
}
|
|
},
|
|
{
|
|
"type_of": "video_article",
|
|
"id": 20853,
|
|
"path": "/username734/carrion-comfort215-5205",
|
|
"cloudinary_video_url": "https://dw71fyauz7yz9.cloudfront.net/video-upload__1e42eb0bab4abb3c63baeb5e8bdfe69f/thumbs-video-upload__1e42eb0bab4abb3c63baeb5e8bdfe69f-00001.png",
|
|
"title": "Carrion Comfort215",
|
|
"user_id": 56617,
|
|
"video_duration_in_minutes": "00:00",
|
|
"video_source_url": "https://dw71fyauz7yz9.cloudfront.net/video-upload__1e42eb0bab4abb3c63baeb5e8bdfe69f/video-upload__1e42eb0bab4abb3c63baeb5e8bdfe69f.m3u8",
|
|
"user": {
|
|
"name": "Rashad \"Darrel\" \\:/ Breitenberg"
|
|
}
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/VideoArticle"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "https://dev.to/api",
|
|
"description": "Production server"
|
|
}
|
|
],
|
|
"security": [
|
|
{
|
|
"api-key": []
|
|
}
|
|
],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"api-key": {
|
|
"type": "apiKey",
|
|
"name": "api-key",
|
|
"in": "header",
|
|
"description": "API Key authentication.\n\nAuthentication for some endpoints, like write operations on the\nArticles API require a DEV API key.\n\nAll authenticated endpoints are CORS disabled, the API key is intended for non-browser scripts.\n\n### Getting an API key\n\nTo obtain one, please follow these steps:\n\n - visit https://dev.to/settings/extensions\n - in the \"DEV API Keys\" section create a new key by adding a\n description and clicking on \"Generate API Key\"\n\n \n\n - You'll see the newly generated key in the same view\n "
|
|
}
|
|
},
|
|
"parameters": {
|
|
"pageParam": {
|
|
"in": "query",
|
|
"name": "page",
|
|
"required": false,
|
|
"description": "Pagination page",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1,
|
|
"default": 1
|
|
}
|
|
},
|
|
"perPageParam10to1000": {
|
|
"in": "query",
|
|
"name": "per_page",
|
|
"required": false,
|
|
"description": "Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1,
|
|
"maximum": 1000,
|
|
"default": 10
|
|
}
|
|
},
|
|
"perPageParam24to1000": {
|
|
"in": "query",
|
|
"name": "per_page",
|
|
"required": false,
|
|
"description": "Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1,
|
|
"maximum": 1000,
|
|
"default": 24
|
|
}
|
|
},
|
|
"perPageParam30to1000": {
|
|
"in": "query",
|
|
"name": "per_page",
|
|
"required": false,
|
|
"description": "Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1,
|
|
"maximum": 1000,
|
|
"default": 30
|
|
}
|
|
},
|
|
"perPageParam30to100": {
|
|
"in": "query",
|
|
"name": "per_page",
|
|
"required": false,
|
|
"description": "Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"default": 30
|
|
}
|
|
},
|
|
"perPageParam80to1000": {
|
|
"in": "query",
|
|
"name": "per_page",
|
|
"required": false,
|
|
"description": "Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1,
|
|
"maximum": 1000,
|
|
"default": 80
|
|
}
|
|
},
|
|
"listingCategoryParam": {
|
|
"name": "category",
|
|
"in": "query",
|
|
"description": "Using this parameter will return listings belonging to the\n requested category.",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"example": "cfp"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"ArticleFlareTag": {
|
|
"description": "Flare tag of the article",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"bg_color_hex": {
|
|
"description": "Background color (hexadecimal)",
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"text_color_hex": {
|
|
"description": "Text color (hexadecimal)",
|
|
"type": "string",
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"ArticleIndex": {
|
|
"description": "Representation of an article or post returned in a list",
|
|
"type": "object",
|
|
"properties": {
|
|
"type_of": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"cover_image": {
|
|
"type": "string",
|
|
"format": "url",
|
|
"nullable": true
|
|
},
|
|
"readable_publish_date": {
|
|
"type": "string"
|
|
},
|
|
"social_image": {
|
|
"type": "string",
|
|
"format": "url"
|
|
},
|
|
"tag_list": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"tags": {
|
|
"type": "string"
|
|
},
|
|
"slug": {
|
|
"type": "string"
|
|
},
|
|
"path": {
|
|
"type": "string",
|
|
"format": "path"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"format": "url"
|
|
},
|
|
"canonical_url": {
|
|
"type": "string",
|
|
"format": "url"
|
|
},
|
|
"positive_reactions_count": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"public_reactions_count": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"edited_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"nullable": true
|
|
},
|
|
"crossposted_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"nullable": true
|
|
},
|
|
"published_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"last_comment_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"published_timestamp": {
|
|
"description": "Crossposting or published date time",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"reading_time_minutes": {
|
|
"description": "Reading time, in minutes",
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"user": {
|
|
"$ref": "#/components/schemas/SharedUser"
|
|
},
|
|
"flare_tag": {
|
|
"$ref": "#/components/schemas/ArticleFlareTag"
|
|
},
|
|
"organization": {
|
|
"$ref": "#/components/schemas/SharedOrganization"
|
|
}
|
|
},
|
|
"required": [
|
|
"type_of",
|
|
"id",
|
|
"title",
|
|
"description",
|
|
"cover_image",
|
|
"readable_publish_date",
|
|
"social_image",
|
|
"tag_list",
|
|
"tags",
|
|
"slug",
|
|
"path",
|
|
"url",
|
|
"canonical_url",
|
|
"comments_count",
|
|
"positive_reactions_count",
|
|
"public_reactions_count",
|
|
"created_at",
|
|
"edited_at",
|
|
"crossposted_at",
|
|
"published_at",
|
|
"last_comment_at",
|
|
"published_timestamp",
|
|
"user",
|
|
"reading_time_minutes"
|
|
]
|
|
},
|
|
"VideoArticle": {
|
|
"description": "Representation of an Article with video",
|
|
"type": "object",
|
|
"properties": {
|
|
"type_of": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"cloudinary_video_url": {
|
|
"type": "string"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"user_id": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"video_duration_in_minutes": {
|
|
"type": "string"
|
|
},
|
|
"video_source_url": {
|
|
"type": "string"
|
|
},
|
|
"user": {
|
|
"description": "Author of the article",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"Article": {
|
|
"description": "Representation of an Article to be created/updated",
|
|
"type": "object",
|
|
"properties": {
|
|
"article": {
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"body_markdown": {
|
|
"type": "string"
|
|
},
|
|
"published": {
|
|
"type": "boolean",
|
|
"default": false
|
|
},
|
|
"series": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"main_image": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"canonical_url": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"tags": {
|
|
"type": "string"
|
|
},
|
|
"organization_id": {
|
|
"type": "integer",
|
|
"nullable": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"Organization": {
|
|
"description": "Representation of an Organization",
|
|
"type": "object",
|
|
"properties": {
|
|
"type_of": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"summary": {
|
|
"type": "string"
|
|
},
|
|
"twitter_username": {
|
|
"type": "string"
|
|
},
|
|
"github_username": {
|
|
"type": "string"
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"location": {
|
|
"type": "string"
|
|
},
|
|
"joined_at": {
|
|
"type": "string"
|
|
},
|
|
"tech_stack": {
|
|
"type": "string"
|
|
},
|
|
"tag_line": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"story": {
|
|
"type": "string",
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"FollowedTag": {
|
|
"description": "Representation of a followed tag",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Tag id",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"points": {
|
|
"type": "number",
|
|
"format": "float"
|
|
}
|
|
},
|
|
"required": ["id", "name", "points"]
|
|
},
|
|
"Tag": {
|
|
"description": "Representation of a tag",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Tag id",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"bg_color_hex": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"text_color_hex": {
|
|
"type": "string",
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"Page": {
|
|
"description": "Representation of a page object",
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "Title of the page"
|
|
},
|
|
"slug": {
|
|
"type": "string",
|
|
"description": "Used to link to this page in URLs, must be unique and URL-safe"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "For internal use, helps similar pages from one another"
|
|
},
|
|
"body_markdown": {
|
|
"type": "string",
|
|
"description": "The text (in markdown) of the ad (required)",
|
|
"nullable": true
|
|
},
|
|
"body_json": {
|
|
"type": "string",
|
|
"description": "For JSON pages, the JSON body",
|
|
"nullable": true
|
|
},
|
|
"is_top_level_path": {
|
|
"type": "boolean",
|
|
"description": "If true, the page is available at '/{slug}' instead of '/page/{slug}', use with caution"
|
|
},
|
|
"social_image": {
|
|
"type": "object",
|
|
"nullable": true
|
|
},
|
|
"template": {
|
|
"type": "string",
|
|
"enum": [
|
|
"contained",
|
|
"full_within_layout",
|
|
"nav_bar_included",
|
|
"json"
|
|
],
|
|
"default": "contained",
|
|
"description": "Controls what kind of layout the page is rendered in"
|
|
}
|
|
},
|
|
"required": ["title", "slug", "description", "template"]
|
|
},
|
|
"PodcastEpisodeIndex": {
|
|
"description": "Representation of a podcast episode returned in a list",
|
|
"type": "object",
|
|
"properties": {
|
|
"type_of": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"class_name": {
|
|
"type": "string"
|
|
},
|
|
"path": {
|
|
"type": "string",
|
|
"format": "path"
|
|
},
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"image_url": {
|
|
"description": "Podcast episode image url or podcast image url",
|
|
"type": "string",
|
|
"format": "url"
|
|
},
|
|
"podcast": {
|
|
"$ref": "#/components/schemas/SharedPodcast"
|
|
}
|
|
},
|
|
"required": [
|
|
"type_of",
|
|
"class_name",
|
|
"id",
|
|
"path",
|
|
"title",
|
|
"image_url",
|
|
"podcast"
|
|
]
|
|
},
|
|
"ProfileImage": {
|
|
"description": "A profile image object",
|
|
"type": "object",
|
|
"properties": {
|
|
"type_of": {
|
|
"description": "Return profile_image",
|
|
"type": "string"
|
|
},
|
|
"image_of": {
|
|
"description": "Determines the type of the profile image owner (user or organization)",
|
|
"type": "string"
|
|
},
|
|
"profile_image": {
|
|
"description": "Profile image (640x640)",
|
|
"type": "string"
|
|
},
|
|
"profile_image_90": {
|
|
"description": "Profile image (90x90)",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SharedUser": {
|
|
"description": "The resource creator",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"twitter_username": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"github_username": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"website_url": {
|
|
"type": "string",
|
|
"format": "url",
|
|
"nullable": true
|
|
},
|
|
"profile_image": {
|
|
"description": "Profile image (640x640)",
|
|
"type": "string"
|
|
},
|
|
"profile_image_90": {
|
|
"description": "Profile image (90x90)",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SharedOrganization": {
|
|
"description": "The organization the resource belongs to",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"slug": {
|
|
"type": "string"
|
|
},
|
|
"profile_image": {
|
|
"description": "Profile image (640x640)",
|
|
"type": "string",
|
|
"format": "url"
|
|
},
|
|
"profile_image_90": {
|
|
"description": "Profile image (90x90)",
|
|
"type": "string",
|
|
"format": "url"
|
|
}
|
|
}
|
|
},
|
|
"User": {
|
|
"description": "The representation of a user",
|
|
"type": "object",
|
|
"properties": {
|
|
"type_of": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"summary": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"twitter_username": {
|
|
"type": "string"
|
|
},
|
|
"github_username": {
|
|
"type": "string"
|
|
},
|
|
"website_url": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"location": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"joined_at": {
|
|
"type": "string"
|
|
},
|
|
"profile_image": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"SharedPodcast": {
|
|
"description": "The podcast that the resource belongs to",
|
|
"type": "object",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"slug": {
|
|
"type": "string"
|
|
},
|
|
"image_url": {
|
|
"description": "Podcast image url",
|
|
"type": "string",
|
|
"format": "url"
|
|
}
|
|
}
|
|
},
|
|
"Comment": {
|
|
"description": "A Comment on an Article or Podcast Episode",
|
|
"type": "object",
|
|
"properties": {
|
|
"type_of": {
|
|
"type": "string"
|
|
},
|
|
"id_code": {
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"image_url": {
|
|
"description": "Podcast image url",
|
|
"type": "string",
|
|
"format": "url"
|
|
}
|
|
}
|
|
},
|
|
"UserInviteParam": {
|
|
"description": "User invite parameters",
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"DisplayAd": {
|
|
"description": "A Display Ad, aka Billboard, aka Widget",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer",
|
|
"description": "The ID of the Display Ad"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "For internal use, helps distinguish ads from one another"
|
|
},
|
|
"body_markdown": {
|
|
"type": "string",
|
|
"description": "The text (in markdown) of the ad (required)"
|
|
},
|
|
"approved": {
|
|
"type": "boolean",
|
|
"description": "Ad must be both published and approved to be in rotation"
|
|
},
|
|
"published": {
|
|
"type": "boolean",
|
|
"description": "Ad must be both published and approved to be in rotation"
|
|
},
|
|
"organization_id": {
|
|
"type": "integer",
|
|
"description": "Identifies the organization to which the ad belongs",
|
|
"nullable": true
|
|
},
|
|
"creator_id": {
|
|
"type": "integer",
|
|
"description": "Identifies the user who created the ad.",
|
|
"nullable": true
|
|
},
|
|
"placement_area": {
|
|
"type": "string",
|
|
"enum": [
|
|
"sidebar_left",
|
|
"sidebar_left_2",
|
|
"sidebar_right",
|
|
"feed_first",
|
|
"feed_second",
|
|
"feed_third",
|
|
"home_hero",
|
|
"post_sidebar",
|
|
"post_comments"
|
|
],
|
|
"description": "Identifies which area of site layout the ad can appear in"
|
|
},
|
|
"tag_list": {
|
|
"type": "string",
|
|
"description": "Tags on which this ad can be displayed (blank is all/any tags)"
|
|
},
|
|
"article_exclude_ids": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"description": "Articles this ad should *not* appear on (blank means no articles are disallowed, and this ad can appear next to any/all articles). Comma-separated list of integer Article IDs"
|
|
},
|
|
"audience_segment_id": {
|
|
"type": "integer",
|
|
"description": "Specifies a specific audience segment who will see this billboard"
|
|
},
|
|
"audience_segment_type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"manual",
|
|
"trusted",
|
|
"posted",
|
|
"no_posts_yet",
|
|
"dark_theme",
|
|
"light_theme",
|
|
"no_experience",
|
|
"experience1",
|
|
"experience2",
|
|
"experience3",
|
|
"experience4",
|
|
"experience5"
|
|
],
|
|
"description": "Specifies a group of users who will see this billboard (must match audience_segment_id if both provided)"
|
|
},
|
|
"display_to": {
|
|
"type": "string",
|
|
"enum": ["all", "logged_in", "logged_out"],
|
|
"default": "all",
|
|
"description": "Potentially limits visitors to whom the ad is visible"
|
|
},
|
|
"type_of": {
|
|
"type": "string",
|
|
"enum": ["in_house", "community", "external"],
|
|
"default": "in_house",
|
|
"description": "Types of the billboards:\nin_house (created by admins),\ncommunity (created by an entity, appears on entity's content),\nexternal ( created by an entity, or a non-entity, can appear everywhere)\n"
|
|
}
|
|
},
|
|
"required": ["name", "body_markdown", "placement_area"]
|
|
},
|
|
"Segment": {
|
|
"description": "A manually managed audience segment",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "integer",
|
|
"description": "The ID of the segment"
|
|
},
|
|
"type_of": {
|
|
"type": "string",
|
|
"enum": ["manual"],
|
|
"default": "manual",
|
|
"description": "Marks the segment as manually managed (other types are internal)"
|
|
},
|
|
"user_count": {
|
|
"type": "integer",
|
|
"description": "The current number of users in the segment"
|
|
}
|
|
}
|
|
},
|
|
"SegmentUserIds": {
|
|
"type": "object",
|
|
"properties": {
|
|
"user_ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
},
|
|
"maxItems": 10000
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|