【泛知识】查询课程

更新时间 2024-07-24 02:58:49
收藏
我的收藏

接口说明

该接口用于查询已添加和审核中的课程信息,单次查询不能超过 500 个课程.

业务场景

  • 以课程 id 为维度查询课程信息

基本信息

名称描述
HTTP URL
HTTP Method
POST
Scope
developer.open.product.add
权限要求
查询商品

请求头

名称字段类型是否必填示例描述
content-typeStringapplication/json
固定值"application/json"

请求参数

Body

名称字段类型是否必填示例描述
access_tokenString
调用生成的token
appidStringtt12fd9846e1023401
小程序AppId

请求示例

curl --location --request POST '/product/api/query' \
--header 'content-type: application/json' \
--data '{
  "access_token": "12345678467354704e4f556f66496b774337614d4239784e78513d3d",
  "appid": "tt77fd0140e89bba1234",
  "product_ids": [5432181212227612345, 768781212227612345]
}' 

响应参数

Body

名称字段类型是否必填示例描述
err_msgStringsuccesss
错误内容
err_noInt320
错误码
log_idString101210271802130982251451520919C123
日志id,用于查询错误

响应示例

正常响应示例

{
  "err_msg": "success",
  "err_no": 0,
  "log_id": "202204271324260102252431250D04BCE0",
  "data": {
    "products": [
      {
        "product_on_shelf": {
          "common_product_info": {
            "anchor_info": {
              "video_anchor_info": {
                "anchor_title": "python入门指南"
              }
            },
            "appid": "tt77fd0140e89bba8401",
            "first_class": 30000,
            "industry_type": 1,
            "path_info_lst": [
              {
                "path": "page/index/index",
                "query": {
                  "course_id": "10348594"
                }
              }
            ],
            "price_info": {
              "price": 5000,
              "real_price": 4900,
              "unit": "节"
            },
            "product_detail_lst": [
              {
                "img_uri": "product/resource/f515d1e894139856877b9a31877e6887",
                "text": "课程详情"
              }
            ],
            "product_fulfillment_lst": [
              {
                "fulfillment_content": {
                  "fulfillment_uri": "product/resource/0001d044d41140d53ce9e57d793a4321",
                  "text": "",
                  "name": "课程履约视频"
                },
                "fulfillment_type": 1
              },
              {
                "fulfillment_content": {
                  "fulfillment_uri": "product/resource/1001d044d41140d53ce9e57d793a4321",
                  "text": "",
                  "name": "课程履约音频"
                },
                "fulfillment_type": 2
              },
              {
                "fulfillment_content": {
                  "fulfillment_uri": "product/resource/2001d044d41140d53ce9e57d793a4321",
                  "text": "",
                  "name": "课程履约图片"
                },
                "fulfillment_type": 3
              }
            ],
            "purchase_precaution": "小程序内购买课程为课程兑换权益,购买成功后将自动兑换到您的账户内,可在****中重复学习观看。",
            "qualification_uris": [
              "product/resource/1001d044d41140d53ce9e57d793a4321"
            ],
            "second_class": 30100,
            "third_class": 0,
            "title": "python入门教程"
          },
          "course_info": {
            "teacher_introduction": "华语知名唱片制作人",
            "teacher_id": "T123456",
            "institution_id": "I123456",
            "teacher_img_uri": "xxx",
            "course_num": 12,
            "refund_label": {
              "type": 1,
              "day_before_use_info": {
                "day": 1
              },
              "rest_not_learn_info": {
                "rest_percent": 50
              }
            },
            "start_timestamp": 213124231,
            "end_timestamp": 2131232344,
            "use_label": {
              "valid_date": "",
              "dynamic_valid_date": {
                "year": 0,
                "month": 12,
                "day": 0
              }
            }
          },
          "product_id": 7088891387520812000,
          "product_status": {
            "reject_reason": "xxx",
            "status": 1,
            "latest_audit_id": "KNC12312421312"
          },
          "product_type": 1
        },
        "product_reviewing": {
          "common_product_info": {
            "anchor_info": {
              "video_anchor_info": {
                "anchor_title": "python入门指南"
              }
            },
            "appid": "tt77fd0140e89bba8401",
            "first_class": 30000,
            "industry_type": 1,
            "path_info_lst": [
              {
                "path": "page/index/index",
                "query": {
                  "course_id": "9283746293"
                }
              }
            ],
            "price_info": {
              "price": 100,
              "real_price": 98,
              "unit": "天"
            },
            "product_detail_lst": [
              {
                "img_uri": "product/resource/f515d1e894139856877b9a31877e6887",
                "text": "课程详情"
              }
            ],
            "product_fulfillment_lst": [
              {
                "fulfillment_content": {
                  "fulfillment_uri": "product/resource/0001d044d41140d53ce9e57d793a4321",
                  "text": "",
                  "name": "课程履约视频"
                },
                "fulfillment_type": 1
              },
              {
                "fulfillment_content": {
                  "fulfillment_uri": "product/resource/1001d044d41140d53ce9e57d793a4321",
                  "text": "",
                  "name": "课程履约音频"
                },
                "fulfillment_type": 2
              },
              {
                "fulfillment_content": {
                  "fulfillment_uri": "product/resource/2001d044d41140d53ce9e57d793a4321",
                  "text": "",
                  "name": "课程履约图片"
                },
                "fulfillment_type": 3
              }
            ],
            "purchase_precaution": "小程序内购买课程为课程兑换权益,购买成功后将自动兑换到您的账户内,可在****中重复学习观看。",
            "qualification_uris": [
              "product/resource/1001d044d41140d53ce9e57d793a4321"
            ],
            "second_class": 30100,
            "third_class": 0,
            "title": "python入门教程"
          },
          "course_info": {
            "teacher_introduction": "华语知名唱片制作人",
            "teacher_id": "T123456",
            "institution_id": "I123456",
            "teacher_img_uri": "xxx",
            "course_num": 12,
            "refund_label": {
              "type": 1,
              "day_before_use_info": {
                "day": 1
              },
              "rest_not_learn_info": {
                "rest_percent": 50
              }
            }
          },
          "product_id": 7088891387520812000,
          "product_status": {
            "reject_reason": "xxx",
            "status": 2,
            "latest_audit_id": "KNC12312421312"
          },
          "product_type": 1
        }
      }
    ]
  }
}

异常响应示例

{
  "err_msg": "无效的AccessToken",
  "err_no": 10001,
  "log_id": "2022042713370101022508421703050876"
}

错误码

http状态码错误码错误码描述排查建议
20010000

系统错误

尝试重试,持续发生联系工程师

20010001

无效的AccessToken

检查token是否有效/过期

20010004

AppID错误或AppID参数缺失

检查appID是否填写错误