Skip to content

Commit

Permalink
社区创建官方号内容文档
Browse files Browse the repository at this point in the history
  • Loading branch information
wangbiao committed Sep 25, 2023
1 parent a0ab8df commit 7de515a
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 0 deletions.
45 changes: 45 additions & 0 deletions swagger-docs/en/social/topic/create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
swagger: "2.0"
info:
description: "This API is used to create social official content"
version: "v1"
title: "Create Social Official Content"
paths:
/v1/whaleapi/social/media-topics:
post:
parameters:
- name: "title"
type: "string"
description: "Content title, Required when creating article"
- name: "body"
type: "string"
description: "Content"
required: true
- name: "images"
type: string[]
description: "Post pictures"
responses:
"200":
description: "Create success"
schema:
$ref: "#/definitions/create_media_topic_response"
"400":
description: "The query failed with an error in the request parameter."
request_body:
type: "python"
value: |
curl -v -XPOST https://openapi.longportapp.com/v1/whaleapi/social/media-topics \
-d '{ "body": "美股今天为什么涨了", "title": "" \
-H "X-Api-Signature: {签名}" -H "X-Api-Key: {AppKey}" \
-H "Authorization: {AccessToken}" -H "X-Timestamp: 1539095200.123"
-H "Content-Type: application/json; charset=utf-8"
response_body: { "code": 0, "message": "", "data": { "id": "1" } }
definitions:
create_media_topic_response:
type: "object"
required:
- id
properties:
id:
type: "integer"
description: "Content ID"
required: true
45 changes: 45 additions & 0 deletions swagger-docs/zh-CN/social/topic/create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
swagger: "2.0"
info:
description: "该接口用于创建官方号内容"
version: "v1"
title: "创建官方号内容"
paths:
/v1/whaleapi/social/media-topics:
post:
parameters:
- name: "title"
type: "string"
description: "内容标题,创建长文内容时需要"
- name: "body"
type: "string"
description: "内容"
required: true
- name: "images"
type: string[]
description: "图片链接,创建短文内容附件图片"
responses:
"200":
description: "创建成功"
schema:
$ref: "#/definitions/create_media_topic_response"
"400":
description: "创建失败,请求参数错误"
request_body:
type: "python"
value: |
curl -v -XPOST https://openapi.longportapp.com/v1/whaleapi/social/media-topics \
-d '{ "body": "美股今天为什么涨了", "title": "" \
-H "X-Api-Signature: {签名}" -H "X-Api-Key: {AppKey}" \
-H "Authorization: {AccessToken}" -H "X-Timestamp: 1539095200.123"
-H "Content-Type: application/json; charset=utf-8"
response_body: { "code": 0, "message": "", "data": { "id": "1" } }
definitions:
create_media_topic_response:
type: "object"
required:
- id
properties:
id:
type: "integer"
description: "内容 ID"
required: true
45 changes: 45 additions & 0 deletions swagger-docs/zh-HK/social/topic/create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
swagger: "2.0"
info:
description: "此接口用於創建官方號內容"
version: "v1"
title: "創建官方號內容"
paths:
/v1/whaleapi/social/media-topics:
post:
parameters:
- name: "title"
type: "string"
description: "內容標題,創建長文內容時需要"
- name: "body"
type: "string"
description: "内容"
required: true
- name: "images"
type: string[]
description: "圖片鏈接,創建短文內容附件圖片"
responses:
"200":
description: "創建成功"
schema:
$ref: "#/definitions/create_media_topic_response"
"400":
description: "建立失敗,請求參數錯誤"
request_body:
type: "python"
value: |
curl -v -XPOST https://openapi.longportapp.com/v1/whaleapi/social/media-topics \
-d '{ "body": "美股今天为什么涨了", "title": "" \
-H "X-Api-Signature: {签名}" -H "X-Api-Key: {AppKey}" \
-H "Authorization: {AccessToken}" -H "X-Timestamp: 1539095200.123"
-H "Content-Type: application/json; charset=utf-8"
response_body: { "code": 0, "message": "", "data": { "id": "1" } }
definitions:
create_media_topic_response:
type: "object"
required:
- id
properties:
id:
type: "integer"
description: "內容 ID"
required: true

0 comments on commit 7de515a

Please sign in to comment.