* Followed Tags swag docs * Update spec/requests/api/v1/docs/followed_tags_spec.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add to swagger helper * minor tweaks * more cleanup * syntax change * name change * User doesn't have to be an admin * Update spec/requests/api/v1/docs/followed_tags_spec.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update spec/requests/api/v1/docs/followed_tags_spec.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * update v1 json structure * Update spec/swagger_helper.rb Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com> * Update spec/requests/api/v1/docs/followed_tags_spec.rb Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * re-generate swagger file * Update spec/requests/api/v1/docs/followed_tags_spec.rb Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com> * regenerated swagger file Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
1754 lines
60 KiB
JSON
1754 lines
60 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": {
|
|
"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": 3736,
|
|
"title": "The Painted Veil172",
|
|
"description": "Mumblecore chia keffiyeh flexitarian. Paleo dreamcatcher venmo meggings everyday normcore banjo. Blue...",
|
|
"readable_publish_date": "Jan 16",
|
|
"slug": "the-painted-veil172-4617",
|
|
"path": "/username382/the-painted-veil172-4617",
|
|
"url": "http://localhost:3000/username382/the-painted-veil172-4617",
|
|
"comments_count": 0,
|
|
"public_reactions_count": 0,
|
|
"collection_id": null,
|
|
"published_timestamp": "2023-01-16T14:44:17Z",
|
|
"positive_reactions_count": 0,
|
|
"cover_image": "http://localhost:3000/assets/27-441873f471d98b5358beff7d47a211e58b9979c6453794f9a7abfd5709c33322.png",
|
|
"social_image": "http://localhost:3000/assets/27-441873f471d98b5358beff7d47a211e58b9979c6453794f9a7abfd5709c33322.png",
|
|
"canonical_url": "http://localhost:3000/username382/the-painted-veil172-4617",
|
|
"created_at": "2023-01-16T14:44:17Z",
|
|
"edited_at": null,
|
|
"crossposted_at": null,
|
|
"published_at": "2023-01-16T14:44:17Z",
|
|
"last_comment_at": "2023-01-16T14:44:17Z",
|
|
"reading_time_minutes": 1,
|
|
"tag_list": ["discuss"],
|
|
"tags": "discuss",
|
|
"user": {
|
|
"name": "Ellsworth \"Elijah\" \\:/ Stehr",
|
|
"username": "username382",
|
|
"twitter_username": "twitter382",
|
|
"github_username": "github382",
|
|
"user_id": 8803,
|
|
"website_url": null,
|
|
"profile_image": "/uploads/user/profile_image/8803/dd94e0b1-e597-4e1e-bad0-b6188e2d6911.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/8803/dd94e0b1-e597-4e1e-bad0-b6188e2d6911.jpeg"
|
|
},
|
|
"organization": {
|
|
"name": "Hoeger Group",
|
|
"username": "org67",
|
|
"slug": "org67",
|
|
"profile_image": "/uploads/organization/profile_image/1618/e09d7538-9c0f-4a19-8351-88298839920b.png",
|
|
"profile_image_90": "/uploads/organization/profile_image/1618/e09d7538-9c0f-4a19-8351-88298839920b.png"
|
|
},
|
|
"flare_tag": {
|
|
"name": "discuss",
|
|
"bg_color_hex": "#000000",
|
|
"text_color_hex": "#ffffff"
|
|
}
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ArticleIndex"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/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": 219,
|
|
"approved": true,
|
|
"body_markdown": "# Hi, this is ad\nYep, it's an ad",
|
|
"cached_tag_list": "",
|
|
"clicks_count": 0,
|
|
"created_at": "2023-01-16T15:44:18.850+01: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-16T15:44:18.850+01: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": 220,
|
|
"approved": false,
|
|
"body_markdown": "Hello _hey_ Hey hey 9",
|
|
"cached_tag_list": "",
|
|
"clicks_count": 0,
|
|
"created_at": "2023-01-16T15:44:18.996+01:00",
|
|
"display_to": "all",
|
|
"impressions_count": 0,
|
|
"name": "Display Ad 220",
|
|
"organization_id": 1619,
|
|
"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-16T15:44:18.999+01: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 221",
|
|
"organization_id": 1620,
|
|
"placement_area": "sidebar_left",
|
|
"published": false,
|
|
"processed_html": "<p>Hello <em>hey</em> Hey hey 10</p>",
|
|
"cached_tag_list": "",
|
|
"id": 221,
|
|
"clicks_count": 0,
|
|
"created_at": "2023-01-16T15:44:19.168+01:00",
|
|
"impressions_count": 0,
|
|
"success_rate": 0.0,
|
|
"type_of": "in_house",
|
|
"updated_at": "2023-01-16T15:44:19.170+01: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/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": 197,
|
|
"created_at": "2023-01-16T14:44:19Z",
|
|
"user_id": 8832,
|
|
"name": "Nannie \"Oswaldo\" \\:/ Dietrich",
|
|
"path": "/username411",
|
|
"username": "username411",
|
|
"profile_image": "/uploads/user/profile_image/8832/4dd0a135-7862-45dc-9e75-6c0111d248f6.jpeg"
|
|
},
|
|
{
|
|
"type_of": "user_follower",
|
|
"id": 196,
|
|
"created_at": "2023-01-16T14:44:19Z",
|
|
"user_id": 8830,
|
|
"name": "Hipolito \"Wilmer\" \\:/ Bailey",
|
|
"path": "/username409",
|
|
"username": "username409",
|
|
"profile_image": "/uploads/user/profile_image/8830/dd5663da-71fb-4db1-84cd-633ddd9d0ee9.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/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": 291,
|
|
"path": "/codenewbie/slug-4",
|
|
"title": "18",
|
|
"image_url": "/uploads/podcast/image/226/b05ba740-f722-433c-8368-9c8be349373b.jpeg",
|
|
"podcast": {
|
|
"title": "Two Hearted Ale",
|
|
"slug": "codenewbie",
|
|
"image_url": "/uploads/podcast/image/226/b05ba740-f722-433c-8368-9c8be349373b.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/8836/bed3e87e-ba27-433d-992a-6eb12b5feff9.jpeg",
|
|
"profile_image_90": "/uploads/user/profile_image/8836/bed3e87e-ba27-433d-992a-6eb12b5feff9.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", "readinglist", "unicorn"]
|
|
}
|
|
},
|
|
{
|
|
"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": 184,
|
|
"reactable_id": 3740,
|
|
"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", "readinglist", "unicorn"]
|
|
}
|
|
},
|
|
{
|
|
"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": 186,
|
|
"reactable_id": 3742,
|
|
"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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/follows/tags": {
|
|
"get": {
|
|
"summary": "FollowedTags",
|
|
"tags": ["followed_tags"],
|
|
"description": "This endpoint allows the client to retrieve a list of the tags they follow.",
|
|
"operationId": "getFollowedTags",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A list of followed tags",
|
|
"content": {
|
|
"application/json": {
|
|
"example": [
|
|
{
|
|
"id": 7875,
|
|
"name": "Tag1",
|
|
"points": 1
|
|
},
|
|
{
|
|
"id": 7876,
|
|
"name": "Tag2",
|
|
"points": 1
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/FollowedTag"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"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"
|
|
]
|
|
},
|
|
"FollowedTag": {
|
|
"description": "Representation of a tag",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"points": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"id",
|
|
"points"
|
|
]
|
|
},
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|