收藏
回答

新增永久素材出错,返回40007提示media_id 无效?

新增素材图片接口采用的是https https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=ACCESS_TOKEN&type=TYPE 

新增永久素材接口采用的是https://api.weixin.qq.com/cgi-bin/material/add_news?access_token=ACCESS_TOKEN



素材库显示图片已经上传成功。

{"articles":[{"title":"111","author":"贾舒喆","content":"<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <title>index</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        .inside{
            border: 2px solid #333;
            border-radius: 2px;
            margin: 40px 20px;
            position: relative;
        }
        .title{
            position: absolute;
            width: 100px;
            background: #FFFFFF;
            height: 34px;
            line-height: 34px;
            text-align: center;
            top: -17px;
            left: 50%;
            transform: translateX(-50%);
            color: #ff0000;
            font-weight: 600;
            font-size: 20px;
        }
        .detail{
            margin: 20px 15px;
        }
        .detail div{
            margin-bottom: 10px;
        }
        .detail p{
            font-size: 16px;
            font-weight: 600;
            color: #333333;
            line-height: 24px;
        }
        .detail span{
            font-size: 15px;
            color: #333333;
            line-height: 22px;
        }

    </style>
</head>
<body>
<div>
        <div class="inside">
        <div class="title">
            <span>信息</span>
        </div>
        <div class="detail">
                        <div>
                <p>111</p>
                <span><p>111</p></span>
            </div>
                        <div>
                <p>标题</p>
                <span><p>内容</p></span>
            </div>
                        <div>
                <p>测试标题jsz</p>
                <span><p>测试标内容sz</p></span>
            </div>
                        <div>
                <p>标题</p>
                <span><p>内容</p></span>
            </div>
                        <div>
                <p>测试信息标题</p>
                <span><p>测试内容</p></span>
            </div>
                        <div>
                <p>we测试标题</p>
                <span><p>1测试内容</p></span>
            </div>
                        <div>
                <p>测试摘要</p>
                <span><p>摘要测试内容</p></span>
            </div>
                        <div>
                <p>测试摘要内容1</p>
                <span><p>测试摘要内容1</p></span>
            </div>
                        <div>
                <p>jiashuzhe1111</p>
                <span><p>jiashuzhe1111jiashuzhe1111jiashuzhe1111jiashuzhe1111</p></span>
            </div>
                        <div>
                <p>摘要11</p>
                <span><p>摘要1摘要1摘要1摘要1摘要1</p></span>
            </div>
                        <div>
                <p>jiashuzhe车市</p>
                <span><p>jiashuzhe车市</p></span>
            </div>
                    </div>
    </div>
        <div class="inside">
        <div class="title">
            <span>战略</span>
        </div>
        <div class="detail">
                        <div>
                <p>四大分卫</p>
                <span><p>手动阀而为人差多少分</p></span>
            </div>
                        <div>
                <p>贾舒喆</p>
                <span><p>贾舒喆贾舒喆</p></span>
            </div>
                        <div>
                <p>哈哈复哈哈</p>
                <span><p>哈哈复哈哈哈哈复哈哈</p></span>
            </div>
                        <div>
                <p>复制附件2</p>
                <span><p>复制附件2复制附件2</p></span>
            </div>
                        <div>
                <p>吃的呀</p>
                <span><p>臭嘚瑟我</p></span>
            </div>
                    </div>
    </div>
    </div>
</body>
</html>","show_cover_pic":"0","content_source_url":"http://www.gslgj.gov.cn/index/index/detail/id/10789.html","thumb_media_id":"4LngvjJ96-_CfbmrDLskiCX88DD1GPV4rLdrv6oTTvYImcIJsQEBdI3hjYsZeHjr"}]}"


最后一次编辑于  2021-03-02
回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2021-03-03

    2021-03-03
    有用
    回复 7
    • Zinn丶 
      Zinn丶 
      2021-03-03
      我发现我的内容带有css样式就会返回40007错误,单纯的html标签内容就可以上传成功,这是什么原因?我的内容才4kb不到。
      2021-03-03
      回复
    • Mr.Zhao
      Mr.Zhao
      2021-03-03回复Zinn丶 
      我复制你的html
      2021-03-03
      回复
    • Zinn丶 
      Zinn丶 
      2021-03-03回复Mr.Zhao
      {"articles":[{"title":"111","author":"贾舒喆","content":"<div>
           <section style="border: 2px solid #333;border-radius: 2px;margin: 40px 20px;position: relative;">
              <div style="position: absolute;width: 100px;background: #FFFFFF;height: 34px;line-height: 34px;text-align: center;top: -17px;left: 50%;transform: translateX(-50%);color: #ff0000;font-weight: 600;font-size: 20px;">
                  <span>信息</span>
              </div>
              <div style="margin: 20px 15px;">
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">111</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>111</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">标题</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>内容</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">测试标题jsz</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>测试标内容sz</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">标题</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>内容</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">测试信息标题</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>测试内容</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">we测试标题</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>1测试内容</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">测试摘要</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>摘要测试内容</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">测试摘要内容1</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>测试摘要内容1</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">jiashuzhe1111</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>jiashuzhe1111jiashuzhe1111jiashuzhe1111jiashuzhe1111</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">摘要11</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>摘要1摘要1摘要1摘要1摘要1</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">jiashuzhe车市</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>jiashuzhe车市</p></span>
                  </div>
                          </div>
          </section >
              <section style="border: 2px solid #333;border-radius: 2px;margin: 40px 20px;position: relative;">
              <div style="position: absolute;width: 100px;background: #FFFFFF;height: 34px;line-height: 34px;text-align: center;top: -17px;left: 50%;transform: translateX(-50%);color: #ff0000;font-weight: 600;font-size: 20px;">
                  <span>战略</span>
              </div>
              <div style="margin: 20px 15px;">
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">四大分卫</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>手动阀而为人差多少分</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">贾舒喆</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>贾舒喆贾舒喆</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">哈哈复哈哈</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>哈哈复哈哈哈哈复哈哈</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">复制附件2</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>复制附件2复制附件2</p></span>
                  </div>
                              <div style="margin-bottom: 10px;">
                      <p style="font-size: 16px;font-weight: 600;color: #333333;line-height: 24px;">吃的呀</p>
                      <span style="font-size: 15px;color: #333333;line-height: 22px;"><p>臭嘚瑟我</p></span>
                  </div>
                          </div>
          </section >
          </div>","show_cover_pic":"0","content_source_url":"http://www.baidu.com","thumb_media_id":"iTa4yeOf0PAWUFymQNIfst0JDuwvvhT8td30KwLNzFs"}]}
      2021-03-03
      回复
    • Zinn丶 
      Zinn丶 
      2021-03-03回复Zinn丶 
      为啥我这个不行,好苦恼。只要带有css就推不过去
      2021-03-03
      回复
    • Mr.Zhao
      Mr.Zhao
      2021-03-03回复Zinn丶 
      到底哪个不行?带有什么CSS?行内css?
      2021-03-03
      回复
    查看更多(2)
登录 后发表内容
问题标签