* Pages API pt 1 (read/get/index+show) * Update spec/requests/api/v1/docs/pages_spec.rb Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com> * Update spec/requests/api/v1/docs/pages_spec.rb Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com> * API Key not required for index & show * API Feature flag has long since been removed * Page schema * Fix spec broken by merge Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2491 lines
90 KiB
JSON
2491 lines
90 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": 6337,
|
|
"title": "New article",
|
|
"description": "New post example",
|
|
"readable_publish_date": "Jan 25",
|
|
"slug": "new-article-47pm",
|
|
"path": "/username383/new-article-47pm",
|
|
"url": "http://localhost:3000/username383/new-article-47pm",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": 172,
|
|
"published_timestamp": "2023-01-25T12:55:55Z",
|
|
"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-01-25T12:55:55Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-25T12:55:55Z",
|
|
"last_comment_at": "2023-01-25T12:55:55Z",
|
|
"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": "Agustin \"Sharonda\" \\:/ Raynor",
|
|
"username": "username383",
|
|
"twitter_username": "twitter383",
|
|
"github_username": "github383",
|
|
"user_id": 14167,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/14167/877bdeb5-3053-4e37-9f67-f969a30f7952.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14167/877bdeb5-3053-4e37-9f67-f969a30f7952.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": 6340,
|
|
"title": "Brandy of the Damned175",
|
|
"description": "Meh sustainable iphone fingerstache. Vice seitan waistcoat etsy slow-carb art party. Health banh mi...",
|
|
"readable_publish_date": "Jan 25",
|
|
"slug": "brandy-of-the-damned175-2lpf",
|
|
"path": "/username387/brandy-of-the-damned175-2lpf",
|
|
"url": "http://localhost:3000/username387/brandy-of-the-damned175-2lpf",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-01-25T12:55:55Z",
|
|
"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/username387/brandy-of-the-damned175-2lpf",
|
|
"created_at": "2023-01-25T12:55:55Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-25T12:55:55Z",
|
|
"last_comment_at": "2023-01-25T12:55:55Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["discuss"],
|
|
"tags": "discuss",
|
|
"user": {
|
|
"name": "Claude \"Vicki\" \\:/ McDermott",
|
|
"username": "username387",
|
|
"twitter_username": "twitter387",
|
|
"github_username": "github387",
|
|
"user_id": 14171,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/14171/382979c4-c048-4e4a-82a6-a5c99974a316.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14171/382979c4-c048-4e4a-82a6-a5c99974a316.jpeg"
|
|
},
|
|
"organization": {
|
|
"name": "Heller, Stiedemann and Marquardt",
|
|
"username": "org70",
|
|
"slug": "org70",
|
|
"profile_image": "/uploads/organization/profile_image/2320/6e778d6e-80a3-47d0-b8f3-a8f999652ac5.png",
|
|
"profile_image_90": "/uploads/organization/profile_image/2320/6e778d6e-80a3-47d0-b8f3-a8f999652ac5.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": 6343,
|
|
"title": "Dance Dance Dance178",
|
|
"description": "Flannel wayfarers aesthetic normcore forage taxidermy everyday selvage. Muggle magic distillery...",
|
|
"readable_publish_date": "Jan 25",
|
|
"slug": "dance-dance-dance178-4m7i",
|
|
"path": "/username390/dance-dance-dance178-4m7i",
|
|
"url": "http://localhost:3000/username390/dance-dance-dance178-4m7i",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-01-25T12:55:55Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/21-8c16e6ef44da175a1e51f1ba9d0cb55af8a920db6aacbf1e4b7a055afc1b3d30.png",
|
|
"social_image": "http://localhost:3000/assets/21-8c16e6ef44da175a1e51f1ba9d0cb55af8a920db6aacbf1e4b7a055afc1b3d30.png",
|
|
"canonical_url": "http://localhost:3000/username390/dance-dance-dance178-4m7i",
|
|
"created_at": "2023-01-25T12:55:55Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-25T12:55:55Z",
|
|
"last_comment_at": "2023-01-25T12:55:55Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["javascript", "html", "discuss"],
|
|
"tags": "javascript, html, discuss",
|
|
"user": {
|
|
"name": "Carlos \"Laurence\" \\:/ Waelchi",
|
|
"username": "username390",
|
|
"twitter_username": "twitter390",
|
|
"github_username": "github390",
|
|
"user_id": 14174,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/14174/5e84bae2-6991-4b8c-bf6b-a9cc7b2c8d92.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14174/5e84bae2-6991-4b8c-bf6b-a9cc7b2c8d92.jpeg"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
},
|
|
{
|
|
"type_of": "article",
|
|
"id": 6342,
|
|
"title": "Time To Murder And Create177",
|
|
"description": "Cornhole art party lumbersexual literally cred flexitarian marfa. Deep v salvia asymmetrical. Selvage...",
|
|
"readable_publish_date": "Jan 25",
|
|
"slug": "time-to-murder-and-create177-3de5",
|
|
"path": "/username389/time-to-murder-and-create177-3de5",
|
|
"url": "http://localhost:3000/username389/time-to-murder-and-create177-3de5",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-01-25T12:55:55Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/6-52ee7e994a1369d112d656dfffbf324d1f209a7372a761776f77aeea47b0e4a8.png",
|
|
"social_image": "http://localhost:3000/assets/6-52ee7e994a1369d112d656dfffbf324d1f209a7372a761776f77aeea47b0e4a8.png",
|
|
"canonical_url": "http://localhost:3000/username389/time-to-murder-and-create177-3de5",
|
|
"created_at": "2023-01-25T12:55:55Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-25T12:55:55Z",
|
|
"last_comment_at": "2023-01-25T12:55:55Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["javascript", "html", "discuss"],
|
|
"tags": "javascript, html, discuss",
|
|
"user": {
|
|
"name": "Adolph \"Hugh\" \\:/ Schuppe",
|
|
"username": "username389",
|
|
"twitter_username": "twitter389",
|
|
"github_username": "github389",
|
|
"user_id": 14173,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/14173/fbce19a4-f55a-4903-be74-1c123559a73c.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14173/fbce19a4-f55a-4903-be74-1c123559a73c.jpeg"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
},
|
|
{
|
|
"type_of": "article",
|
|
"id": 6341,
|
|
"title": "I Know Why the Caged Bird Sings176",
|
|
"description": "Cold-pressed vhs vinegar mumblecore kale chips muggle magic. Next level ethical post-ironic truffaut...",
|
|
"readable_publish_date": "Jan 25",
|
|
"slug": "i-know-why-the-caged-bird-sings176-15fg",
|
|
"path": "/username388/i-know-why-the-caged-bird-sings176-15fg",
|
|
"url": "http://localhost:3000/username388/i-know-why-the-caged-bird-sings176-15fg",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-01-25T12:55:55Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/6-52ee7e994a1369d112d656dfffbf324d1f209a7372a761776f77aeea47b0e4a8.png",
|
|
"social_image": "http://localhost:3000/assets/6-52ee7e994a1369d112d656dfffbf324d1f209a7372a761776f77aeea47b0e4a8.png",
|
|
"canonical_url": "http://localhost:3000/username388/i-know-why-the-caged-bird-sings176-15fg",
|
|
"created_at": "2023-01-25T12:55:55Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-25T12:55:55Z",
|
|
"last_comment_at": "2023-01-25T12:55:55Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["javascript", "html", "discuss"],
|
|
"tags": "javascript, html, discuss",
|
|
"user": {
|
|
"name": "Erasmo \"Maudie\" \\:/ Sipes",
|
|
"username": "username388",
|
|
"twitter_username": "twitter388",
|
|
"github_username": "github388",
|
|
"user_id": 14172,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/14172/3e3db19f-a926-4de3-8f0f-855758865895.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14172/3e3db19f-a926-4de3-8f0f-855758865895.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": 6344,
|
|
"title": "A Monstrous Regiment of Women179",
|
|
"description": "Everyday mixtape etsy slow-carb distillery. Flannel organic muggle magic pour-over...",
|
|
"readable_publish_date": "Jan 25",
|
|
"slug": "a-monstrous-regiment-of-women179-2i54",
|
|
"path": "/username391/a-monstrous-regiment-of-women179-2i54",
|
|
"url": "http://localhost:3000/username391/a-monstrous-regiment-of-women179-2i54",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-01-25T12:55:55Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/20-92231c1d2ddb3b707b8c1b5cb711ef17632ff2a64495970a58518ce33c3a4f76.png",
|
|
"social_image": "http://localhost:3000/assets/20-92231c1d2ddb3b707b8c1b5cb711ef17632ff2a64495970a58518ce33c3a4f76.png",
|
|
"canonical_url": "http://localhost:3000/username391/a-monstrous-regiment-of-women179-2i54",
|
|
"created_at": "2023-01-25T12:55:55Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-25T12:55:55Z",
|
|
"last_comment_at": "2023-01-25T12:55:55Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": "discuss",
|
|
"tags": ["discuss"],
|
|
"body_html": "<p>Everyday mixtape etsy slow-carb distillery. Flannel organic muggle magic pour-over skateboard.</p>\n\n<p>Meditation taxidermy shabby chic pabst listicle leggings artisan cleanse. Artisan austin bespoke. Helvetica swag twee organic cray forage pitchfork.</p>\n\n",
|
|
"body_markdown": "---\ntitle: A Monstrous Regiment of Women179\npublished: true\ntags: discuss\ndate: \nseries: \ncanonical_url: \n\n---\n\nEveryday mixtape etsy slow-carb distillery. Flannel organic muggle magic pour-over skateboard.\n\n\nMeditation taxidermy shabby chic pabst listicle leggings artisan cleanse. Artisan austin bespoke. Helvetica swag twee organic cray forage pitchfork.\n\n",
|
|
"user": {
|
|
"name": "Steve \"Michelle\" \\:/ Ziemann",
|
|
"username": "username391",
|
|
"twitter_username": "twitter391",
|
|
"github_username": "github391",
|
|
"user_id": 14175,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/14175/3fc2a914-26a3-4c7e-a4e2-573f70f96d7e.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14175/3fc2a914-26a3-4c7e-a4e2-573f70f96d7e.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": 6345,
|
|
"title": "Specimen Days180",
|
|
"description": "Cliche farm-to-table venmo hashtag. Pop-up kitsch thundercats jean shorts sriracha keytar goth. Art...",
|
|
"readable_publish_date": "Jan 25",
|
|
"slug": "specimen-days180-3mi4",
|
|
"path": "/username392/specimen-days180-3mi4",
|
|
"url": "http://localhost:3000/username392/specimen-days180-3mi4",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-01-25T12:55:55Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/3-93b6b57b5a6115cffe5d63d29a22825eb9e65f647bfef57a88244bc2b98186f0.png",
|
|
"social_image": "http://localhost:3000/assets/3-93b6b57b5a6115cffe5d63d29a22825eb9e65f647bfef57a88244bc2b98186f0.png",
|
|
"canonical_url": "http://localhost:3000/username392/specimen-days180-3mi4",
|
|
"created_at": "2023-01-25T12:55:55Z",
|
|
"edited_at": "2023-01-25T12:55:55Z",
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-25T12:55:55Z",
|
|
"last_comment_at": "2023-01-25T12:55:55Z",
|
|
"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": "Louis \"Morris\" \\:/ Bernier",
|
|
"username": "username392",
|
|
"twitter_username": "twitter392",
|
|
"github_username": "github392",
|
|
"user_id": 14176,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/14176/035a89ea-ed51-4fca-b3b2-51d9de7529cb.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14176/035a89ea-ed51-4fca-b3b2-51d9de7529cb.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": 6348,
|
|
"title": "Waiting for the Barbarians183",
|
|
"description": "Occupy synth semiotics forage banjo fanny pack. Lomo crucifix letterpress. Sustainable you probably...",
|
|
"readable_publish_date": "Jan 25",
|
|
"slug": "waiting-for-the-barbarians183-573k",
|
|
"path": "/username396/waiting-for-the-barbarians183-573k",
|
|
"url": "http://localhost:3000/username396/waiting-for-the-barbarians183-573k",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-01-25T12:55:56Z",
|
|
"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/username396/waiting-for-the-barbarians183-573k",
|
|
"created_at": "2023-01-25T12:55:56Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-25T12:55:56Z",
|
|
"last_comment_at": "2023-01-25T12:55:56Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": "discuss",
|
|
"tags": ["discuss"],
|
|
"body_html": "<p>Occupy synth semiotics forage banjo fanny pack. Lomo crucifix letterpress. Sustainable you probably haven't heard of them pabst humblebrag pork belly.</p>\n\n<p>Migas flexitarian try-hard deep v letterpress forage neutra gentrify. Asymmetrical yr butcher shoreditch pitchfork chicharrones health.</p>\n\n",
|
|
"body_markdown": "---\ntitle: Waiting for the Barbarians183\npublished: true\ntags: discuss\ndate: \nseries: \ncanonical_url: \n\n---\n\nOccupy synth semiotics forage banjo fanny pack. Lomo crucifix letterpress. Sustainable you probably haven't heard of them pabst humblebrag pork belly.\n\n\nMigas flexitarian try-hard deep v letterpress forage neutra gentrify. Asymmetrical yr butcher shoreditch pitchfork chicharrones health.\n\n",
|
|
"user": {
|
|
"name": "Sue \"Cristopher\" \\:/ Smith",
|
|
"username": "username396",
|
|
"twitter_username": "twitter396",
|
|
"github_username": "github396",
|
|
"user_id": 14180,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/14180/3fe8a239-205e-4c96-bbe2-1af496c6f8f0.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14180/3fe8a239-205e-4c96-bbe2-1af496c6f8f0.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"],
|
|
"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"],
|
|
"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"],
|
|
"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"],
|
|
"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/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": []
|
|
}
|
|
}
|
|
},
|
|
"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": 608,
|
|
"approved": true,
|
|
"body_markdown": "# Hi, this is ad\nYep, it's an ad",
|
|
"cached_tag_list": "",
|
|
"clicks_count": 0,
|
|
"created_at": "2023-01-25T09:55:57.181-03:00",
|
|
"display_to": "all",
|
|
"impressions_count": 0,
|
|
"name": "Example Ad",
|
|
"organization_id": null,
|
|
"placement_area": "post_comments",
|
|
"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-01-25T09:55:57.181-03:00",
|
|
"tag_list": ""
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "unauthorized",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"error": "unauthorized",
|
|
"status": 401
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "unprocessable",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": null,
|
|
"approved": true,
|
|
"body_markdown": "# Hi, this is ad\nYep, it's an ad",
|
|
"cached_tag_list": null,
|
|
"clicks_count": 0,
|
|
"created_at": null,
|
|
"display_to": "all",
|
|
"impressions_count": 0,
|
|
"name": "Example Ad",
|
|
"organization_id": null,
|
|
"placement_area": "moon",
|
|
"processed_html": null,
|
|
"published": true,
|
|
"success_rate": 0.0,
|
|
"type_of": "in_house",
|
|
"updated_at": null,
|
|
"tag_list": null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"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"
|
|
},
|
|
"display_to": {
|
|
"type": "string",
|
|
"enum": ["all", "logged_in", "logged_out"],
|
|
"default": "all",
|
|
"description": "Potentially limits visitors to whom the ad is visible"
|
|
},
|
|
"placement_area": {
|
|
"type": "string",
|
|
"enum": [
|
|
"sidebar_left",
|
|
"sidebar_left_2",
|
|
"sidebar_right",
|
|
"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)"
|
|
}
|
|
},
|
|
"required": ["name", "body_markdown", "placement_area"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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 user to unpublish.",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int32",
|
|
"minimum": 1
|
|
},
|
|
"example": 123
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "successful",
|
|
"content": {
|
|
"application/json": {
|
|
"example": {
|
|
"id": 609,
|
|
"approved": false,
|
|
"body_markdown": "Hello _hey_ Hey hey 9",
|
|
"cached_tag_list": "",
|
|
"clicks_count": 0,
|
|
"created_at": "2023-01-25T09:55:57.330-03:00",
|
|
"display_to": "all",
|
|
"impressions_count": 0,
|
|
"name": "Display Ad 609",
|
|
"organization_id": 2321,
|
|
"placement_area": "sidebar_left",
|
|
"processed_html": "<p>Hello <em>hey</em> Hey hey 9</p>",
|
|
"published": false,
|
|
"success_rate": 0.0,
|
|
"type_of": "in_house",
|
|
"updated_at": "2023-01-25T09:55:57.333-03:00",
|
|
"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 user to unpublish.",
|
|
"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 10",
|
|
"display_to": "all",
|
|
"name": "Display Ad 610",
|
|
"organization_id": 2322,
|
|
"placement_area": "sidebar_left",
|
|
"published": false,
|
|
"processed_html": "<p>Hello <em>hey</em> Hey hey 10</p>",
|
|
"cached_tag_list": "",
|
|
"id": 610,
|
|
"clicks_count": 0,
|
|
"created_at": "2023-01-25T09:55:57.493-03:00",
|
|
"impressions_count": 0,
|
|
"success_rate": 0.0,
|
|
"type_of": "in_house",
|
|
"updated_at": "2023-01-25T09:55:57.495-03:00",
|
|
"tag_list": ""
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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",
|
|
"properties": {
|
|
"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"
|
|
},
|
|
"display_to": {
|
|
"type": "string",
|
|
"enum": ["all", "logged_in", "logged_out"],
|
|
"default": "all",
|
|
"description": "Potentially limits visitors to whom the ad is visible"
|
|
},
|
|
"placement_area": {
|
|
"type": "string",
|
|
"enum": [
|
|
"sidebar_left",
|
|
"sidebar_left_2",
|
|
"sidebar_right",
|
|
"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)"
|
|
}
|
|
},
|
|
"required": ["name", "body_markdown", "placement_area"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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 user 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"],
|
|
"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": 13670,
|
|
"name": "tag3",
|
|
"points": 1.0
|
|
},
|
|
{
|
|
"id": 13671,
|
|
"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": 399,
|
|
"created_at": "2023-01-25T12:55:58Z",
|
|
"user_id": 14211,
|
|
"name": "Jonah \"Theola\" \\:/ Mosciski",
|
|
"path": "/username427",
|
|
"username": "username427",
|
|
"profile_image": "/uploads/user/profile_image/14211/6d4b8204-8710-4afe-bfe3-6cb8479e7c17.jpeg"
|
|
},
|
|
{
|
|
"type_of": "user_follower",
|
|
"id": 398,
|
|
"created_at": "2023-01-25T12:55:57Z",
|
|
"user_id": 14209,
|
|
"name": "Merlyn \"Cortez\" \\:/ Lowe",
|
|
"path": "/username425",
|
|
"username": "username425",
|
|
"profile_image": "/uploads/user/profile_image/14209/35c0bd07-5aaa-4cb1-86dd-2be4d28892be.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/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": 226,
|
|
"title": "Mr Standfast",
|
|
"slug": "patience_plain",
|
|
"description": "Ut temporibus odio illum.",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "Reiciendis autem fuga et.",
|
|
"processed_html": "<p>Reiciendis autem fuga et.</p>\n\n",
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "contained"
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Page"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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": 227,
|
|
"title": "Tirra Lirra by the River",
|
|
"slug": "appointment-stuff",
|
|
"description": "Ducimus omnis est ullam.",
|
|
"is_top_level_path": false,
|
|
"landing_page": false,
|
|
"body_html": null,
|
|
"body_json": null,
|
|
"body_markdown": "Id dolores distinctio aliquam.",
|
|
"processed_html": "<p>Id dolores distinctio aliquam.</p>\n\n",
|
|
"social_image": {
|
|
"url": null
|
|
},
|
|
"template": "contained"
|
|
},
|
|
"schema": {
|
|
"$ref": "#/components/schemas/Page"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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": 338,
|
|
"path": "/codenewbie/slug-4",
|
|
"title": "17",
|
|
"image_url": "/uploads/podcast/image/335/a0c30fbb-ff1e-4f1c-bba1-2cd735070ba4.jpeg",
|
|
"podcast": {
|
|
"title": "Yeti Imperial Stout",
|
|
"slug": "codenewbie",
|
|
"image_url": "/uploads/podcast/image/335/a0c30fbb-ff1e-4f1c-bba1-2cd735070ba4.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/14217/58250f43-4319-4884-82b4-1029e5a026c2.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/14217/58250f43-4319-4884-82b4-1029e5a026c2.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": 1028,
|
|
"reactable_id": 6352,
|
|
"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": 1030,
|
|
"reactable_id": 6354,
|
|
"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/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"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
},
|
|
"text_color_hex": {
|
|
"description": "Text color (hexadecimal)",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
]
|
|
},
|
|
"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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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"]
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|